convert uploaded movie frames to be RGB format
Browse files- .gitignore +3 -0
- app.py +6 -5
.gitignore
CHANGED
@@ -120,3 +120,6 @@ dmypy.json
|
|
120 |
# Keep empty models dir
|
121 |
models/*
|
122 |
!models/.gitkeep
|
|
|
|
|
|
|
|
120 |
# Keep empty models dir
|
121 |
models/*
|
122 |
!models/.gitkeep
|
123 |
+
|
124 |
+
# All cached movie files
|
125 |
+
*.mp4
|
app.py
CHANGED
@@ -348,11 +348,12 @@ def process_video(video_path):
|
|
348 |
if not ret:
|
349 |
break # Exit the loop if no more frames are available
|
350 |
|
351 |
-
#
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
)
|
|
|
356 |
publish_frame() # Publish the results
|
357 |
|
358 |
cap.release() # Release the video capture object
|
|
|
348 |
if not ret:
|
349 |
break # Exit the loop if no more frames are available
|
350 |
|
351 |
+
# Convert the frame from BGR to RGB format
|
352 |
+
rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
353 |
+
|
354 |
+
# Analyze the frame for face detection and sentiment analysis
|
355 |
+
analyze_frame(rgb_frame)
|
356 |
+
|
357 |
publish_frame() # Publish the results
|
358 |
|
359 |
cap.release() # Release the video capture object
|