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

Add support for VIA csv file #34

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft

Add support for VIA csv file #34

wants to merge 20 commits into from

Conversation

sfmig
Copy link
Contributor

@sfmig sfmig commented Jan 31, 2025

Rebase after #31

The csv file exported by VIA is not fully complete, in the sense that the mapping from category ID to category name is missing. So not sure it is worth supporting...

Right now the two ways around it would be:

  • Option 1: the category ID is logged in the VIA tool as a string (but note this would fail when exporting as COCO from VIA, as it will be recorded as null category).
  • Option 2: the category ID as an integer is loaded into the dataframe

This PR adds:

  • loader to the io module
  • the validator
  • pending: tests - but note that sample VIAcsv files have already been added to the GIN repository.

To demo it:

from ethology.annotations.io import df_bboxes_from_files
from pathlib import Path

df = df_bboxes_from_files(Path("/path/to/small_bboxes_CSV.csv"), format="VIAcsv")

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?

What does this PR do?

References

Please reference any existing issues/PRs that relate to this PR.

How has this PR been tested?

Please explain how any new code has been tested, and how you have ensured that no existing functionality has changed.

Is this a breaking change?

If this PR breaks any existing functionality, please explain how and why.

Does this PR require an update to the documentation?

If any features have changed, or have been added. Please explain how the
documentation has been updated.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 76.37795% with 30 lines in your changes missing coverage. Please review.

Project coverage is 85.00%. Comparing base (c7e2f7d) to head (023487d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
ethology/annotations/io.py 81.48% 20 Missing ⚠️
ethology/annotations/validators.py 47.36% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            main      #34       +/-   ##
==========================================
+ Coverage   0.00%   85.00%   +85.00%     
==========================================
  Files          1        4        +3     
  Lines          5      220      +215     
==========================================
+ Hits           0      187      +187     
- Misses         5       33       +28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant