ultralytics / yolov5

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

How to train on 128*4500 pictures #3701

Closed woshichunge12 closed 3 years ago

woshichunge12 commented 3 years ago

❔Question

I don’t want it to fill 128 to 4500, it consumes resources too much

Additional context

TehKonnos commented 3 years ago

Try resizing them. Don't forget to keep the aspect-ratio though.

woshichunge12 commented 3 years ago

@TehKonnos Thank you very much for your reply. The picture is the result of the original image after being stretched. Do you mean that I process the picture or modify the code? I found that the aspect-ratio of the image in the code has been processed. It seems that I don’t need to deal with pictures. As long as --rect is used during training, non-square pictures will be processed. like this: python train.py --img 2560 --batch 1 --epochs 5 --data coco128.yaml --weights yolov5s.pt --nosave --rect image

TehKonnos commented 3 years ago

I recommend to resize the picture as a square and add paddings where neened. Then use the --img xx to train. I don't think --rect is for that case.

glenn-jocher commented 3 years ago

@woshichunge12 yes --rect will use rectangular training rather than square mosaic training.

github-actions[bot] commented 3 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 ⭐!