Spaces:
Build error
Build error
Ubuntu
commited on
Commit
·
ed609ce
1
Parent(s):
09213d6
- .ipynb_checkpoints/app-checkpoint.py +4 -11
- app.py +4 -11
.ipynb_checkpoints/app-checkpoint.py
CHANGED
|
@@ -4,21 +4,13 @@ import cv2
|
|
| 4 |
from encoded_video import EncodedVideo, write_video
|
| 5 |
import torch
|
| 6 |
import numpy as np
|
| 7 |
-
import gc
|
| 8 |
|
| 9 |
def video_identity(video):
|
| 10 |
|
| 11 |
-
# gc.collect()
|
| 12 |
-
# output_video_path = "./output.mp4"
|
| 13 |
-
capture = cv2.VideoCapture(video)
|
| 14 |
-
# fourcc = cv2.VideoWriter_fourcc(*"I420") # encoder
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
frameNr = 0
|
| 21 |
-
# capture = cv2.VideoCapture('output.mp4')
|
| 22 |
while (True):
|
| 23 |
|
| 24 |
success, frame = capture.read()
|
|
@@ -35,7 +27,8 @@ def video_identity(video):
|
|
| 35 |
|
| 36 |
return img
|
| 37 |
demo = gr.Interface(video_identity,
|
| 38 |
-
gr.Video(source='upload'),
|
| 39 |
-
|
|
|
|
| 40 |
cache_examples=True)
|
| 41 |
demo.launch(debug=True)
|
|
|
|
| 4 |
from encoded_video import EncodedVideo, write_video
|
| 5 |
import torch
|
| 6 |
import numpy as np
|
|
|
|
| 7 |
|
| 8 |
def video_identity(video):
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
capture = cv2.VideoCapture(video, text)
|
|
|
|
|
|
|
| 12 |
|
| 13 |
frameNr = 0
|
|
|
|
| 14 |
while (True):
|
| 15 |
|
| 16 |
success, frame = capture.read()
|
|
|
|
| 27 |
|
| 28 |
return img
|
| 29 |
demo = gr.Interface(video_identity,
|
| 30 |
+
inputs=[gr.Video(source='upload'),
|
| 31 |
+
gr.Text()],
|
| 32 |
+
outputs=gr.Image(),
|
| 33 |
cache_examples=True)
|
| 34 |
demo.launch(debug=True)
|
app.py
CHANGED
|
@@ -4,21 +4,13 @@ import cv2
|
|
| 4 |
from encoded_video import EncodedVideo, write_video
|
| 5 |
import torch
|
| 6 |
import numpy as np
|
| 7 |
-
import gc
|
| 8 |
|
| 9 |
def video_identity(video):
|
| 10 |
|
| 11 |
-
# gc.collect()
|
| 12 |
-
# output_video_path = "./output.mp4"
|
| 13 |
-
capture = cv2.VideoCapture(video)
|
| 14 |
-
# fourcc = cv2.VideoWriter_fourcc(*"I420") # encoder
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
frameNr = 0
|
| 21 |
-
# capture = cv2.VideoCapture('output.mp4')
|
| 22 |
while (True):
|
| 23 |
|
| 24 |
success, frame = capture.read()
|
|
@@ -35,7 +27,8 @@ def video_identity(video):
|
|
| 35 |
|
| 36 |
return img
|
| 37 |
demo = gr.Interface(video_identity,
|
| 38 |
-
gr.Video(source='upload'),
|
| 39 |
-
|
|
|
|
| 40 |
cache_examples=True)
|
| 41 |
demo.launch(debug=True)
|
|
|
|
| 4 |
from encoded_video import EncodedVideo, write_video
|
| 5 |
import torch
|
| 6 |
import numpy as np
|
|
|
|
| 7 |
|
| 8 |
def video_identity(video):
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
capture = cv2.VideoCapture(video, text)
|
|
|
|
|
|
|
| 12 |
|
| 13 |
frameNr = 0
|
|
|
|
| 14 |
while (True):
|
| 15 |
|
| 16 |
success, frame = capture.read()
|
|
|
|
| 27 |
|
| 28 |
return img
|
| 29 |
demo = gr.Interface(video_identity,
|
| 30 |
+
inputs=[gr.Video(source='upload'),
|
| 31 |
+
gr.Text()],
|
| 32 |
+
outputs=gr.Image(),
|
| 33 |
cache_examples=True)
|
| 34 |
demo.launch(debug=True)
|