Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit b2b2048

Browse files
authored
fix: LSDV-4988: Fix No Label for Dynamic Labels (#1365)
Switch off labels removal if they are missing in the config. That's destructive action, because this is the case for predictions for example — labels from model can mismatch labels defined in config, but they can be observed and fixed during labeling. This is hidden by LSDV-4988 FF. Co-authored-by: hlomzik <[email protected]>
1 parent 1f3895a commit b2b2048

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/stores/Annotation/Annotation.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
FF_LSDV_3009,
2222
FF_LSDV_4583,
2323
FF_LSDV_4832,
24+
FF_LSDV_4988,
2425
isFF
2526
} from '../../utils/feature-flags';
2627
import { delay, isDefined } from '../../utils/utilities';
@@ -944,7 +945,9 @@ export const Annotation = types
944945
if (key.endsWith('labels')) {
945946
const hasControlTag = tagNames.has(obj.from_name) || tagNames.has('labels');
946947

947-
if (hasControlTag) {
948+
// remove non-existent labels, it actually breaks dynamic labels
949+
// and makes no reason overall — labels from predictions can be out of config
950+
if (!isFF(FF_LSDV_4988) && hasControlTag) {
948951
const labelsContainer = tagNames.get(obj.from_name) ?? tagNames.get('labels');
949952
const value = obj.value[key];
950953

@@ -966,6 +969,9 @@ export const Annotation = types
966969
}
967970
}
968971

972+
// detect most relevant label tags if that one from from_name is missing
973+
// can be useful for predictions in old format with config in new format:
974+
// Rectangle + Labels -> RectangleLabels
969975
if (
970976
!tagNames.has(obj.from_name) ||
971977
(!obj.value[key].length && !tagNames.get(obj.from_name).allowempty)

src/utils/feature-flags.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ export const FF_LSDV_4832 = 'fflag_feat_front_lsdv_4832_new_ranker_tag_120423_sh
240240
*/
241241
export const FF_LSDV_4881 = 'fflag_fix_front_lsdv_4881_timeseries_points_missing_140423_short';
242242

243+
/** Fix "No Label" for Dynamic Labels by switching off missing labels removal */
244+
export const FF_LSDV_4988 = 'fflag_fix_front_lsdv_4988_dynamic_no_label_120523_short';
245+
243246
/**
244247
* Fixing issues related to selection tool functional (selecting hidden regions, onClick in Konva, interaction with regions inside selection area)
245248
*

0 commit comments

Comments
 (0)