Update app.py
Browse files
app.py
CHANGED
@@ -19,10 +19,10 @@ class TryOnRequest(BaseModel):
|
|
19 |
|
20 |
@app.get("/")
|
21 |
async def root():
|
22 |
-
return {"
|
23 |
|
24 |
@app.post("/upload")
|
25 |
-
async def
|
26 |
"""Upload an image file to the external API."""
|
27 |
if file.content_type not in ALLOWED_IMAGE_TYPES:
|
28 |
raise HTTPException(status_code=400, detail="Invalid file type. Only PNG or JPEG allowed.")
|
@@ -47,7 +47,7 @@ async def forward_upload(file: UploadFile = File(...)):
|
|
47 |
raise HTTPException(status_code=500, detail=f"An unexpected error occurred: {str(e)}")
|
48 |
|
49 |
@app.post("join")
|
50 |
-
async def
|
51 |
"""Process virtual try-on request with person and garment images."""
|
52 |
url = f"{BASE_URL}/queue/join"
|
53 |
headers = {
|
|
|
19 |
|
20 |
@app.get("/")
|
21 |
async def root():
|
22 |
+
return {"<b>Virtual Try-On API</b>"}
|
23 |
|
24 |
@app.post("/upload")
|
25 |
+
async def upload(file: UploadFile = File(...)):
|
26 |
"""Upload an image file to the external API."""
|
27 |
if file.content_type not in ALLOWED_IMAGE_TYPES:
|
28 |
raise HTTPException(status_code=400, detail="Invalid file type. Only PNG or JPEG allowed.")
|
|
|
47 |
raise HTTPException(status_code=500, detail=f"An unexpected error occurred: {str(e)}")
|
48 |
|
49 |
@app.post("join")
|
50 |
+
async def join(request: TryOnRequest):
|
51 |
"""Process virtual try-on request with person and garment images."""
|
52 |
url = f"{BASE_URL}/queue/join"
|
53 |
headers = {
|