Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get VisDrone labels for train? #2920

Closed
nocolour opened this issue Apr 24, 2021 · 7 comments · Fixed by #2921
Closed

How to get VisDrone labels for train? #2920

nocolour opened this issue Apr 24, 2021 · 7 comments · Fixed by #2921
Labels
question Further information is requested

Comments

@nocolour
Copy link

nocolour commented Apr 24, 2021

❔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$

@nocolour nocolour added the question Further information is requested label Apr 24, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Apr 24, 2021

👋 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.

@nocolour nocolour changed the title VisDrone labels How to get VisDrone labels for train? Apr 24, 2021
@glenn-jocher
Copy link
Member

@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
Copy link
Member

@nocolour good news 😃! Your original issue may now been fixed ✅ in PR #2921. To receive this update you can:

  • git pull from within your yolov5/ directory
  • git clone https://github.com/ultralytics/yolov5 again
  • Force-reload PyTorch Hub: model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)

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
Copy link
Author

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

@glenn-jocher
Copy link
Member

Great! 😃

@miladnasiri
Copy link

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

@glenn-jocher
Copy link
Member

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants