Skip to content

Instantly share code, notes, and snippets.

@jcheong0428
Last active January 25, 2020 03:48
Show Gist options
  • Select an option

  • Save jcheong0428/753f9ef370e1932cd5eb3e8141cb7785 to your computer and use it in GitHub Desktop.

Select an option

Save jcheong0428/753f9ef370e1932cd5eb3e8141cb7785 to your computer and use it in GitHub Desktop.
# Threshold data by 80%
df_clean = df[df.confidence>=.80]
# Plot all Action Unit time series.
au_regex_pat = re.compile(r'^AU[0-9]+_r$')
au_columns = df.columns[df.columns.str.contains(au_regex_pat)]
print("List of AU columns:", au_columns)
f,axes = plt.subplots(6, 3, figsize=(10,12), sharex=True, sharey=True)
axes = axes.flatten()
for au_ix, au_col in enumerate(au_columns):
sns.lineplot(x='frame', y=au_col, hue='face_id', data=df_clean, ax=axes[au_ix])
axes[au_ix].set(title=au_col, ylabel='Intensity')
axes[au_ix].legend(loc=5)
plt.suptitle("AU intensity predictions by time for each face", y=1.02)
plt.tight_layout()
# Let's compare how much AU12 (smiling) activity occurs at similar times across people.
df_clean.pivot(index='frame', columns='face_id', values='AU12_r').corr()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment