Yolov5: Train image size and image prediction size must have same pixels ?

Created on 16 Sep 2020  Â·  8Comments  Â·  Source: ultralytics/yolov5

❔Question

  1. in Yolov5, i trained 1000 data image with random image size, like 1024x768 or 640x480 etc, is it wrong ?
  2. trained required same size ? Example 640x640 all for data trained ?
  3. data image to predict must have same size with data trained, example trained data is 640x480 then test image have size 1024x768 ?

Thank you

question

Most helpful comment

@luvwinnie train and detect at the same --img-size for best results.

All 8 comments

Hello @blinkbink, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook Open In Colab, Docker Image, and Google Cloud Quickstart Guide for example environments.

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom model or data training question, please note Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:

  • Cloud-based AI systems operating on hundreds of HD video streams in realtime.
  • Edge AI integrated into custom iOS and Android apps for realtime 30 FPS video inference.
  • Custom data training, hyperparameter evolution, and model exportation to any destination.

For more information please visit https://www.ultralytics.com.

You don’t need to resize them manually. It just works which is great.

I don’t know if there’s a “perfect” image size to use. It should be up to your experiment.

i took a dataset with 4k and trained with 640, however, it seems like I need to use --img-size=3840 with detect.py to detect correctly, anyway to get the best performance for any size?

@luvwinnie train and detect at the same --img-size for best results.

@glenn-jocher how about the size on training data but with base width is 640, i mean the base width is 640 but have various height like 320x640, 480x640, 221x640, so just can resize by width, not both height and width, because if i resize with same size 640x640 got strecth image

@blinkbink train and detect at the same --img-size for best results, such as the default --img 640.

yes sorry, i don't understand, i mean --image-size 640 is for 640x640 right ? how about various like 480x640, 320x640, 211x640 ?

@blinkbink you only supply the longest dimension, --img 640. The rest is handled automatically.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Alex-afka picture Alex-afka  Â·  3Comments

ShreshthSaxena picture ShreshthSaxena  Â·  4Comments

hktxt picture hktxt  Â·  3Comments

DucTaiVu picture DucTaiVu  Â·  3Comments

jaqub-manuel picture jaqub-manuel  Â·  4Comments