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 annotation accuracy display in the UI #7652

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog.d/20240321_153828_roman_fix_accuracy_display.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Fixed accuracy being displayed incorrectly on the task analytics page
(<https://github.com/opencv/cvat/pull/7652>)
3 changes: 1 addition & 2 deletions cvat-core/src/quality-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ export default class QualityReport {
validCount: this.#summary.valid_count,
dsCount: this.#summary.ds_count,
gtCount: this.#summary.gt_count,
accuracy: (this.#summary.valid_count /
(this.#summary.ds_count + this.#summary.gt_count - this.#summary.valid_count)) * 100,
accuracy: (this.#summary.valid_count / this.#summary.total_count) * 100,
precision: (this.#summary.valid_count / this.#summary.gt_count) * 100,
recall: (this.#summary.valid_count / this.#summary.ds_count) * 100,
conflictsByType: {
Expand Down
1 change: 1 addition & 0 deletions cvat-core/src/server-response-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ export interface SerializedQualityReportData {
valid_count: number;
ds_count: number;
gt_count: number;
total_count: number;
error_count: number;
warning_count: number;
conflicts_by_type: {
Expand Down
1 change: 1 addition & 0 deletions cvat/apps/quality_control/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class QualityReportSummarySerializer(serializers.Serializer):
valid_count = serializers.IntegerField(source="annotations.valid_count")
ds_count = serializers.IntegerField(source="annotations.ds_count")
gt_count = serializers.IntegerField(source="annotations.gt_count")
total_count = serializers.IntegerField(source="annotations.total_count")


class QualityReportSerializer(serializers.ModelSerializer):
Expand Down
3 changes: 3 additions & 0 deletions cvat/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9140,6 +9140,8 @@ components:
type: integer
gt_count:
type: integer
total_count:
type: integer
required:
- conflict_count
- conflicts_by_type
Expand All @@ -9148,6 +9150,7 @@ components:
- frame_count
- frame_share
- gt_count
- total_count
- valid_count
- warning_count
QualityReportTarget:
Expand Down
6 changes: 6 additions & 0 deletions tests/python/shared/assets/quality_reports.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"frame_count": 3,
"frame_share": 0.2727272727272727,
"gt_count": 33,
"total_count": 43,
"valid_count": 21,
"warning_count": 15
},
Expand Down Expand Up @@ -56,6 +57,7 @@
"frame_count": 3,
"frame_share": 0.2727272727272727,
"gt_count": 33,
"total_count": 43,
"valid_count": 21,
"warning_count": 15
},
Expand Down Expand Up @@ -86,6 +88,7 @@
"frame_count": 3,
"frame_share": 0.2727272727272727,
"gt_count": 35,
"total_count": 46,
"valid_count": 22,
"warning_count": 16
},
Expand Down Expand Up @@ -116,6 +119,7 @@
"frame_count": 3,
"frame_share": 0.2727272727272727,
"gt_count": 35,
"total_count": 46,
"valid_count": 22,
"warning_count": 16
},
Expand Down Expand Up @@ -146,6 +150,7 @@
"frame_count": 3,
"frame_share": 0.2727272727272727,
"gt_count": 35,
"total_count": 46,
"valid_count": 22,
"warning_count": 16
},
Expand Down Expand Up @@ -176,6 +181,7 @@
"frame_count": 3,
"frame_share": 0.2727272727272727,
"gt_count": 35,
"total_count": 46,
"valid_count": 22,
"warning_count": 16
},
Expand Down
Loading