reab5555 commited on
Commit
8a8267b
·
verified ·
1 Parent(s): 8ef02fb

Update visualization.py

Browse files
Files changed (1) hide show
  1. visualization.py +1 -8
visualization.py CHANGED
@@ -203,13 +203,6 @@ def plot_posture(df, posture_scores, color='blue', anomaly_threshold=3):
203
  plt.close()
204
  return fig
205
 
206
-
207
- import matplotlib.pyplot as plt
208
- from matplotlib.backends.backend_agg import FigureCanvasAgg
209
- import matplotlib.colors as mcolors
210
- import numpy as np
211
- import cv2
212
-
213
  def create_video_with_heatmap(video_path, df, mse_embeddings, mse_posture, output_path, desired_fps):
214
  cap = cv2.VideoCapture(video_path)
215
  original_fps = cap.get(cv2.CAP_PROP_FPS)
@@ -242,7 +235,7 @@ def create_video_with_heatmap(video_path, df, mse_embeddings, mse_posture, outpu
242
  fig, ax = plt.subplots(figsize=(width/100, 2))
243
  im = ax.imshow(combined_mse, aspect='auto', extent=[0, total_frames, 0, 2])
244
  ax.set_yticks([0.5, 1.5])
245
- ax.set_yticklabels(['Facial', 'Posture'])
246
  ax.set_xticks([])
247
  plt.tight_layout()
248
 
 
203
  plt.close()
204
  return fig
205
 
 
 
 
 
 
 
 
206
  def create_video_with_heatmap(video_path, df, mse_embeddings, mse_posture, output_path, desired_fps):
207
  cap = cv2.VideoCapture(video_path)
208
  original_fps = cap.get(cv2.CAP_PROP_FPS)
 
235
  fig, ax = plt.subplots(figsize=(width/100, 2))
236
  im = ax.imshow(combined_mse, aspect='auto', extent=[0, total_frames, 0, 2])
237
  ax.set_yticks([0.5, 1.5])
238
+ ax.set_yticklabels(['Face', 'Posture'])
239
  ax.set_xticks([])
240
  plt.tight_layout()
241