Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -84,9 +84,15 @@ def build_table(title, rows):
|
|
| 84 |
return html
|
| 85 |
|
| 86 |
# Analyzing video for health metrics
|
| 87 |
-
def analyze_video(
|
| 88 |
-
|
| 89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
brightness_vals = []
|
| 91 |
green_vals = []
|
| 92 |
frame_sample = None
|
|
|
|
| 84 |
return html
|
| 85 |
|
| 86 |
# Analyzing video for health metrics
|
| 87 |
+
def analyze_video(video):
|
| 88 |
+
# If video is passed as a path, open it using OpenCV
|
| 89 |
+
if isinstance(video, str):
|
| 90 |
+
cap = cv2.VideoCapture(video)
|
| 91 |
+
else:
|
| 92 |
+
# If video is passed as a numpy array, treat it as an in-memory video
|
| 93 |
+
cap = cv2.VideoCapture()
|
| 94 |
+
cap.open(video)
|
| 95 |
+
|
| 96 |
brightness_vals = []
|
| 97 |
green_vals = []
|
| 98 |
frame_sample = None
|