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

Replace VOC format support in CVAT with Datumaro #1167

Merged
merged 8 commits into from
Feb 26, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Materialize lazy transforms in voc export
zhiltsov-max committed Feb 21, 2020
commit e57919fb9e84be52f2710d04f0c1b42060f0d20a
3 changes: 2 additions & 1 deletion cvat/apps/annotation/pascal_voc.py
Original file line number Diff line number Diff line change
@@ -39,14 +39,15 @@ def load(file_object, annotations):
def dump(file_object, annotations):
from cvat.apps.dataset_manager.bindings import CvatAnnotationsExtractor
from cvat.apps.dataset_manager.util import make_zip_archive
from datumaro.components.project import Environment
from datumaro.components.project import Environment, Dataset
from tempfile import TemporaryDirectory

env = Environment()
id_from_image = env.transforms.get('id_from_image_name')

extractor = CvatAnnotationsExtractor('', annotations)
extractor = extractor.transform(id_from_image)
extractor = Dataset.from_extractors(extractor) # apply lazy transforms
converter = env.make_converter('voc_detection')
with TemporaryDirectory() as temp_dir:
converter(extractor, save_dir=temp_dir)