reab5555 commited on
Commit
79a3688
·
verified ·
1 Parent(s): 6ec4314

Update visualization.py

Browse files
Files changed (1) hide show
  1. visualization.py +8 -6
visualization.py CHANGED
@@ -200,24 +200,26 @@ def plot_posture(df, posture_scores, color='blue', anomaly_threshold=3):
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
 
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_Combined'] = (mse_embeddings + mse_posture) / 2
206
  scatter = plt.scatter(df['Timecode_Seconds'], df['Timecode_Seconds'],
207
  c=df['MSE_Combined'], cmap='YlOrRd', alpha=0.5)
208
  plt.colorbar(scatter, label='Combined MSE')
209
+ plt.xlabel('Facial Features Timecode (seconds)')
210
+ plt.ylabel('Body Posture Timecode (seconds)')
211
  plt.title('Scatter Plot of Facial Features vs Body Posture Timecodes (Color: Combined MSE)')
212
  plt.close()
213
  return plt.gcf()
214
 
215
+ def create_jointplot(df, mse_embeddings, mse_posture):
216
  plt.figure(figsize=(10, 6), dpi=300)
217
+ df['MSE_Combined'] = (mse_embeddings + mse_posture) / 2
218
  joint_plot = sns.jointplot(data=df, x='Timecode_Seconds', y='Timecode_Seconds',
219
  kind='scatter', hue='MSE_Combined', palette='YlOrRd',
220
  joint_kws={'alpha': 0.5})
221
  joint_plot.fig.suptitle('Joint Plot of Facial Features vs Body Posture Timecodes (Color: Combined MSE)', y=1.02)
222
+ plt.xlabel('Facial Features Timecode (seconds)')
223
+ plt.ylabel('Body Posture Timecode (seconds)')
224
  plt.close()
225
  return joint_plot.fig