Skip to content

Commit 35a7b54

Browse files
authored
AC: fix output selection for attribute recognition adapter (#3020)
1 parent 06c0822 commit 35a7b54

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tools/accuracy_checker/openvino/tools/accuracy_checker/adapters/attributes_recognition.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,13 @@ def validate_config(cls, config, fetch_only=False, **kwargs):
304304

305305
def configure(self):
306306
self.attributes_recognition_out = self.launcher_config.get('attributes_recognition_out', self.output_blob)
307+
self.output_verified = False
307308

308309
def process(self, raw, identifiers=None, frame_meta=None):
309310
result = []
310311
raw_output = self._extract_predictions(raw, frame_meta)
311-
self.select_output_blob(raw_output)
312-
self.attributes_recognition_out = self.attributes_recognition_out or self.output_blob
312+
if not self.output_verified:
313+
self.select_output_blob(raw_output)
313314
for identifier, multi_label in zip(identifiers, raw_output[self.attributes_recognition_out]):
314315
multi_label[multi_label > 0.5] = 1.
315316
multi_label[multi_label <= 0.5] = 0.
@@ -318,6 +319,15 @@ def process(self, raw, identifiers=None, frame_meta=None):
318319

319320
return result
320321

322+
def select_output_blob(self, outputs):
323+
self.output_verified = True
324+
if self.attributes_recognition_out:
325+
self.attributes_recognition_out = self.check_output_name(self.attributes_recognition_out, outputs)
326+
return
327+
super().select_output_blob(outputs)
328+
self.attributes_recognition_out = self.output_blob
329+
return
330+
321331

322332
class GazeEstimationAdapter(Adapter):
323333
__provider__ = 'gaze_estimation'

0 commit comments

Comments
 (0)