reab5555 commited on
Commit
2934aa1
·
verified ·
1 Parent(s): 343407e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -7,6 +7,7 @@ import numpy as np
7
  import os
8
  import matplotlib.pyplot as plt
9
  from io import BytesIO
 
10
 
11
  # Check if CUDA is available, otherwise use CPU
12
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
@@ -99,7 +100,7 @@ def create_heatmap(frame_scores):
99
  buf.seek(0)
100
  plt.close()
101
 
102
- return buf
103
 
104
  def load_sample_frame(video_path):
105
  cap = cv2.VideoCapture(video_path)
 
7
  import os
8
  import matplotlib.pyplot as plt
9
  from io import BytesIO
10
+ import base64
11
 
12
  # Check if CUDA is available, otherwise use CPU
13
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
 
100
  buf.seek(0)
101
  plt.close()
102
 
103
+ return base64.b64encode(buf.getvalue()).decode('utf-8')
104
 
105
  def load_sample_frame(video_path):
106
  cap = cv2.VideoCapture(video_path)