Spaces:
Build error
Build error
Update run/gradio_ootd.py
Browse files- run/gradio_ootd.py +4 -0
run/gradio_ootd.py
CHANGED
@@ -8,6 +8,7 @@ from preprocess.openpose.run_openpose import OpenPose
|
|
8 |
from preprocess.humanparsing.run_parsing import Parsing
|
9 |
from ootd.inference_ootd_hd import OOTDiffusionHD
|
10 |
from ootd.inference_ootd_dc import OOTDiffusionDC
|
|
|
11 |
|
12 |
app = Flask(__name__)
|
13 |
|
@@ -26,6 +27,8 @@ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
26 |
category_dict = ['upperbody', 'lowerbody', 'dress']
|
27 |
category_dict_utils = ['upper_body', 'lower_body', 'dresses']
|
28 |
|
|
|
|
|
29 |
@app.route("/process_hd", methods=["POST"])
|
30 |
def process_hd():
|
31 |
data = request.files
|
@@ -79,6 +82,7 @@ def process_hd():
|
|
79 |
|
80 |
return jsonify(images=base64_images)
|
81 |
|
|
|
82 |
@app.route("/process_dc", methods=["POST"])
|
83 |
def process_dc():
|
84 |
data = request.files
|
|
|
8 |
from preprocess.humanparsing.run_parsing import Parsing
|
9 |
from ootd.inference_ootd_hd import OOTDiffusionHD
|
10 |
from ootd.inference_ootd_dc import OOTDiffusionDC
|
11 |
+
import spaces
|
12 |
|
13 |
app = Flask(__name__)
|
14 |
|
|
|
27 |
category_dict = ['upperbody', 'lowerbody', 'dress']
|
28 |
category_dict_utils = ['upper_body', 'lower_body', 'dresses']
|
29 |
|
30 |
+
|
31 |
+
@spaces.GPU
|
32 |
@app.route("/process_hd", methods=["POST"])
|
33 |
def process_hd():
|
34 |
data = request.files
|
|
|
82 |
|
83 |
return jsonify(images=base64_images)
|
84 |
|
85 |
+
@spaces.GPU
|
86 |
@app.route("/process_dc", methods=["POST"])
|
87 |
def process_dc():
|
88 |
data = request.files
|