eusholli commited on
Commit
35224be
1 Parent(s): 2bf9045

convert uploaded movie frames to be RGB format

Browse files
Files changed (2) hide show
  1. .gitignore +3 -0
  2. 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
- # Display the current frame as the input frame
352
- input_placeholder.image(frame)
353
- analyze_frame(
354
- frame
355
- ) # Analyze the frame for face detection and sentiment analysis
 
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