ultralytics / yolov5

YOLOv5 ๐Ÿš€ in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
49.81k stars 16.12k forks source link

How to get VisDrone labels for train? #2920

Closed nocolour closed 3 years ago

nocolour commented 3 years ago

โ”Question

How to generate visdrone labels?

Additional context

Transferred 356/362 items from yolov5s.pt Scaled weight_decay = 0.0005 Optimizer groups: 62 .bias, 62 conv.weight, 59 other train: Scanning '../VisDrone/VisDrone2019-DET-train/labels.cache' images and labels... 0 found, 6471 missing, 0 empty, 0 corrupted: 100%|โ–ˆ| 6471/6471 [00:00<?, ?it/Traceback (most recent call last): File "train.py", line 544, in train(hyp, opt, device, tb_writer) File "train.py", line 189, in train dataloader, dataset = create_dataloader(train_path, imgsz, batch_size, gs, opt, File "/home/desmond/Projects/Python/yolov5/utils/datasets.py", line 63, in create_dataloader dataset = LoadImagesAndLabels(path, imgsz, batch_size, File "/home/desmond/Projects/Python/yolov5/utils/datasets.py", line 396, in init assert nf > 0 or not augment, f'{prefix}No labels in {cache_path}. Can not train without labels. See {help_url}' AssertionError: train: No labels in ../VisDrone/VisDrone2019-DET-train/labels.cache. Can not train without labels. See https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data train: Scanning '../VisDrone/VisDrone2019-DET-train/labels.cache' images and labels... 0 found, 6471 missing, 0 empty, 0 corrupted: 100%|โ–ˆ| 6471/6471 [00:00<?, ?it/ (env) desmond@Goodboy:~/Projects/Python/yolov5$

github-actions[bot] commented 3 years ago

๐Ÿ‘‹ Hello @nocolour, 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

@nocolour hi there, thanks for asking about our VisDrone autodownload. For this to work correclty, you simply train with the --data visdrone.yaml argument, and the dataset should download and labels should be converted to YOLO format automatically. I'll try it now to make sure it's working.

python train.py --data visdrone.yaml

Ah, I see there's a problem. I'll try to submit a PR to fix this.

glenn-jocher commented 3 years ago

@nocolour good news ๐Ÿ˜ƒ! Your original issue may now been fixed โœ… in PR #2921. To receive this update you can:

Please delete your existing VisDrone download folder and start over with:

python train.py --data visdrone.yaml

Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 ๐Ÿš€!

nocolour commented 3 years ago

Thank you very must. It is working now. thanks Screenshot at 2021-04-27 10-01-05

glenn-jocher commented 3 years ago

Great! ๐Ÿ˜ƒ

miladnasiri commented 1 year ago

hello, how can i convert the annotation to yolo 7 format?

glenn-jocher commented 10 months ago

@miladnasiri hi there! You can convert annotations to YOLO format using the labelImg tool or by writing a script to convert annotations manually. Another option is to use our YOLOv5 datasets tool to automatically convert annotations to YOLO format. Let me know if you need further help!