amirgame197
commited on
Commit
•
27202f7
1
Parent(s):
80a5737
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import time
|
|
7 |
from PIL import Image
|
8 |
from transparent_background import Remover
|
9 |
|
10 |
-
@spaces.GPU(
|
11 |
def doo(video, mode):
|
12 |
if(mode == 'Normal'):
|
13 |
remover = Remover()
|
@@ -28,11 +28,11 @@ def doo(video, mode):
|
|
28 |
if ret is False:
|
29 |
break
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
37 |
img = Image.fromarray(frame).convert('RGB')
|
38 |
|
|
|
7 |
from PIL import Image
|
8 |
from transparent_background import Remover
|
9 |
|
10 |
+
@spaces.GPU()
|
11 |
def doo(video, mode):
|
12 |
if(mode == 'Normal'):
|
13 |
remover = Remover()
|
|
|
28 |
if ret is False:
|
29 |
break
|
30 |
|
31 |
+
if time.time() - start_time >= 55:
|
32 |
+
print("GPU Timeout is coming")
|
33 |
+
cap.release()
|
34 |
+
writer.release()
|
35 |
+
return 'output.mp4'
|
36 |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
37 |
img = Image.fromarray(frame).convert('RGB')
|
38 |
|