question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adds support in augmentation for keypoints

See original GitHub issue

Short Description

I am interested to use RandAugment for object detection with keypoints. Instead of re-doing everything on my own, I would like to add support for keypoints in the augmentation present in this repo.

Papers

None I know off

Existing Implementations

Already have some PR

Other Information

I would propose to:

  • Add BaseImageAugmentationLayer.augment_keypoints(self,keypoints,transformation,**kwargs) method
  • Modify BaseImageAugmentationLayer._augment() to augment keypoints if passed as a dict.
  • Modify BaseImageAugmentationLayer.get_random_transformation() to accept keypoints as an argument
  • Makes sures all augmentations in RandAugment do implement augment_keypoints and augment_bounding_boxes. This will require to re-implement by compositon RandomContrast,RandomBrightness,RandomTranslation

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
atuleucommented, Jul 21, 2022

Following the discussion in #519, here are the tasks to perform in single PR from atuleu/keras-cv@dev/keypoints:

  • create a PR adding support for keypoint formats & utilities (discard out of image, converters, etc) -> #585
  • update the BaseImageAugmentationLayer in a PR -> #586
  • add ALL of the no-op augmentations in a single PR; so all of the ones that just return keypoints -> #588
  • Adds a function to generalize how bounding boxes should be augmented -> #599
  • Add augmentation logic to RandomTranslation (with demonstration)
  • Refactor and add augmentation logic to RandomRotation (with demonstration)
  • Imports and add augmentation logic to RandomContrast
  • Imports and add augmentation logic to RandomBrightness
  • Add augmentation logic to RandomResizedCrop
  • Add augmentation logic to RandomShear (with demonstration)
1reaction
atuleucommented, Jun 29, 2022

@atuleu

I think bounding box augmentation is erroneous for shear and rotation transform. This will lead to larger bounding boxes than the bounding box covering the sheared/rotated object. Shouldn’t the library show some kind of warning if approximative bounding boxes augmentation are made ?

Bounding boxes should be clipped in that cases and same goes to keypoint type as well. Isn’t it take in account by already in shear transformation? Mentioning @pranavjadhav001 to comment on this as he’s working on it now.

@innat

So there was no augment_bounding_box() for RandomShear ( I added it here aa4a178a60bbdccfb9c4881409a652363c51e45b ). There was last week some augment_bounding_box() for RandomRotation , but no clipping.

@LukeWood I think we should go for a reduced amount of format of ‘xy’ and ‘rel_xy’. Then if more format are needed, they could always be added afterwards. Should I go forward and add this to #519 ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keypoints augmentation - Albumentations Documentation
You pass an image and keypoints to the augmentation pipeline and receive augmented images and ... Some transforms in Albumentation don't support keypoints....
Read more >
Facial Keypoints Detection: Image and Keypoints Augmentation
First, we do some augmentation where keypoints are not really affected by them. Using Imgaug library, we will add Gaussian Blurring and ...
Read more >
add keypoints-augmentation benchmark · Issue #554 - GitHub
As you support keypoints augmentations as well, I think you are missing a benchmark on that type of data specifically. imgaug for example, ......
Read more >
Data augmentation for facial keypoint detection - Yumi's Blog
Data augmentation is an essential technique to utilize limited amount of training images. In my previous blog post, I have seen poor performance ......
Read more >
imgaug.augmentables.kps - Read the Docs
x (number) – Coordinate of the keypoint on the x axis. ... Added in 0.4.0. ... augmenting keypoints with a method that only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found