Skip to content

Commit

Permalink
Added race label into analysis2displaydf function
Browse files Browse the repository at this point in the history
  • Loading branch information
gretaia committed Dec 27, 2024
1 parent 2d6321e commit 25f9a9e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inaFaceAnalyzer/display_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 25f9a9e

Please sign in to comment.