-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hi, thanks for all of the work put into this newest 0.1.0 release. It's a big improvement!
One little glitch I've run into is that the image filenames written in the metadata/coco_annotations.json output file are incorrect when the --size option is used, and the source images aren't already PNG format files.
The result is a coco format file that uses the resized image coordinates (for bounding boxes, masks, etc.) but continues to use the original source data image filenames, and not the renamed files as output in the resized output subdir.
The issue appears to arise because the resized image output filename constructed here...
# Save resized image
base = Path(relative_path).with_suffix("")
save_path = os.path.join(segmenter.resized_dir, str(base) + ".png")...isn't then propagated to the code where the coco image metadata is recorded (here)
# Initialize COCO annotations for this image
image_id = add_coco_image_info(segmenter.coco_annotations_path, relative_path, working_image.shape)Note that relative_path is used to construct save_path, but that new filename is then ignored in writing the coco image info.
What I expected would happen is either:
- The coco annotation filenames would match those written to the
resizedsubdir, or - The coco bbox and segmentation annotations would be rescaled back to the original source image resolutions.
Thanks again for maintaining this tool, it's proving very useful for our work!