Closed SpecLad closed 3 months ago
[!IMPORTANT]
Review skipped
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
The recent changes across the cvat-core
and cvat-ui
modules involve the removal of the CLASSIFIER
model kind from various parts of the codebase. This includes adjusting interfaces, enums, and logic handling classifiers, as well as updating UI components to reflect these changes. Additionally, a new method displayKind
was introduced in the MLModel
class to provide a user-friendly display of model kinds.
File(s) | Change Summary |
---|---|
cvat-core/src/core-types.ts |
Updated SerializedModel interface to allow kind property as ModelKind or 'classifier' . |
cvat-core/src/enums.ts |
Removed CLASSIFIER from ModelKind enum. |
cvat-core/src/ml-model.ts |
Added displayKind method to MLModel class for a display-friendly version of model kind. |
cvat-ui/src/components/model-runner-modal/detector-runner.tsx |
Simplified model kind logic, removed handling for ModelKind.CLASSIFIER , and refactored UI element visibility conditions. |
cvat-ui/src/components/model-runner-modal/model-runner-dialog.tsx |
Removed classifiers from StateToProps interface and related logic in ModelRunnerDialog component. |
cvat-ui/src/components/models-page/deployed-model-item.tsx |
Updated model kind display to use displayKind . |
cvat-ui/src/components/models-page/deployed-models-list.tsx |
Removed classifiers from the list of models in setUpModelsList . |
cvat-ui/src/reducers/index.ts |
Removed classifiers field from ModelsState interface. |
cvat-ui/src/reducers/models-reducer.ts |
Removed handling of classifiers from state and actions in the ModelsState and reducer logic. |
In the land of code so bright,
Models change, and take their flight.
No more classifiers in sight,
DisplayKind shines with pure delight.
UI and core, now aligned tight,
Together, they soar to new height.
🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@bsekachev , could you please look. It is UI code.
Failed conditions
13.9% Duplication on New Code (required ≤ 3%)
Motivation and context
I'd like the "kind" field in the API to identify the function's "signature", or the types of values it receives as input and produces as output. Classifiers have the same signature as detectors, so
classifier
is a redundant value.Besides improving semantic purity, removing this redundant value simplifies the UI code.
The only meaningful difference between how the UI handles classifiers, as compared to detectors, is that it shows the word "classifier" in the model modal, which can be helpful. But we can achieve the same thing by examining the function's
return_type
field. This lets us give a special label to segmentation functions, as well."classifier" can't actually be returned by
/api/lambda/functions
, but it can be returned by the RoboFlow/Hugging Face function API in CVAT Enterprise. So we'll need a small compatibility shim to transform this value to "detector" until I fix that API to stop returning it too.How has this been tested?
I made sure that a classifier function hosted on Hugging Face is still shown as a classifier and can still be invoked.
Checklist
develop
branch[ ] I have created a changelog fragment[ ] I have updated the documentation accordingly[ ] I have added tests to cover my changesLicense
Summary by CodeRabbit
New Features
displayKind
in the MLModel class for a user-friendly display of model kinds.Bug Fixes
Refactor
displayKind
property for model kinds.classifiers
entity and related logic from various components and state management to streamline the model handling process.