Spaces:
Runtime error
Runtime error
Update visualization.py
Browse files- visualization.py +3 -3
visualization.py
CHANGED
|
@@ -72,8 +72,8 @@ def plot_mse(df, mse_values, title, color='navy', time_threshold=3, anomaly_thre
|
|
| 72 |
ax.axhline(y=median, color='black', linestyle='--', label='Median Baseline')
|
| 73 |
|
| 74 |
threshold = np.mean(mse_values) + anomaly_threshold * np.std(mse_values)
|
| 75 |
-
ax.axhline(y=threshold, color='red', linestyle='--', label=f'Threshold
|
| 76 |
-
ax.text(ax.get_xlim()[1], threshold, f'Threshold
|
| 77 |
|
| 78 |
anomalies = determine_anomalies(mse_values, anomaly_threshold)
|
| 79 |
anomaly_frames = df['Frame'].iloc[anomalies].tolist()
|
|
@@ -214,7 +214,7 @@ def plot_mse_histogram(mse_values, title, anomaly_threshold, color='blue'):
|
|
| 214 |
|
| 215 |
ax.hist(mse_values, bins=100, edgecolor='black', color=color, alpha=0.7)
|
| 216 |
ax.set_xlabel('Mean Squared Error')
|
| 217 |
-
ax.set_ylabel('
|
| 218 |
ax.set_title(title)
|
| 219 |
|
| 220 |
mean = np.mean(mse_values)
|
|
|
|
| 72 |
ax.axhline(y=median, color='black', linestyle='--', label='Median Baseline')
|
| 73 |
|
| 74 |
threshold = np.mean(mse_values) + anomaly_threshold * np.std(mse_values)
|
| 75 |
+
ax.axhline(y=threshold, color='red', linestyle='--', label=f'Anomaly Threshold')
|
| 76 |
+
ax.text(ax.get_xlim()[1], threshold, f'Anomaly Threshold', verticalalignment='center', horizontalalignment='left', color='red')
|
| 77 |
|
| 78 |
anomalies = determine_anomalies(mse_values, anomaly_threshold)
|
| 79 |
anomaly_frames = df['Frame'].iloc[anomalies].tolist()
|
|
|
|
| 214 |
|
| 215 |
ax.hist(mse_values, bins=100, edgecolor='black', color=color, alpha=0.7)
|
| 216 |
ax.set_xlabel('Mean Squared Error')
|
| 217 |
+
ax.set_ylabel('Number of Frames')
|
| 218 |
ax.set_title(title)
|
| 219 |
|
| 220 |
mean = np.mean(mse_values)
|