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

Validate label types in the serializer #8980

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Jan 22, 2025

Motivation and context

This prevents users from creating labels with unrecognized types.

Along the way, this also fixes the backend LabelType enum to actually correspond to the label types that UI uses. The necessary changes are:

  • Rename bbox to rectangle;
  • Add mask;
  • Remove cuboid_3d.

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • [ ] I have linked related issues (see GitHub docs)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@SpecLad SpecLad requested a review from Marishka17 as a code owner January 22, 2025 12:24
@SpecLad SpecLad force-pushed the labeltype-choicefield branch from 9a3deb7 to 1ab0e42 Compare January 22, 2025 12:33
@SpecLad SpecLad requested a review from nmanovic as a code owner January 22, 2025 12:33
@SpecLad SpecLad force-pushed the labeltype-choicefield branch 2 times, most recently from 7e8082a to 635cd52 Compare January 22, 2025 16:43
@SpecLad SpecLad requested a review from azhavoro as a code owner January 22, 2025 16:43
Also, make `NULL` an invalid label type value, since it seems to be redundant
with `any`.
@SpecLad SpecLad force-pushed the labeltype-choicefield branch from 635cd52 to 89bb3b9 Compare January 22, 2025 16:49
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.84%. Comparing base (f9b7138) to head (89bb3b9).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8980   +/-   ##
========================================
  Coverage    73.84%   73.84%           
========================================
  Files          417      417           
  Lines        44591    44602   +11     
  Branches      4031     4031           
========================================
+ Hits         32927    32938   +11     
  Misses       11664    11664           
Components Coverage Δ
cvat-ui 78.29% <ø> (+<0.01%) ⬆️
cvat-server 70.07% <100.00%> (+<0.01%) ⬆️

@SpecLad SpecLad requested a review from zhiltsov-max January 23, 2025 10:25
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.

2 participants