Spaces:
Runtime error
Runtime error
Update visualization.py
Browse files- visualization.py +4 -4
visualization.py
CHANGED
|
@@ -7,7 +7,7 @@ from utils import seconds_to_timecode
|
|
| 7 |
from anomaly_detection import determine_anomalies
|
| 8 |
|
| 9 |
def plot_mse(df, mse_values, title, color='navy', time_threshold=3, anomaly_threshold=4):
|
| 10 |
-
plt.figure(figsize=(16, 8), dpi=
|
| 11 |
fig, ax = plt.subplots(figsize=(16, 8))
|
| 12 |
|
| 13 |
if 'Seconds' not in df.columns:
|
|
@@ -117,7 +117,7 @@ def plot_mse(df, mse_values, title, color='navy', time_threshold=3, anomaly_thre
|
|
| 117 |
return fig, anomaly_frames
|
| 118 |
|
| 119 |
def plot_mse_histogram(mse_values, title, anomaly_threshold, color='blue'):
|
| 120 |
-
plt.figure(figsize=(16, 3), dpi=
|
| 121 |
fig, ax = plt.subplots(figsize=(16, 3))
|
| 122 |
|
| 123 |
ax.hist(mse_values, bins=100, edgecolor='black', color=color, alpha=0.7)
|
|
@@ -136,7 +136,7 @@ def plot_mse_histogram(mse_values, title, anomaly_threshold, color='blue'):
|
|
| 136 |
return fig
|
| 137 |
|
| 138 |
def plot_mse_heatmap(mse_values, title, df):
|
| 139 |
-
plt.figure(figsize=(20, 3), dpi=
|
| 140 |
fig, ax = plt.subplots(figsize=(20, 3))
|
| 141 |
|
| 142 |
# Reshape MSE values to 2D array for heatmap
|
|
@@ -163,7 +163,7 @@ def plot_mse_heatmap(mse_values, title, df):
|
|
| 163 |
return fig
|
| 164 |
|
| 165 |
def plot_posture(df, posture_scores, color='blue', anomaly_threshold=3):
|
| 166 |
-
plt.figure(figsize=(16, 8), dpi=
|
| 167 |
fig, ax = plt.subplots(figsize=(16, 8))
|
| 168 |
|
| 169 |
df['Seconds'] = df['Timecode'].apply(
|
|
|
|
| 7 |
from anomaly_detection import determine_anomalies
|
| 8 |
|
| 9 |
def plot_mse(df, mse_values, title, color='navy', time_threshold=3, anomaly_threshold=4):
|
| 10 |
+
plt.figure(figsize=(16, 8), dpi=300)
|
| 11 |
fig, ax = plt.subplots(figsize=(16, 8))
|
| 12 |
|
| 13 |
if 'Seconds' not in df.columns:
|
|
|
|
| 117 |
return fig, anomaly_frames
|
| 118 |
|
| 119 |
def plot_mse_histogram(mse_values, title, anomaly_threshold, color='blue'):
|
| 120 |
+
plt.figure(figsize=(16, 3), dpi=300)
|
| 121 |
fig, ax = plt.subplots(figsize=(16, 3))
|
| 122 |
|
| 123 |
ax.hist(mse_values, bins=100, edgecolor='black', color=color, alpha=0.7)
|
|
|
|
| 136 |
return fig
|
| 137 |
|
| 138 |
def plot_mse_heatmap(mse_values, title, df):
|
| 139 |
+
plt.figure(figsize=(20, 3), dpi=300)
|
| 140 |
fig, ax = plt.subplots(figsize=(20, 3))
|
| 141 |
|
| 142 |
# Reshape MSE values to 2D array for heatmap
|
|
|
|
| 163 |
return fig
|
| 164 |
|
| 165 |
def plot_posture(df, posture_scores, color='blue', anomaly_threshold=3):
|
| 166 |
+
plt.figure(figsize=(16, 8), dpi=300)
|
| 167 |
fig, ax = plt.subplots(figsize=(16, 8))
|
| 168 |
|
| 169 |
df['Seconds'] = df['Timecode'].apply(
|