coco-annotator icon indicating copy to clipboard operation
coco-annotator copied to clipboard

Allow relative pathnames for importing/exporting annotations

Open uwer opened this issue 4 years ago • 0 comments

A new attribute has been added to the ImageModel to capture the relative path of an image at import time as well as scanning. if there are no sub-directories this variable will be equal to the file_name, however the search logic will use the relative pathname to discover the image. The relative path is defined as 'absolute image path' relative to 'dataset path' When exporting the relative path will replace the 'file_name' entry in the 'image' dictionary, this behaviour can be switched off by setting the 'EXPORT_RELPATH' environment variable to false (in the compose file for the workers). If the annotation only contains a bbox and no valid segmentation the segmentation is derived form the bbox. Previously this annotation would have been ignored. This behaviour relies on an empty segmentation (including a potentially empty element) and a valid bbox (workers/tasks/data.py:256). This addresses implicitly also pull request #421 and #453

uwer avatar Jul 30 '21 03:07 uwer