ZeroDivisionError
from Empty MultiPolygon in slicing.process_coco_annotations
#1075
-
DescriptionAn error The exception is thrown at: Line 145 in 16c45ac The problem arises specifically within the Lines 238 to 240 in 16c45ac Steps to Reproduce
Environment Setup
You can install these dependencies using the following pip command: pip install sahi Code Exemplefrom sahi.slicing import slice_coco
coco_annotation_file_path = 'path/to/coco_segmentation.json'
image_dir = 'path/to/images'
output_coco_annotation_file_name = './coco_sahi_segmentation.json'
output_dir='./path/to/output'
size = 320
ratio = 0.2
coco_dict, coco_path = slice_coco(
coco_annotation_file_path=coco_annotation_file_path,
image_dir=image_dir,
output_coco_annotation_file_name=output_coco_annotation_file_name,
slice_height=size,
slice_width=size,
overlap_height_ratio=ratio,
overlap_width_ratio=ratio,
output_dir=output_dir,
) Sample
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for the detailed analysis, @matheuslima29 ! It would be amazing if you could open a PR with your suggestions 💯 |
Beta Was this translation helpful? Give feedback.
Thanks for the detailed analysis, @matheuslima29 ! It would be amazing if you could open a PR with your suggestions 💯