Muhammad Taqi Raza
commited on
Commit
·
306187e
1
Parent(s):
c6789b3
fps=24
Browse files
app.py
CHANGED
@@ -55,7 +55,7 @@ os.makedirs(OUTPUT_DIR, exist_ok=True)
|
|
55 |
# ----------------------------------------
|
56 |
# Step 3: Inference Function
|
57 |
# ----------------------------------------
|
58 |
-
def run_inference(video_path, save_format):
|
59 |
input_name = f"{uuid.uuid4()}.mp4"
|
60 |
input_path = os.path.join(UPLOAD_DIR, input_name)
|
61 |
shutil.copy(video_path, input_path)
|
@@ -66,7 +66,8 @@ def run_inference(video_path, save_format):
|
|
66 |
"--model_path", MODEL_PATH,
|
67 |
"--output_path", OUTPUT_DIR,
|
68 |
"--is_vae_st",
|
69 |
-
"--save_format", save_format
|
|
|
70 |
]
|
71 |
|
72 |
try:
|
@@ -143,13 +144,14 @@ with gr.Blocks() as demo:
|
|
143 |
value="yuv444p",
|
144 |
label="Save format"
|
145 |
)
|
|
|
146 |
|
147 |
run_button = gr.Button("Run Inference")
|
148 |
status = gr.Textbox(label="Status")
|
149 |
|
150 |
run_button.click(
|
151 |
fn=run_inference,
|
152 |
-
inputs=[input_video, save_format],
|
153 |
outputs=[status, output_video],
|
154 |
)
|
155 |
|
|
|
55 |
# ----------------------------------------
|
56 |
# Step 3: Inference Function
|
57 |
# ----------------------------------------
|
58 |
+
def run_inference(video_path, save_format, upscale):
|
59 |
input_name = f"{uuid.uuid4()}.mp4"
|
60 |
input_path = os.path.join(UPLOAD_DIR, input_name)
|
61 |
shutil.copy(video_path, input_path)
|
|
|
66 |
"--model_path", MODEL_PATH,
|
67 |
"--output_path", OUTPUT_DIR,
|
68 |
"--is_vae_st",
|
69 |
+
"--save_format", save_format,
|
70 |
+
"--upscale", str(upscale) # ✅ add this
|
71 |
]
|
72 |
|
73 |
try:
|
|
|
144 |
value="yuv444p",
|
145 |
label="Save format"
|
146 |
)
|
147 |
+
upscale_input = gr.Number(value=4, label="Upscale Factor (e.g. 2, 4, 8)")
|
148 |
|
149 |
run_button = gr.Button("Run Inference")
|
150 |
status = gr.Textbox(label="Status")
|
151 |
|
152 |
run_button.click(
|
153 |
fn=run_inference,
|
154 |
+
inputs=[input_video, save_format, upscale_input], # ✅ added upscale_input
|
155 |
outputs=[status, output_video],
|
156 |
)
|
157 |
|