Yaroslav commited on
Commit
825bf33
·
verified ·
1 Parent(s): efa0609
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -1,17 +1,16 @@
1
- import ffmpeg
2
  import gradio as gr
 
 
 
 
3
 
4
  def increase_fps(input_video_path, target_fps=60):
5
  output_path = "output.mp4"
6
-
7
- # Использование FFmpeg для продвинутой интерполяции движения
8
- (
9
- ffmpeg
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 с использованием продвинутой интерполяции движения. Загрузите видео с низким 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