Yaroslav
commited on
test1
Browse files
app.py
CHANGED
@@ -1,17 +1,16 @@
|
|
1 |
-
import
|
2 |
import gradio as gr
|
|
|
|
|
|
|
|
|
3 |
|
4 |
def increase_fps(input_video_path, target_fps=60):
|
5 |
output_path = "output.mp4"
|
6 |
-
|
7 |
-
#
|
8 |
-
(
|
9 |
-
|
10 |
-
.input(input_video_path)
|
11 |
-
.output(output_path, vf=f"fps={target_fps},minterpolate='mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps={target_fps}'", an=None)
|
12 |
-
.run(overwrite_output=True)
|
13 |
-
)
|
14 |
-
|
15 |
return output_path
|
16 |
|
17 |
def process_video(video_path):
|
@@ -22,7 +21,7 @@ interface = gr.Interface(
|
|
22 |
inputs=gr.Video(label="Загрузите видео для обработки"),
|
23 |
outputs=gr.Video(label="Видео с увеличенным FPS"),
|
24 |
title="Увеличение FPS до 60",
|
25 |
-
description="Этот инструмент увеличивает частоту кадров видео до 60 FPS с использованием
|
26 |
examples=[]
|
27 |
)
|
28 |
|
|
|
1 |
+
import os
|
2 |
import gradio as gr
|
3 |
+
from super_resolution import SuperResolution
|
4 |
+
|
5 |
+
# Инициализация модели SuperResolution
|
6 |
+
sr = SuperResolution()
|
7 |
|
8 |
def increase_fps(input_video_path, target_fps=60):
|
9 |
output_path = "output.mp4"
|
10 |
+
|
11 |
+
# Используем SuperResolution для увеличения FPS
|
12 |
+
sr.process_video(input_video_path, output_path, fps=target_fps)
|
13 |
+
|
|
|
|
|
|
|
|
|
|
|
14 |
return output_path
|
15 |
|
16 |
def process_video(video_path):
|
|
|
21 |
inputs=gr.Video(label="Загрузите видео для обработки"),
|
22 |
outputs=gr.Video(label="Видео с увеличенным FPS"),
|
23 |
title="Увеличение FPS до 60",
|
24 |
+
description="Этот инструмент увеличивает частоту кадров видео до 60 FPS с использованием суперразрешения. Загрузите видео с низким FPS, чтобы получить плавный результат.",
|
25 |
examples=[]
|
26 |
)
|
27 |
|