Closed brimoor closed 3 months ago
The COCODetectionDatasetExporter
class in fiftyone/utils/coco.py
has been enhanced with a new coco_id
parameter, allowing users to specify which field contains COCO IDs for each image. This update includes modifications to image ID mapping and export functionalities to accommodate the new parameter, ensuring consistency in handling COCO dataset formats.
File | Change Summary |
---|---|
fiftyone/utils/coco.py |
Added coco_id parameter and corresponding handling in the COCODetectionDatasetExporter class, including adjustments to image ID mapping and export functionalities to use coco_id . |
sequenceDiagram
participant User
participant COCODetectionDatasetExporter
participant System
User->>COCODetectionDatasetExporter: Initialize with coco_id parameter
COCODetectionDatasetExporter->>System: Store coco_id and prepare _image_id_map
User->>COCODetectionDatasetExporter: Invoke log_collection with dataset
COCODetectionDatasetExporter->>System: Use coco_id field for image ID mapping
User->>COCODetectionDatasetExporter: Call export_sample for image export
COCODetectionDatasetExporter->>System: Retrieve and map image ID using coco_id
System->>COCODetectionDatasetExporter: Return mapped image ID
COCODetectionDatasetExporter->>User: Complete image export with updated image ID
🐇 In the land of data, a new key did soar,
To map out the images, COCO IDs to the core.
With codes and numbers, structured and neat,
Exporting samples becomes a treat.
Hopping through data, precise and spry,
Fiftyone's exporter now reaches sky high! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Adds an optional
coco_id
parameter that can be passed whenexport()
ing in COCO format that preserves existing COCO image IDs that are stored on a field of your dataset.Note that, as the example below shows, we already support storing COCO IDs upon import by passing the
include_id=True
parameter.Summary by CodeRabbit