cvat-ai / cvat

Annotate better with CVAT, the industry-leading data engine for machine learning. Used and trusted by teams at any scale, for data of any scale.
https://cvat.ai
MIT License
12.62k stars 3.01k forks source link

Unable to Import COCO, PASCAL, YOLO annotations - Error 500 [Urgent Support Requested] #5977

Closed GitarthVaishnav closed 1 year ago

GitarthVaishnav commented 1 year ago

My actions before raising this issue

When I try to import annotations for a small dataset, CVAT online as well as the locally hosted version throws an error 500 with the error

datumaro.components.errors.datasetnotfounderror: failed to find dataset at '/home/django/data/projects/1/tmp/tmptsnzb3r6'\n"..

in the console.

Steps to Reproduce (for bugs)

  1. Create a Project "XYZ" with 5 labels.

  2. Create a Task and upload images directly (no archive) with local storage option and 100% image quality.

  3. Open the job and upload annotations (archive with just annotation files or JSON file) - I have coco json, yolo, and pascal voc xml annotations - which need to be verified and updated.

    • The YOLO data are in the format: images | 1.jpg | 2.jpg ... labels | 1.txt | 2.txt ... data.yaml data.names obj.data train.txt

    • The COCO JSON data is in the same format except that the images folder has a file named _annotations.json, and there are no labels, data.yaml, etc files and folders.

    • The PASCAL VOC XML data is in the same format except that the images folder has 1.xml, 2.xml etc files and there are no labels, data.yaml, etc files and folders.

  4. CVAT will take the annotations in all formats, and throw the same error after some time and ask to check console.

  5. This is happening with many datasets, also sometimes for 5-7 images it works!

  6. Annotations are not flawed - model trains, tested on roboflow, makesense, and labelimg and it works! Want to use CVAT for better processing as always.

Expected Behaviour

Current Behaviour

Possible Solution

Context

Your Environment

zhiltsov-max commented 1 year ago

Hi, please make sure the uploaded annotations and datasets use the file layouts described here.

GitarthVaishnav commented 1 year ago

It does work with the exact "word to word" file structure and naming. Would it need exact naming convention? obj_train_data, and so on?

Isn't there a generalised file structure?

zhiltsov-max commented 1 year ago

Image file names can be arbitrary, given they are listed in the corresponding subset file (train.txt, valid.txt). Everything else should be the same as in the description. This file layout was borrowed from the YOLO training framework, meaning it should be ready-to-use in the practical use cases. Could you please specify which elements you would like to be optional in the file structure?

elhabchiali commented 1 year ago

If anyone has the same problem, i was able to solve it for the YOLO case by including the images alongside the annotation files.

rafaelgildin commented 8 months ago

@elhabchiali did you export the images with yolo format from roboflow ? If not any advice on how to export roboflow dataset to cvat ? Thanks.