Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,7 +87,6 @@ def doo(video, color, mode, out_format, progress=gr.Progress()):
|
|
| 87 |
try:
|
| 88 |
frame_idx = 0
|
| 89 |
while cap.isOpened():
|
| 90 |
-
print(f"Processing frame {processed_frames} begin")
|
| 91 |
ret, frame = cap.read()
|
| 92 |
|
| 93 |
if ret is False:
|
|
@@ -105,16 +104,16 @@ def doo(video, color, mode, out_format, progress=gr.Progress()):
|
|
| 105 |
|
| 106 |
processed_frames += 1
|
| 107 |
frame_idx += 1
|
| 108 |
-
print(f"Processing frame {processed_frames}
|
| 109 |
progress(processed_frames / total_frames, desc=f"Processing frame {processed_frames}/{total_frames}")
|
| 110 |
|
| 111 |
out = remover.process(img, type='rgba')
|
|
|
|
| 112 |
out = out.convert('RGBA')
|
| 113 |
-
print(
|
| 114 |
|
| 115 |
frame_name = os.path.join(temp_dir, f"frame_{frame_idx:06d}.png")
|
| 116 |
out.save(frame_name, 'PNG')
|
| 117 |
-
print(f"Processing frame {processed_frames} done")
|
| 118 |
|
| 119 |
cap.release()
|
| 120 |
|
|
|
|
| 87 |
try:
|
| 88 |
frame_idx = 0
|
| 89 |
while cap.isOpened():
|
|
|
|
| 90 |
ret, frame = cap.read()
|
| 91 |
|
| 92 |
if ret is False:
|
|
|
|
| 104 |
|
| 105 |
processed_frames += 1
|
| 106 |
frame_idx += 1
|
| 107 |
+
print(f"Processing frame {processed_frames}")
|
| 108 |
progress(processed_frames / total_frames, desc=f"Processing frame {processed_frames}/{total_frames}")
|
| 109 |
|
| 110 |
out = remover.process(img, type='rgba')
|
| 111 |
+
print("1")
|
| 112 |
out = out.convert('RGBA')
|
| 113 |
+
print("2")
|
| 114 |
|
| 115 |
frame_name = os.path.join(temp_dir, f"frame_{frame_idx:06d}.png")
|
| 116 |
out.save(frame_name, 'PNG')
|
|
|
|
| 117 |
|
| 118 |
cap.release()
|
| 119 |
|