tejani commited on
Commit
a42fda6
·
verified ·
1 Parent(s): 3ba4b92

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -19,10 +19,10 @@ class TryOnRequest(BaseModel):
19
 
20
  @app.get("/")
21
  async def root():
22
- return {"message": "Virtual Try-On API"}
23
 
24
  @app.post("/upload")
25
- async def forward_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,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 virtual_try_on(request: TryOnRequest):
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 = {