From 25f9a9eea19f1a7be961d2d8d385ffb61a95f2b8 Mon Sep 17 00:00:00 2001 From: Greta Iapalucci Date: Fri, 27 Dec 2024 15:41:30 +0100 Subject: [PATCH] Added race label into analysis2displaydf function --- inaFaceAnalyzer/display_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inaFaceAnalyzer/display_utils.py b/inaFaceAnalyzer/display_utils.py index 8b93bd6..6628c7a 100644 --- a/inaFaceAnalyzer/display_utils.py +++ b/inaFaceAnalyzer/display_utils.py @@ -98,6 +98,9 @@ def _analysis2displaydf(df, fps, subsamp_coeff, text_pat = None, cols=None): if 'age_label' in df.columns: text_pat += '- age: %.1f' cols += ['age_label'] + if 'race_label' in df.columns: + text_pat += ' - race: %s' + cols += ['race_label'] ret['bgr_color'] = ret.rgb_color.map(lambda x: x[4:] + x[2:4] + x[:2]) ret['text'] = df.apply(lambda x: text_pat % tuple([x[e] for e in cols]), axis=1)