reab5555 commited on
Commit
6321191
·
verified ·
1 Parent(s): fe34b28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1,5 +1,5 @@
 
1
  import gradio as gr
2
- from gradio import spaces
3
  import cv2
4
  from PIL import Image, ImageDraw, ImageFont
5
  import torch
@@ -46,7 +46,7 @@ def process_video(video_path, target, progress=gr.Progress()):
46
  temp_dir = tempfile.mkdtemp()
47
  frame_paths = []
48
 
49
- batch_size = 4 # Process 4 frames at a time
50
  batch_frames = []
51
  batch_indices = []
52
 
@@ -57,8 +57,7 @@ def process_video(video_path, target, progress=gr.Progress()):
57
  if not ret:
58
  break
59
 
60
- # Resize the frame
61
- #img_resized = cv2.resize(img, (640, 360))
62
  pil_img = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
63
 
64
  batch_frames.append(pil_img)
 
1
+ import spaces
2
  import gradio as gr
 
3
  import cv2
4
  from PIL import Image, ImageDraw, ImageFont
5
  import torch
 
46
  temp_dir = tempfile.mkdtemp()
47
  frame_paths = []
48
 
49
+ batch_size = 2 # Process 2 frames at a time
50
  batch_frames = []
51
  batch_indices = []
52
 
 
57
  if not ret:
58
  break
59
 
60
+ # Convert to RGB without resizing
 
61
  pil_img = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
62
 
63
  batch_frames.append(pil_img)