chiyoi commited on
Commit
dd478fa
1 Parent(s): 21f4a04
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -41,9 +41,10 @@ def fn(video: gr.Video):
41
  processed_frames.append(frame)
42
  if i % config.yield_frame_steps == 0:
43
  with tempfile.NamedTemporaryFile(suffix='.jpeg') as f:
44
- quality = 1
45
- _, img_encoded = cv2.imencode('.jpg', frame, [int(cv2.IMWRITE_JPEG_QUALITY), quality])
46
- f.write(img_encoded)
 
47
  yield f.name, None
48
  processed_clip = ImageSequenceClip(processed_frames, clip.fps)
49
  processed_clip.audio = clip.audio
 
41
  processed_frames.append(frame)
42
  if i % config.yield_frame_steps == 0:
43
  with tempfile.NamedTemporaryFile(suffix='.jpeg') as f:
44
+ quality = 9
45
+ image_array = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)
46
+ _, image_encoded = cv2.imencode('.jpg', image_array, [int(cv2.IMWRITE_JPEG_QUALITY), quality])
47
+ f.write(image_encoded)
48
  yield f.name, None
49
  processed_clip = ImageSequenceClip(processed_frames, clip.fps)
50
  processed_clip.audio = clip.audio