Skip to content

Commit

Permalink
Merge pull request #101 from IDEA-Research/bugfix/import_image
Browse files Browse the repository at this point in the history
bugfix(import image): fix error of only saving the first object of image
  • Loading branch information
imhuwq authored Sep 25, 2023
2 parents d89d502 + 7a63fca commit bcfb29c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions deepdataspace/io/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def run_import(self):
self.add_user_data(image)
for anno in anno_list:
image.batch_add_annotation(**anno)
image.finish_batch_add_annotation()
logger.debug(f"time cost of import one image: {int(time.time() * 1000) - beg}ms")
logger.debug(f"imported image, id={image.id}, url={image.url}")
self.dataset.finish_batch_add_image()
Expand Down
1 change: 1 addition & 0 deletions deepdataspace/model/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ def batch_add_annotation(self,
conf=conf, is_group=is_group, confirm_type=confirm_type)
self.objects.append(anno_obj)

def finish_batch_add_annotation(self):
self.dataset.batch_save_image(self)


Expand Down

0 comments on commit bcfb29c

Please sign in to comment.