-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Support Target metric
in quality UI
#8347
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes introduce a new feature for enhancing quality settings in the application, including the addition of a "Target metric" and associated thresholds. Updates were made to various files, including the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant QualitySettingsModal
participant QualitySettings
participant QualityReport
User->>QualitySettingsModal: Set target metric and threshold
QualitySettingsModal->>QualitySettings: Update settings
QualitySettings->>QualityReport: Apply new metrics
QualityReport-->>User: Display updated quality metrics
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? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (14)
- changelog.d/20240826_171536_klakhov_update_quality_settings.md (1 hunks)
- cvat-core/package.json (1 hunks)
- cvat-core/src/quality-settings.ts (5 hunks)
- cvat-core/src/server-response-types.ts (1 hunks)
- cvat-ui/package.json (1 hunks)
- cvat-ui/src/components/analytics-page/shared/quality-settings-modal.tsx (1 hunks)
- cvat-ui/src/components/analytics-page/task-quality/gt-conflicts.tsx (1 hunks)
- cvat-ui/src/components/analytics-page/task-quality/issues.tsx (1 hunks)
- cvat-ui/src/components/analytics-page/task-quality/job-list.tsx (4 hunks)
- cvat-ui/src/components/analytics-page/task-quality/mean-quality.tsx (2 hunks)
- cvat-ui/src/components/analytics-page/task-quality/quality-settings-form.tsx (4 hunks)
- cvat-ui/src/components/analytics-page/task-quality/task-quality-component.tsx (7 hunks)
- cvat-ui/src/cvat-core-wrapper.ts (2 hunks)
- cvat-ui/src/utils/quality.ts (1 hunks)
Files skipped from review due to trivial changes (4)
- cvat-core/package.json
- cvat-ui/package.json
- cvat-ui/src/components/analytics-page/task-quality/gt-conflicts.tsx
- cvat-ui/src/components/analytics-page/task-quality/issues.tsx
Additional comments not posted (52)
changelog.d/20240826_171536_klakhov_update_quality_settings.md (1)
1-4
: LGTM!The changelog entry is clear and concise, providing necessary information about the new feature.
The code changes are approved.
cvat-ui/src/components/analytics-page/task-quality/mean-quality.tsx (3)
11-12
: LGTM!The new imports are necessary for the added functionality.
The code changes are approved.
18-18
: LGTM!The new property
targetMetric
is necessary for the added functionality.The code changes are approved.
23-25
: LGTM!The changes to the
MeanQuality
function are necessary for the added functionality and improve the flexibility of the component.The code changes are approved.
Also applies to: 93-93
cvat-ui/src/components/analytics-page/shared/quality-settings-modal.tsx (1)
36-41
: LGTM!The changes to the
onOk
function are necessary for the added functionality and improve the configurability of the quality settings.The code changes are approved.
cvat-ui/src/cvat-core-wrapper.ts (2)
24-24
: LGTM!The import statement correctly includes
TargetMetric
.The code changes are approved.
94-94
: LGTM!The export statement correctly includes
TargetMetric
.The code changes are approved.
cvat-ui/src/utils/quality.ts (7)
9-14
: LGTM!The
QualityColors
enum is correctly implemented.The code changes are approved.
16-16
: LGTM!The
BASE_TARGET_THRESHOLD
constant is correctly defined.The code changes are approved.
18-22
: LGTM!The
ratios
object is correctly defined.The code changes are approved.
24-48
: LGTM!The
qualityColorGenerator
function is correctly implemented.The code changes are approved.
50-82
: LGTM!The
sorter
function is correctly implemented.The code changes are approved.
85-91
: LGTM!The
collectUsers
function is correctly implemented.The code changes are approved.
93-124
: LGTM!The
toRepresentation
,percent
, andclampValue
functions are correctly implemented.The code changes are approved.
cvat-core/src/quality-settings.ts (14)
9-13
: LGTM!The
TargetMetric
enum is correctly defined.The code changes are approved.
17-17
: LGTM!The
#targetMetric
private property is correctly defined and initialized.The code changes are approved.
18-18
: LGTM!The
#targetMetricThreshold
private property is correctly defined and initialized.The code changes are approved.
19-19
: LGTM!The
#maxValidationsPerJob
private property is correctly defined and initialized.The code changes are approved.
158-160
: LGTM!The
targetMetric
getter is correctly implemented.The code changes are approved.
162-164
: LGTM!The
targetMetric
setter is correctly implemented.The code changes are approved.
166-168
: LGTM!The
targetMetricThreshold
getter is correctly implemented.The code changes are approved.
170-172
: LGTM!The
targetMetricThreshold
setter is correctly implemented.The code changes are approved.
174-176
: LGTM!The
maxValidationsPerJob
getter is correctly implemented.The code changes are approved.
178-180
: LGTM!The
maxValidationsPerJob
setter is correctly implemented.The code changes are approved.
196-198
: LGTM!The
toJSON
method is correctly updated to include new properties.The code changes are approved.
214-217
: LGTM!The
save
method is correctly updated to include the new properties.The code changes are approved.
214-217
: LGTM!The
implementation
function is correctly updated to include the new properties.The code changes are approved.
214-217
: LGTM!The
Object.defineProperties
call is correctly updated to include the new properties.The code changes are approved.
cvat-ui/src/components/analytics-page/task-quality/job-list.tsx (6)
9-16
: ImportTargetMetric
andQualityColors
correctly.The imports are correctly added for
TargetMetric
andQualityColors
.The code changes are approved.
20-22
: Import utility functions correctly.The imports for
collectUsers
,QualityColors
,sorter
, andtoRepresentation
are correctly added.The code changes are approved.
28-29
: UpdateProps
interface.The
Props
interface is updated to includegetQualityColor
andtargetMetric
. This allows the component to dynamically handle quality metrics and colors.The code changes are approved.
36-37
: Destructure new props.The new props
getQualityColor
andtargetMetric
are correctly destructured fromprops
.The code changes are approved.
99-101
: Update filters incolumns
definition.The
filters
attribute in theAssignee
column is updated to callcollectUsers
withjobsReportsArray
. This change dynamically filters users based on the current job reports.The code changes are approved.
153-157
: UpdateQuality
column to usetargetMetric
.The
sorter
function for theQuality
column is updated to usetargetMetric
. The rendering logic for mean accuracy is also updated to access the summary usingtargetMetric
. This allows the component to display the relevant metric according to the current context.Consider handling cases where
targetMetric
might not be present inreport.summary
to avoid potential runtime errors.Ensure that
targetMetric
is always present inreport.summary
or handle cases where it might be missing.cvat-ui/src/components/analytics-page/task-quality/task-quality-component.tsx (7)
13-16
: ImportTargetMetric
andQualityColors
correctly.The imports are correctly added for
TargetMetric
andQualityColors
.The code changes are approved.
40-41
: UpdateState
interface.The
State
interface is updated to includegetQualityColor
andtargetMetric
. This allows the component to dynamically handle quality metrics and colors.The code changes are approved.
103-104
: Updatereducer
function.The
reducer
function is updated to handlegetQualityColor
andtargetMetric
in theSET_QUALITY_SETTINGS
action. This ensures that the state is correctly updated with the new properties.The code changes are approved.
144-145
: InitializegetQualityColor
andtargetMetric
.The component's initial state is updated to set
getQualityColor
with a default threshold and initializestargetMetric
toTargetMetric.ACCURACY
. This ensures that the component starts with default values for these properties.The code changes are approved.
190-190
: Destructure new state properties.The new state properties
getQualityColor
andtargetMetric
are correctly destructured from the state.The code changes are approved.
216-216
: Pass new props toMeanQuality
.The new props
getQualityColor
andtargetMetric
are correctly passed to theMeanQuality
component.The code changes are approved.
239-244
: Pass new props toJobList
.The new props
getQualityColor
andtargetMetric
are correctly passed to theJobList
component.The code changes are approved.
cvat-core/src/server-response-types.ts (1)
244-246
: UpdateSerializedQualitySettingsData
interface.The
SerializedQualitySettingsData
interface is updated to includetarget_metric
,target_metric_threshold
, andmax_validations_per_job
. This allows for more detailed configuration options related to quality settings.The code changes are approved.
cvat-ui/src/components/analytics-page/task-quality/quality-settings-form.tsx (10)
13-13
: Import statement is correct.The import of
Select
fromantd/lib/select
is necessary for the new dropdown menu.The code changes are approved.
15-15
: Import statement is correct.The import of
QualitySettings
andTargetMetric
fromcvat-core-wrapper
is necessary for the new quality settings.The code changes are approved.
26-26
: Addition toinitialValues
is correct.The addition of
targetMetric
toinitialValues
is necessary for the new quality settings.The code changes are approved.
27-27
: Addition toinitialValues
is correct.The addition of
targetMetricThreshold
toinitialValues
is necessary for the new quality settings. Multiplying by 100 ensures the value is in percentage format.The code changes are approved.
29-29
: Addition toinitialValues
is correct.The addition of
maxValidationsPerJob
toinitialValues
is necessary for the new quality settings.The code changes are approved.
50-61
: Tooltip addition is correct.The tooltip provides useful information about the new quality settings, enhancing user experience.
The code changes are approved.
63-72
: Tooltip addition is correct.The tooltip provides useful information about the job validation settings, enhancing user experience.
The code changes are approved.
170-187
: Form item addition is correct.The form item for
targetMetric
is correctly implemented, allowing users to select a target metric from the dropdown menu.The code changes are approved.
192-193
: Form item addition is correct.The form item for
targetMetricThreshold
is correctly implemented, allowing users to set the target metric threshold.The code changes are approved.
200-225
: Form item addition is correct.The form item for
maxValidationsPerJob
is correctly implemented, allowing users to set the maximum validations per job.The code changes are approved.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8347 +/- ##
===========================================
- Coverage 83.59% 83.52% -0.08%
===========================================
Files 393 393
Lines 41640 41707 +67
Branches 3841 3858 +17
===========================================
+ Hits 34810 34836 +26
- Misses 6830 6871 +41
|
Please, add a changelog entry Changed |
cvat-ui/src/components/analytics-page/task-quality/quality-settings-form.tsx
Outdated
Show resolved
Hide resolved
cvat-ui/src/components/analytics-page/task-quality/quality-settings-form.tsx
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
Motivation and context
Added UI support for new settings added in #8321
How has this been tested?
Checklist
develop
branch(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation