diff --git a/changelog.d/20240321_153828_roman_fix_accuracy_display.md b/changelog.d/20240321_153828_roman_fix_accuracy_display.md new file mode 100644 index 000000000000..20af3129b77a --- /dev/null +++ b/changelog.d/20240321_153828_roman_fix_accuracy_display.md @@ -0,0 +1,4 @@ +### Fixed + +- Fixed accuracy being displayed incorrectly on the task analytics page + () diff --git a/cvat-core/src/quality-report.ts b/cvat-core/src/quality-report.ts index 652241527e86..13cbb1e5c7cf 100644 --- a/cvat-core/src/quality-report.ts +++ b/cvat-core/src/quality-report.ts @@ -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: { diff --git a/cvat-core/src/server-response-types.ts b/cvat-core/src/server-response-types.ts index 5a0f070fb11b..1894b17078f5 100644 --- a/cvat-core/src/server-response-types.ts +++ b/cvat-core/src/server-response-types.ts @@ -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: { diff --git a/cvat/apps/quality_control/serializers.py b/cvat/apps/quality_control/serializers.py index 711799dcef61..60c22f107437 100644 --- a/cvat/apps/quality_control/serializers.py +++ b/cvat/apps/quality_control/serializers.py @@ -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): diff --git a/cvat/schema.yml b/cvat/schema.yml index e97fd8ff869e..b66048b72892 100644 --- a/cvat/schema.yml +++ b/cvat/schema.yml @@ -9140,6 +9140,8 @@ components: type: integer gt_count: type: integer + total_count: + type: integer required: - conflict_count - conflicts_by_type @@ -9148,6 +9150,7 @@ components: - frame_count - frame_share - gt_count + - total_count - valid_count - warning_count QualityReportTarget: diff --git a/tests/python/shared/assets/quality_reports.json b/tests/python/shared/assets/quality_reports.json index ea9d806233af..2a5c84d72f57 100644 --- a/tests/python/shared/assets/quality_reports.json +++ b/tests/python/shared/assets/quality_reports.json @@ -26,6 +26,7 @@ "frame_count": 3, "frame_share": 0.2727272727272727, "gt_count": 33, + "total_count": 43, "valid_count": 21, "warning_count": 15 }, @@ -56,6 +57,7 @@ "frame_count": 3, "frame_share": 0.2727272727272727, "gt_count": 33, + "total_count": 43, "valid_count": 21, "warning_count": 15 }, @@ -86,6 +88,7 @@ "frame_count": 3, "frame_share": 0.2727272727272727, "gt_count": 35, + "total_count": 46, "valid_count": 22, "warning_count": 16 }, @@ -116,6 +119,7 @@ "frame_count": 3, "frame_share": 0.2727272727272727, "gt_count": 35, + "total_count": 46, "valid_count": 22, "warning_count": 16 }, @@ -146,6 +150,7 @@ "frame_count": 3, "frame_share": 0.2727272727272727, "gt_count": 35, + "total_count": 46, "valid_count": 22, "warning_count": 16 }, @@ -176,6 +181,7 @@ "frame_count": 3, "frame_share": 0.2727272727272727, "gt_count": 35, + "total_count": 46, "valid_count": 22, "warning_count": 16 },