(file: UploadFile = File(...))
| 54 | |
| 55 | @app.post("/photo2cartoon") |
| 56 | def generate_photo2cartoon(file: UploadFile = File(...)): |
| 57 | file_bytes = io.BytesIO(file.file.read()) |
| 58 | # image = Image.open(file_bytes) |
| 59 | # name = f"/data/{str(uuid.uuid4())}.jpg" |
| 60 | # image.save(name) |
| 61 | cartoon_image = photo_2_cartoon(file_bytes) |
| 62 | bytes_io = io.BytesIO() |
| 63 | cartoon_image.save(bytes_io, format="PNG") |
| 64 | return Response(bytes_io.getvalue(), media_type="image/png") |
| 65 | |
| 66 | |
| 67 | @app.post("/retinaface_anticov") |
nothing calls this directly
no test coverage detected