Skip to content

Commit 0ab2c84

Browse files
authored
Remove annotated check
1 parent 18b3279 commit 0ab2c84

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

backend/workers/tasks/data.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def export_annotations(task_id, dataset_id, categories):
3434
db_categories = CategoryModel.objects(id__in=categories, deleted=False) \
3535
.only(*CategoryModel.COCO_PROPERTIES)
3636
db_images = ImageModel.objects(
37-
deleted=False, annotated=True, dataset_id=dataset.id).only(
37+
deleted=False, dataset_id=dataset.id).only(
3838
*ImageModel.COCO_PROPERTIES)
3939
db_annotations = AnnotationModel.objects(
4040
deleted=False, category_id__in=categories)
@@ -80,6 +80,10 @@ def export_annotations(task_id, dataset_id, categories):
8080
annotations = db_annotations.filter(image_id=image.get('id'))\
8181
.only(*AnnotationModel.COCO_PROPERTIES)
8282
annotations = fix_ids(annotations)
83+
84+
if len(annotations) == 0:
85+
break
86+
8387
num_annotations = 0
8488
for annotation in annotations:
8589

@@ -303,4 +307,4 @@ def import_annotations(task_id, dataset_id, coco_json):
303307
task.set_progress(100, socket=socket)
304308

305309

306-
__all__ = ["export_annotations", "import_annotations"]
310+
__all__ = ["export_annotations", "import_annotations"]

0 commit comments

Comments
 (0)