You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@app.post("/mask/exec", summary="Mask text in image", description="Mask text in the given image URL.")
41
-
asyncdefmask_image(req: ImageReq):
47
+
@app.post("/mask/exec", summary="Mask text in image and upload to S3", description="Upload an image, mask text, and upload the masked image to AWS S3.")
48
+
asyncdefmask_image(file: UploadFile=File(...)):
49
+
ifnotS3_BUCKET_NAME:
50
+
raiseHTTPException(status_code=500, detail="S3_BUCKET_NAME environment variable not set.")
51
+
42
52
try:
43
-
response=requests.get(req.image_url)
44
-
response.raise_for_status()
45
-
exceptrequests.RequestExceptionase:
46
-
return {"error": f"Failed to fetch image from URL: {e}"}
0 commit comments