Skip to content

Commit e192e9b

Browse files
authored
fix for #319 (#333)
1 parent 43f2d0c commit e192e9b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

backend/database/images.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,16 @@ def copy_annotations(self, annotations):
150150
:return: number of annotations
151151
"""
152152
annotations = annotations.filter(
153-
width=self.width, height=self.height, area__gt=0).exclude('events')
153+
width=self.width, height=self.height).exclude('events')
154154

155155
for annotation in annotations:
156-
clone = annotation.clone()
156+
if annotation.area > 0 or len(annotation.keypoints) > 0:
157+
clone = annotation.clone()
157158

158-
clone.dataset_id = self.dataset_id
159-
clone.image_id = self.id
159+
clone.dataset_id = self.dataset_id
160+
clone.image_id = self.id
160161

161-
clone.save(copy=True)
162+
clone.save(copy=True)
162163

163164
return annotations.count()
164165

0 commit comments

Comments
 (0)