ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.22k stars 16.21k forks source link

Modification of the COCO format to update the new coordinates of the object as per the rotated object #5353

Closed jaiswati closed 2 years ago

jaiswati commented 2 years ago

Hi @glenn-jocher

Thank you for the responses !!

is that advisable to modify the COCO format to update the coordinates of the object with a python script, as the original training image is rotated with OpenCV python script, so the corresponding position of the bb-box and mask has to be rotated? or is there any alternative to this like rotation augmentation etc. that automatically takes care of rotating bb-box/masks etc? Actually, In some of the training images, on circular ring numbers and characters are printed, we found that if numbers/characters are rotated(tilted), then model detection accuracy is less, vs when numbers/characters are not rotated (tilted) then model detection accuracy is more, so we are thinking to change the training images and modifying corresponding box/mask co-ordinates in COCO format. Best Regards, @jaiswati

glenn-jocher commented 2 years ago

@jaiswati 👋 Hello! Thanks for asking about image augmentation. YOLOv5 🚀 applies online imagespace and colorspace augmentations in the trainloader (but not the testloader) to present a new and unique augmented Mosaic (original image + 3 random images) each time an image is loaded for training. Images are never presented twice in the same way.

YOLOv5 augmentation

The hyperparameters used to define these augmentations are in your hyperparameter file (default data/hyp.scratch.yaml) defined when training:

python train.py --hyp hyp.scratch.yaml

https://github.com/ultralytics/yolov5/blob/90b7895d652c3bd3d361b2d6e9aee900fd67f5f7/data/hyp.scratch.yaml#L1-L33

You can view the effect of your augmentation policy in your train_batch*.jpg images once training starts. These images will be in your train logging directory, typically yolov5/runs/train/exp:

train_batch0.jpg shows train batch 0 mosaics and labels:

Good luck and let us know if you have any other questions!

github-actions[bot] commented 2 years ago

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!