Spaces:
Runtime error
Runtime error
File size: 1,326 Bytes
8463e3d d127a48 8463e3d 1a14eb2 d127a48 1a14eb2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
from flask import Flask, render_template, request, redirect, url_for
import subprocess
import os
os.system("cd roop")
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
# Get form inputs
target_path = request.form['target_path']
output_quality = request.form['output_quality']
source_path = request.form['source_path']
output_path = request.form['output_path']
execution_provider = request.form['execution_provider']
frame_processors = request.form.getlist('frame_processors')
# Construct command
command = [
"python", "run.py",
"--target", target_path,
"--output-video-quality", output_quality,
"--source", source_path,
"-o", output_path,
"--execution-provider", execution_provider,
]
# Add frame processors if provided
if frame_processors:
command.extend(["--frame-processor"] + frame_processors)
# Run the command
subprocess.run(command)
return redirect(url_for('index'))
return render_template('./index.html')
if __name__ == '__main__':
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=7860, debug=True)
print(" Its not workin")
|