HumanSignal / label-studio

Label Studio is a multi-type data labeling and annotation tool with standardized output format
https://labelstud.io
Apache License 2.0
18.96k stars 2.36k forks source link

Missing annotation files when exporting Pascal VOC XML files #3738

Open PatrickKudo opened 1 year ago

PatrickKudo commented 1 year ago

Describe the bug When exporting Pascal VOC XML files, some annotation files are not exported even though 100% of images have been annotated using the Label Studio (some with or without labels).

To Reproduce Steps to reproduce the behavior:

  1. Run label-studio from Ubuntu 20.04
  2. Start an image labeling project
  3. Import .JPG files.
  4. Label files & click complete for all images (even images without object)
  5. Go back to project screen and click Export
  6. Export 'Pascal VOC XML'

Expected behavior In my situation, I have gone through 494 .jpg images so I expect 494 XML files, but only get 275 XML files exported in the 'Annotations' folder. When I try exporting YOLO type annotations, I get 494 .txt files in the folder, and I made sure I completed all annotation Tasks in queue.

Screenshots image

Environment (please complete the following information): { "release": "1.7.1", "label-studio-os-package": { "version": "1.7.1", "short_version": "1.7", "latest_version_from_pypi": "1.7.1", "latest_version_upload_time": "2023-01-27T00:16:38", "current_version_is_outdated": false },

"label-studio-os-backend": { "message": "ci: Sync .github (#3611)", "commit": "a8967a0168acb85791cc5c12059bd30b1b3e656b", "date": "2023-01-27 00:38:59 +0400", "branch": "HEAD", "version": "1.7.1+0.ga8967a0.dirty" },

"label-studio-frontend": { "message": "fix: DEV-3917: Revert #1043 (#1088)", "commit": "63855c94bb9df6529781ee84254dad825f3f3db6", "branch": "ls-release/1.7.0", "date": "2022/12/15 08:30:21" },

"dm2": { "message": "fix: DEV-3917: Reinit history after draft applied (#135)", "commit": "7318de4131ccdc4c92bea8f521467c33f7c63c8e", "branch": "ls-release/1.7.0", "date": "2022/12/15 08:30:09" },

"label-studio-converter": { "version": "0.0.48rc0" } }

Additional context Perhaps related to issue #1844

makseq commented 1 year ago

Could you show LS logs when you export the data?

PatrickKudo commented 1 year ago

@makseq Hello, after converting exported YOLO (.txt) files to XML format with additional code and then attempting to train a Mask RCNN model, I received a backend imageio error when it attempted to read in images. Relevant SO discussion

Here's just a sample output of my CLI when I run the export: image

I am thinking I may have some corrupt .JPG files downloaded from the Internet, as no. 59 & 60 in the log suggest there are no annotations found, even though I see them in the queue with clearly annotated rectangles. However, most of the other ones with the null annotation warning are images I collected where I purposefully did not have any annotations (not sure if that would cause an issue).

I am leaning towards this being a data issue but I am not sure.

makseq commented 1 year ago

Seems your images don't have annotations at all: image