Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,25 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
2 |
|
3 |
-
def greet(name,yarrak,temperature):
|
4 |
-
salutation="Günaydın" if yarrak else "Iyi Geceler"
|
5 |
-
fah=(9/5)*temperature + 32
|
6 |
-
greeting="{} yarrak {}. Bugün hava {} derece".format(salutation, name, temperature)
|
7 |
-
return greeting, round(fah,2)
|
8 |
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
15 |
|
|
|
|
|
|
|
|
|
|
|
16 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import cv2
|
3 |
+
def video_input(video):
|
4 |
+
video = cv2.VideoCapture(video)
|
5 |
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
+
# We need to set resolutions.
|
8 |
+
# so, convert them from float to integer.
|
9 |
+
frame_width = int(video.get(3))
|
10 |
+
frame_height = int(video.get(4))
|
11 |
|
12 |
+
size = (frame_width, frame_height)
|
13 |
+
|
14 |
+
# Below VideoWriter object will create
|
15 |
+
# a frame of above defined The output
|
16 |
+
# is stored in 'filename.avi' file.
|
17 |
+
result = cv2.VideoWriter('videos/filename.avi',
|
18 |
+
cv2.VideoWriter_fourcc(*'MJPG'),10, size)
|
19 |
|
20 |
+
iface = gr.Interface(
|
21 |
+
video_input,
|
22 |
+
gr.inputs.Video(source="upload"),
|
23 |
+
"playable_video",
|
24 |
+
)
|
25 |
iface.launch()
|