-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added support for consensus task and consensus job merging (API and UI) - Added simple consensus settings - Added server tests - Added new `consensus` RQ queue and worker - Updated skeleton comparisons: hidden points now also contribute to the skeleton similarity. Only visibility is taken into account for invisible points Limitations: - Merging is supported for all annotations except 2d and 3d cuboids. 3d tasks are not supported - Annotation groups are not supported (each annotation is considered separate in a group) - Polygons and masks are not interchangeable (each type is compared only with the same type) Co-authored-by: Kirill Lakhov <[email protected]>
- Loading branch information
1 parent
c25bf96
commit 4d06ae1
Showing
81 changed files
with
10,137 additions
and
1,014 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
changelog.d/20250213_182204_mzhiltso_consensus_simple_merging.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
### Added | ||
|
||
- Simple merging for consensus-enabled tasks | ||
(<https://github.com/cvat-ai/cvat/pull/8953>) | ||
|
||
### Changed | ||
|
||
- Hidden points in skeletons now also contribute to the skeleton similarity | ||
in quality computations and in consensus merging | ||
(<https://github.com/cvat-ai/cvat/pull/8953>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// Copyright (C) 2024 CVAT.ai Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
import { SerializedConsensusSettingsData } from './server-response-types'; | ||
import PluginRegistry from './plugins'; | ||
import serverProxy from './server-proxy'; | ||
import { convertDescriptions, getServerAPISchema } from './server-schema'; | ||
|
||
export default class ConsensusSettings { | ||
#id: number; | ||
#task: number; | ||
#iouThreshold: number; | ||
#quorum: number; | ||
#descriptions: Record<string, string>; | ||
|
||
constructor(initialData: SerializedConsensusSettingsData) { | ||
this.#id = initialData.id; | ||
this.#task = initialData.task; | ||
this.#iouThreshold = initialData.iou_threshold; | ||
this.#quorum = initialData.quorum; | ||
this.#descriptions = initialData.descriptions; | ||
} | ||
|
||
get id(): number { | ||
return this.#id; | ||
} | ||
|
||
get task(): number { | ||
return this.#task; | ||
} | ||
|
||
get iouThreshold(): number { | ||
return this.#iouThreshold; | ||
} | ||
|
||
set iouThreshold(newVal: number) { | ||
this.#iouThreshold = newVal; | ||
} | ||
|
||
get quorum(): number { | ||
return this.#quorum; | ||
} | ||
|
||
set quorum(newVal: number) { | ||
this.#quorum = newVal; | ||
} | ||
|
||
get descriptions(): Record<string, string> { | ||
const descriptions: Record<string, string> = Object.keys(this.#descriptions).reduce((acc, key) => { | ||
const camelCaseKey = _.camelCase(key); | ||
acc[camelCaseKey] = this.#descriptions[key]; | ||
return acc; | ||
}, {}); | ||
|
||
return descriptions; | ||
} | ||
|
||
public toJSON(): SerializedConsensusSettingsData { | ||
const result: SerializedConsensusSettingsData = { | ||
iou_threshold: this.#iouThreshold, | ||
quorum: this.#quorum, | ||
}; | ||
|
||
return result; | ||
} | ||
|
||
public async save(): Promise<ConsensusSettings> { | ||
const result = await PluginRegistry.apiWrapper.call(this, ConsensusSettings.prototype.save); | ||
return result; | ||
} | ||
} | ||
|
||
Object.defineProperties(ConsensusSettings.prototype.save, { | ||
implementation: { | ||
writable: false, | ||
enumerable: false, | ||
value: async function implementation(): Promise<ConsensusSettings> { | ||
const result = await serverProxy.consensus.settings.update( | ||
this.id, this.toJSON(), | ||
); | ||
const schema = await getServerAPISchema(); | ||
const descriptions = convertDescriptions(schema.components.schemas.ConsensusSettings.properties); | ||
return new ConsensusSettings({ ...result, descriptions }); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.