amirgame197
commited on
Commit
•
b4f77e9
1
Parent(s):
5be44ed
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ from PIL import Image
|
|
7 |
from transparent_background import Remover
|
8 |
|
9 |
remover = Remover()
|
|
|
10 |
|
11 |
@spaces.GPU
|
12 |
def doo(video):
|
@@ -26,8 +27,9 @@ def doo(video):
|
|
26 |
|
27 |
if writer is None:
|
28 |
writer = cv2.VideoWriter('output.mp4', cv2.VideoWriter_fourcc(*'mp4v'), fps, img.size)
|
29 |
-
|
30 |
-
|
|
|
31 |
out = remover.process(img, type='green')
|
32 |
writer.write(cv2.cvtColor(np.array(out), cv2.COLOR_BGR2RGB))
|
33 |
|
|
|
7 |
from transparent_background import Remover
|
8 |
|
9 |
remover = Remover()
|
10 |
+
processed_frames = 0
|
11 |
|
12 |
@spaces.GPU
|
13 |
def doo(video):
|
|
|
27 |
|
28 |
if writer is None:
|
29 |
writer = cv2.VideoWriter('output.mp4', cv2.VideoWriter_fourcc(*'mp4v'), fps, img.size)
|
30 |
+
|
31 |
+
processed_frames += 1
|
32 |
+
print(f"Processing: {processed_frames}")
|
33 |
out = remover.process(img, type='green')
|
34 |
writer.write(cv2.cvtColor(np.array(out), cv2.COLOR_BGR2RGB))
|
35 |
|