From 0ab2c848e12c1ec4fe0cb013705795f6e14df966 Mon Sep 17 00:00:00 2001 From: Justin Brooks Date: Tue, 25 Feb 2020 14:13:14 -0500 Subject: [PATCH] Remove annotated check --- backend/workers/tasks/data.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/workers/tasks/data.py b/backend/workers/tasks/data.py index aa4fb591..6c094216 100644 --- a/backend/workers/tasks/data.py +++ b/backend/workers/tasks/data.py @@ -34,7 +34,7 @@ def export_annotations(task_id, dataset_id, categories): db_categories = CategoryModel.objects(id__in=categories, deleted=False) \ .only(*CategoryModel.COCO_PROPERTIES) db_images = ImageModel.objects( - deleted=False, annotated=True, dataset_id=dataset.id).only( + deleted=False, dataset_id=dataset.id).only( *ImageModel.COCO_PROPERTIES) db_annotations = AnnotationModel.objects( deleted=False, category_id__in=categories) @@ -80,6 +80,10 @@ def export_annotations(task_id, dataset_id, categories): annotations = db_annotations.filter(image_id=image.get('id'))\ .only(*AnnotationModel.COCO_PROPERTIES) annotations = fix_ids(annotations) + + if len(annotations) == 0: + break + num_annotations = 0 for annotation in annotations: @@ -303,4 +307,4 @@ def import_annotations(task_id, dataset_id, coco_json): task.set_progress(100, socket=socket) -__all__ = ["export_annotations", "import_annotations"] \ No newline at end of file +__all__ = ["export_annotations", "import_annotations"]