reab5555 commited on
Commit
7f3ac2a
·
verified ·
1 Parent(s): 3f4f730

Update visualization.py

Browse files
Files changed (1) hide show
  1. visualization.py +14 -12
visualization.py CHANGED
@@ -200,22 +200,24 @@ def plot_posture(df, posture_scores, color='blue', anomaly_threshold=3):
200
  plt.close()
201
  return fig
202
 
203
- def create_kdeplot(df, mse_embeddings, mse_posture):
204
  plt.figure(figsize=(10, 6), dpi=300)
205
- df['MSE_Embeddings'] = mse_embeddings
206
- df['MSE_Posture'] = mse_posture
207
- sns.kdeplot(data=df, x='MSE_Embeddings', y='MSE_Posture', cmap="YlOrRd", shade=True, cbar=True)
208
- plt.xlabel('Facial Features MSE')
209
- plt.ylabel('Body Posture MSE')
210
- plt.title('KDE Plot of Facial Features vs Body Posture MSE')
211
  plt.close()
212
  return plt.gcf()
213
 
214
- def create_jointplot(df, mse_embeddings, mse_posture):
215
  plt.figure(figsize=(10, 6), dpi=300)
216
- df['MSE_Embeddings'] = mse_embeddings
217
- df['MSE_Posture'] = mse_posture
218
- joint_plot = sns.jointplot(data=df, x='MSE_Embeddings', y='MSE_Posture', kind='hex', cmap="YlOrRd")
219
- joint_plot.fig.suptitle('Joint Plot of Facial Features vs Body Posture MSE', y=1.02)
 
 
220
  plt.close()
221
  return joint_plot.fig
 
200
  plt.close()
201
  return fig
202
 
203
+ def create_kdeplot(df):
204
  plt.figure(figsize=(10, 6), dpi=300)
205
+ scatter = plt.scatter(df['Timecode_Seconds'], df['Timecode_Seconds'],
206
+ c=df['MSE_Combined'], cmap='YlOrRd', alpha=0.5)
207
+ plt.colorbar(scatter, label='Combined MSE')
208
+ plt.xlabel('Facial Features Timecode')
209
+ plt.ylabel('Body Posture Timecode')
210
+ plt.title('Scatter Plot of Facial Features vs Body Posture Timecodes (Color: Combined MSE)')
211
  plt.close()
212
  return plt.gcf()
213
 
214
+ def create_jointplot(df):
215
  plt.figure(figsize=(10, 6), dpi=300)
216
+ joint_plot = sns.jointplot(data=df, x='Timecode_Seconds', y='Timecode_Seconds',
217
+ kind='scatter', hue='MSE_Combined', palette='YlOrRd',
218
+ joint_kws={'alpha': 0.5})
219
+ joint_plot.fig.suptitle('Joint Plot of Facial Features vs Body Posture Timecodes (Color: Combined MSE)', y=1.02)
220
+ plt.xlabel('Facial Features Timecode')
221
+ plt.ylabel('Body Posture Timecode')
222
  plt.close()
223
  return joint_plot.fig