(file: UploadFile = File(...))
| 66 | |
| 67 | @app.post("/retinaface_anticov") |
| 68 | def detect_retinaface_anticov(file: UploadFile = File(...)): |
| 69 | file_bytes = io.BytesIO(file.file.read()) |
| 70 | # image = Image.open(file_bytes) |
| 71 | # name = f"/data/{str(uuid.uuid4())}.jpg" |
| 72 | # image.save(name) |
| 73 | processed_image = retinaface_anticov(file_bytes) |
| 74 | bytes_io = io.BytesIO() |
| 75 | processed_image.save(bytes_io, format="PNG") |
| 76 | return Response(bytes_io.getvalue(), media_type="image/png") |
| 77 | |
| 78 | |
| 79 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected