Spaces:
Running
Running
Merge branch 'main' of https://huggingface.co/spaces/Hyphonical/Video2x
Browse files
App.py
CHANGED
@@ -307,8 +307,10 @@ with App.Blocks(
|
|
307 |
InputVideo = App.Video(
|
308 |
label='Input Video', sources=['upload'], height=300
|
309 |
)
|
310 |
-
|
311 |
-
|
|
|
|
|
312 |
InputModel = App.Dropdown(
|
313 |
choices=ModelNames,
|
314 |
label='Select Model',
|
@@ -423,8 +425,20 @@ with App.Blocks(
|
|
423 |
outputs=[InputThreshold, InputMinPercentage, InputMaxRectangles, InputPadding, InputSegmentRows, InputSegmentColumns, InputFullFrameInterval],
|
424 |
)
|
425 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
426 |
SubmitButton.click(
|
427 |
-
fn=
|
428 |
inputs=[
|
429 |
InputVideo,
|
430 |
InputModel,
|
|
|
307 |
InputVideo = App.Video(
|
308 |
label='Input Video', sources=['upload'], height=300
|
309 |
)
|
310 |
+
def GetModelNames():
|
311 |
+
return [Path(model).stem for model in Upscaler().ListModels()]
|
312 |
+
|
313 |
+
ModelNames = GetModelNames()
|
314 |
InputModel = App.Dropdown(
|
315 |
choices=ModelNames,
|
316 |
label='Select Model',
|
|
|
425 |
outputs=[InputThreshold, InputMinPercentage, InputMaxRectangles, InputPadding, InputSegmentRows, InputSegmentColumns, InputFullFrameInterval],
|
426 |
)
|
427 |
|
428 |
+
def ProcessWrapper(InputVideo, InputModel, InputUseRegions, InputThreshold, InputMinPercentage, InputMaxRectangles, InputPadding, Progress=App.Progress()):
|
429 |
+
return Upscaler().Process(
|
430 |
+
InputVideo,
|
431 |
+
InputModel,
|
432 |
+
InputUseRegions,
|
433 |
+
InputThreshold,
|
434 |
+
InputMinPercentage,
|
435 |
+
InputMaxRectangles,
|
436 |
+
InputPadding,
|
437 |
+
Progress
|
438 |
+
)
|
439 |
+
|
440 |
SubmitButton.click(
|
441 |
+
fn=ProcessWrapper,
|
442 |
inputs=[
|
443 |
InputVideo,
|
444 |
InputModel,
|