rogerxavier commited on
Commit
f8096b7
1 Parent(s): 7ab60ac

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +8 -13
api.py CHANGED
@@ -27,16 +27,11 @@ def t5():
27
 
28
 
29
 
30
- @app.post("/getCoordinates")
31
- async def getCoordinates(image: UploadFile = File(...)):
32
- img = await image.read()
33
- image = Image.open(io.BytesIO(img)).convert("L").convert("RGB")
34
- path_to_image = "save.jpg"
35
- image.save(path_to_image)
36
- return "获取图片保存成功"
37
-
38
-
39
-
40
-
41
-
42
-
 
27
 
28
 
29
 
30
+ @app.post("/getOriginalMangaList")
31
+ async def getOriginalMangaList(image_list: dict):
32
+ for idx, img_data in enumerate(image_list["imageList"]):
33
+ img = io.BytesIO(img_data.encode())
34
+ image = Image.open(img).convert("L").convert("RGB")
35
+ path_to_image = f"/manga/{idx}.jpg"
36
+ image.save(path_to_image)
37
+ return "获取图片保存成功"