Spaces:
Build error
Build error
Ubuntu
commited on
Commit
·
d74ebd5
1
Parent(s):
ef9a8d7
- .ipynb_checkpoints/app-checkpoint.py +20 -2
- app.py +20 -2
.ipynb_checkpoints/app-checkpoint.py
CHANGED
|
@@ -1,10 +1,28 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
|
|
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
def video_identity(video):
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
demo = gr.Interface(video_identity,
|
| 9 |
gr.Video(),
|
| 10 |
'text',
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
+
import cv2
|
| 4 |
+
|
| 5 |
|
| 6 |
|
| 7 |
def video_identity(video):
|
| 8 |
+
capture=video
|
| 9 |
+
frameNr = 0
|
| 10 |
+
|
| 11 |
+
while (True):
|
| 12 |
+
|
| 13 |
+
success, frame = capture.read()
|
| 14 |
+
|
| 15 |
+
if success:
|
| 16 |
+
cv2.imwrite(f'train/frame_{frameNr}.jpg', frame)
|
| 17 |
+
|
| 18 |
+
else:
|
| 19 |
+
break
|
| 20 |
+
|
| 21 |
+
frameNr = frameNr+10
|
| 22 |
+
|
| 23 |
+
capture.release()
|
| 24 |
+
|
| 25 |
+
return str(frameNr)
|
| 26 |
demo = gr.Interface(video_identity,
|
| 27 |
gr.Video(),
|
| 28 |
'text',
|
app.py
CHANGED
|
@@ -1,10 +1,28 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
|
|
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
def video_identity(video):
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
demo = gr.Interface(video_identity,
|
| 9 |
gr.Video(),
|
| 10 |
'text',
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
+
import cv2
|
| 4 |
+
|
| 5 |
|
| 6 |
|
| 7 |
def video_identity(video):
|
| 8 |
+
capture=video
|
| 9 |
+
frameNr = 0
|
| 10 |
+
|
| 11 |
+
while (True):
|
| 12 |
+
|
| 13 |
+
success, frame = capture.read()
|
| 14 |
+
|
| 15 |
+
if success:
|
| 16 |
+
cv2.imwrite(f'train/frame_{frameNr}.jpg', frame)
|
| 17 |
+
|
| 18 |
+
else:
|
| 19 |
+
break
|
| 20 |
+
|
| 21 |
+
frameNr = frameNr+10
|
| 22 |
+
|
| 23 |
+
capture.release()
|
| 24 |
+
|
| 25 |
+
return str(frameNr)
|
| 26 |
demo = gr.Interface(video_identity,
|
| 27 |
gr.Video(),
|
| 28 |
'text',
|