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

Converting CVAT into Yolo #43

Closed
Samjith888 opened this issue Oct 23, 2020 · 2 comments · Fixed by #45
Closed

Converting CVAT into Yolo #43

Samjith888 opened this issue Oct 23, 2020 · 2 comments · Fixed by #45

Comments

@Samjith888
Copy link

Samjith888 commented Oct 23, 2020

script

from datumaro.components.project import Environment
from datumaro.plugins.yolo_format.converter import YoloConverter

# Import and save a dataset
env = Environment()
dataset = env.make_importer("cvat")(str(self.dataset_path)).make_dataset()
 env.converters.get("yolo").convert(dataset, save_dir="dst/dir")

Dataset folder structure

---dataset
        |----report.xml
        |----images
                  |-----forest1
                           |-----1.jpg
                           |-----2.jpg
                  |-----forest2
                           |---3.jpg

While converting CVAT into yolo format by using above code, got following error ,,

Traceback (most recent call last):
File "main.py", line 118, in
app.run(main)
File "/root/anaconda3/envs/aug/lib/python3.8/site-packages/absl/app.py", line 300, in run
_run_main(main, args)
File "/root/anaconda3/envs/aug/lib/python3.8/site-packages/absl/app.py", line 251, in _run_main
sys.exit(main(argv))
File "main.py", line 114, in main
ss.produce()
File "main.py", line 77, in produce
handle_dataset.cvat2yolo()
File "/home/sam/ss/utils/dataset_generator.py", line 135, in cvat2yolo
dataset = env.make_importer("cvat")(str(self.dataset_path)).make_dataset()
File "/root/anaconda3/envs/aug/lib/python3.8/site-packages/datumaro/components/project.py", line 600, in make_dataset
return ProjectDataset(self)
File "/root/anaconda3/envs/aug/lib/python3.8/site-packages/datumaro/components/project.py", line 318, in init
sources[s_name] = env.make_extractor(s_format, url, **options)
File "/root/anaconda3/envs/aug/lib/python3.8/site-packages/datumaro/components/project.py", line 284, in make_extractor
return self.extractors.get(name)(*args, **kwargs)
File "/root/anaconda3/envs/aug/lib/python3.8/site-packages/datumaro/plugins/cvat_format/extractor.py", line 33, in init
items, categories = self._parse(path)
File "/root/anaconda3/envs/aug/lib/python3.8/site-packages/datumaro/plugins/cvat_format/extractor.py", line 94, in _parse
attr_value = float(attr_value)
TypeError: float() argument must be a string or a number, not 'NoneType'

@zhiltsov-max
Copy link
Contributor

Hi, could you share the .xml annotations (maybe privately)?

@Samjith888
Copy link
Author

Hi, could you share the .xml annotations (maybe privately)?

Thank you for your response .. I have sent the xml file to your mail id.. Please check it

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

Successfully merging a pull request may close this issue.

2 participants