Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Dataset Adapter: Avoid duplicated annotation and permit empty image #1873

Merged
merged 8 commits into from
Mar 16, 2023

Conversation

sungmanc
Copy link
Contributor

@sungmanc sungmanc commented Mar 9, 2023

This PR includes

  • VOC import error: VOC includes several annotation formats (label, bbox, mask). In this case, if we want to make detection dataset, then we need to filter out the mask, and label annotations. --> len(shapes) >0.
  • However, if there are empty label image that has no annotations (len(annotations)=0), we need to add them to DatasetItemEntity. --> len(datumaro_item.annotations)==0.
  • For the unlabeled dataset, it also be included in DatasetItemEntity. --> subset == Subset.UNLABELED
if len(shapes) > 0 or subset == Subset.UNLABELED or len(datumaro_item.annotations) == 0:

  • To test the empty_label case, I modified the test data that includes the empty_label image.

  • Implement unit-test to validate whether empty_label image is successfully included in DatasetItemEntity or not.

    image

  • Test results
    image

Thanks for reporting this issue. @eunwoosh , @supersoob

@sungmanc sungmanc added the P1 high priority task label Mar 9, 2023
@sungmanc sungmanc added this to the 1.1.0 milestone Mar 9, 2023
@sungmanc sungmanc requested a review from a team as a code owner March 9, 2023 10:59
@github-actions github-actions bot added the TEST Any changes in tests label Mar 9, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 10, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (0e4a8b7) 80.54% compared to head (044e2c1) 80.54%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1873      +/-   ##
===========================================
- Coverage    80.54%   80.54%   -0.01%     
===========================================
  Files          484      484              
  Lines        33005    33007       +2     
===========================================
  Hits         26585    26585              
- Misses        6420     6422       +2     
Impacted Files Coverage Δ
.../core/data/adapter/segmentation_dataset_adapter.py 94.01% <ø> (ø)
otx/core/data/adapter/detection_dataset_adapter.py 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@eunwoosh eunwoosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think dataset w/o annotations need to be filtered out during training stage. I run detection on this branch but it isn't.

tests/unit/core/data/test_helpers.py Outdated Show resolved Hide resolved
@sungmanc sungmanc requested a review from eunwoosh March 10, 2023 04:51
@sungmanc
Copy link
Contributor Author

@eunwoosh , I added logic to avoid inputting the empty image to train dataset. And changed tests/assets.

eunwoosh
eunwoosh previously approved these changes Mar 10, 2023
Copy link
Contributor

@eunwoosh eunwoosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@sungmanc
Copy link
Contributor Author

@supersoob , @jaegukhyun could you recheck this?

@sungmanc sungmanc merged commit e8c7a57 into develop Mar 16, 2023
@sungmanc sungmanc deleted the fix-adapter branch March 16, 2023 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 high priority task TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants