ultralytics / yolov5

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

How to create .yaml files? #2599

Closed Duarte-Nunes closed 3 years ago

Duarte-Nunes commented 3 years ago

❔Question

Is there a way or tutorial that you can make avaiable that would allow for easily creating .yaml files for existing models?

Additional context

I have been studying yolov4 but wanted to use this repository since its always up to date and works like a charm, however there is currently no yolov4.yaml file.

I saw another issue where this same question was made but the yolov4.yaml that was suggested by a user wasn't entirelly accurate, is there something that i can use as a guide to learn how to write the .yaml files?

github-actions[bot] commented 3 years ago

👋 Hello @Duarte-Nunes, thank you for your interest in 🚀 YOLOv5! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

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 training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

Requirements

Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:

$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

glenn-jocher commented 3 years ago

@Duarte-Nunes yes, you should be able to design any model really using a yaml file, as long as the custom modules are available also in models/common.py or models/experimental.py.

We tried to make the repo as model agnostic as possible, so it should be able to build and train all kinds of detection and classification models, and hopefully segmentation models in the future as well.

Duarte-Nunes commented 3 years ago

@glenn-jocher Howdy, thank you for you response, by taking a look at WongKinYiu/PyTorch_YOLOv4 and YoloV5 and going back and forth comparing yaml and cfg files i think i was able to create a yolov4-tiny.yaml and yolov4-tiny-3l.yaml files.

On another note i have a question about the img size, when you have an anotation on an image in YOLO format and then its resized to 640 (or other sizes) do the boxes on the anotations also get resized?

I'm asking because im trying to make a custom dataset however i want to now if i should annotate the images after converting them to 640x640 or i could just annotate them at any size and they get auto scaled.

glenn-jocher commented 3 years ago

@Duarte-Nunes YOLO format labels used normalized image coordinates in the range of 0-1, so they are independent of image sizes.

That's great that you got some new model yamls created! Please consider submitting a PR with these additions to help provide everyone else access to these also, thank you!

glenn-jocher commented 3 years ago

@Duarte-Nunes BTW, for full details on the YOLO format labels see: https://docs.ultralytics.com/yolov5/tutorials/train_custom_data#2-create-labels

2. Create Labels

After using a tool like CVAT, makesense.ai or Labelbox to label your images, export your labels to YOLO format, with one *.txt file per image (if no objects in image, no *.txt file is required). The *.txt file specifications are:

Image Labels

The label file corresponding to the above image contains 2 persons (class 0) and a tie (class 27):

Duarte-Nunes commented 3 years ago

@glenn-jocher Thank you for the timely answers. I'll submit a PR with the files soon, just need to touch them up a bit to get rid of the janky names i used for the modules XD

glenn-jocher commented 3 years ago

Great! Yes, I would try to at least provide one line comment describing each module and linking to a source if applicable, i.e.: https://github.com/ultralytics/yolov5/blob/ee169834bd0edf4e03b555688053da7bdd05a71e/models/experimental.py#L46-L57

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.