super-gradients
super-gradients copied to clipboard
class DetectionCropImageAndBoxes
🚀 Feature Request
I found in the transforms module of the library a class SegCropImageAndMask(SegmentationTransform).
Is there any similar data augmentation class for Object Detection problems?
In case it has not been implemented, are there any guidelines on how to implement it, we could work on it.
Proposed Solution (Optional)
No response
Hi @davidggphy , yes, we currently don't have such a transform.
The transforms expect a sample {"image": <np.ndarray>, "target": <np.ndarray>} with target in shape [N, 5] following format (x, y, x, y, label) and with N the number of bbox for a given image (the transforms are applied on a single sample, not batch). The output should respect the same format.
Then, in order to make your transform usable when running training from recipe, you should also register it.
You can check DetectionPadToSize, it is a simple example of a transform
Note that you when you pass your transforms to the Dataset, you should always have DetectionTargetsFormatTransform as the last transform since this converts the target format into LABEL_CXCYWH: https://github.com/Deci-AI/super-gradients/blob/a9cee54569c552851e54beba7739c618f90c5830/src/super_gradients/recipes/dataset_params/coco_detection_dataset_params.yaml#L37-L39
Also please check out the contributing page to push to the repo.
Feel free if you have any more question :)
hello @Louis-Dupont ,
thanks for all the info. I created an initial PR here: https://github.com/Deci-AI/super-gradients/pull/1083 could you comment on it?
Closing as stale. Note - we are still happy to come back to your PR should you consider setting up signed commits and addressing comments in the PR