Skip to content

Commit

Permalink
Honey Pot fixes (#6456)
Browse files Browse the repository at this point in the history
Fixed:

UI:

- opening skeleton point RMB menu leads to UI fail
- annotation conflicts are accumulated when changing frames, if the annotation has multiple conflicts
- improve OKS sigma description

Server:

- average mean iou can be negative
  • Loading branch information
zhiltsov-max authored Jul 12, 2023
1 parent 31b5e25 commit 0c8a46e
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cvat-canvas/src/typescript/canvasView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2183,7 +2183,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
}

private deactivateShape(): void {
if (this.activeElement.clientID !== null) {
if (this.activeElement.clientID) {
const { displayAllText } = this.configuration;
const { clientID } = this.activeElement;
const drawnState = this.drawnStates[clientID];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default function CanvasContextMenu(props: Props): JSX.Element | null {
(annotationConflict: AnnotationConflict) => annotationConflict.clientID === state.clientID,
));

const copyObject = state.isGroundTruth ? state : null;
const copyObject = state?.isGroundTruth ? state : null;

if (workspace === Workspace.REVIEW_WORKSPACE) {
return ReactDOM.createPortal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,22 @@ export default function QualitySettingsModal(): JSX.Element | null {
const keypointTooltip = (
<div className='cvat-analytics-settings-tooltip-inner'>
<Text>
OKS Sigma Like IoU threshold, but for points.
The percent of the bbox area, used as the radius of the circle around the GT point,
Object Keypoint Similarity (OKS) is like IoU, but for skeleton points.
</Text>
<Text>
The Sigma value is the percent of the skeleton bbox area ^ 0.5.
Used as the radius of the circle around a GT point,
where the checked point is expected to be.
</Text>
<Text>
The value is also used to match single point annotations, in which case
the bbox is the whole image. For point groups the bbox is taken
for the whole group.
</Text>
<Text>
If there is a rectangle annotation in the points group or skeleton,
it is used as the group bbox (supposing the whole group describes a single object).
</Text>
</div>
);

Expand Down Expand Up @@ -217,7 +229,7 @@ export default function QualitySettingsModal(): JSX.Element | null {
<Col span={12}>
<Form.Item
name='oksSigma'
label='OKS sigma'
label='OKS sigma (bbox side %)'
rules={[{ required: true }]}
>
<InputNumber min={0} max={100} />
Expand Down
20 changes: 18 additions & 2 deletions cvat-ui/src/reducers/review-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,24 @@ export default function (state: ReviewState = defaultState, action: any): Review
}
});
});
mainConflict.description = descriptionList.join(', ');
mergedFrameConflicts.push(mainConflict);

// decorate the original conflict to avoid changing it
const description = descriptionList.join(', ');
const visibleConflict = new Proxy(mainConflict, {
get(target, prop) {
if (prop === 'description') {
return description;
}

// By default, it looks like Reflect.get(target, prop, receiver)
// which has a different value of `this`. It doesn't allow to
// work with methods / properties that use private members.
const val = Reflect.get(target, prop);
return typeof val === 'function' ? (...args: any[]) => val.apply(target, args) : val;
},
});

mergedFrameConflicts.push(visibleConflict);
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions cvat/apps/quality_control/quality_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,10 @@ def _find_closest_unmatched_shape(shape: dm.Annotation):
_matched_shapes.add(matched_ann_id)
resulting_distances.append(similarity)

resulting_distances = [
sim if sim is not None and (sim >= 0) else 0 for sim in resulting_distances
]

mean_iou = np.mean(resulting_distances) if resulting_distances else 0

if (
Expand Down
4 changes: 2 additions & 2 deletions tests/python/shared/assets/cvat_db/data.json

Large diffs are not rendered by default.

0 comments on commit 0c8a46e

Please sign in to comment.