Spaces:
Runtime error
Runtime error
Update visualization.py
Browse files- visualization.py +0 -24
visualization.py
CHANGED
|
@@ -199,27 +199,3 @@ def plot_posture(df, posture_scores, color='blue', anomaly_threshold=3):
|
|
| 199 |
plt.tight_layout()
|
| 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
|
|
|
|
| 199 |
plt.tight_layout()
|
| 200 |
plt.close()
|
| 201 |
return fig
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|