Skip to content

Commit

Permalink
Merge pull request DLR-RM#913 from DLR-RM/iss_912_fix_coco_writer
Browse files Browse the repository at this point in the history
fix(DLR-RM#912): coco writer if annotations are empty
  • Loading branch information
cornerfarmer authored Jun 1, 2023
2 parents a283863 + 086bbb2 commit ef96211
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion blenderproc/python/writer/BopWriterUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,10 @@ def calc_gt_coco(chunk_dirs: List[str], dataset_objects: List[MeshObject], start
if dir_counter == 0 and starting_frame_id > 0:
misc.log(f"Loading coco annotations from existing chunk dir - {chunk_dir}")
coco_scene_output = _BopWriterUtility.load_json(os.path.join(chunk_dir, 'scene_gt_coco.json'))
segmentation_id = coco_scene_output["annotations"][-1]['id'] + 1
if coco_scene_output["annotations"]:
segmentation_id = coco_scene_output["annotations"][-1]['id'] + 1
else:
segmentation_id = 1
else:
coco_scene_output = {
"info": INFO,
Expand Down

0 comments on commit ef96211

Please sign in to comment.