Spaces:
Running
Running
rogerxavier
commited on
Commit
•
935bf92
1
Parent(s):
1ac8a5b
Update app.py
Browse files
app.py
CHANGED
@@ -180,13 +180,12 @@ def image_to_wd14_tags(image: Image.Image, model_name: str, threshold: float,
|
|
180 |
return ratings, output_text, filtered_tags
|
181 |
|
182 |
|
183 |
-
#获取图片调用image_to_wd14_tags函数获取返回 ->"ratings, output_text, filtered_tags"
|
184 |
-
#@app.post("/getOriginalMangaList")
|
185 |
@app.route("/getOriginalMangaList", methods=["GET", "POST"])
|
186 |
def getOriginalMangaList(image: UploadFile = File(...)):
|
187 |
print("收到请求")
|
188 |
|
189 |
-
img = image.
|
190 |
image_data = Image.open(io.BytesIO(img)).convert("L").convert("RGB")
|
191 |
|
192 |
return image_to_wd14_tags(image_data,'chen-moat2',0.5,True,True)
|
|
|
180 |
return ratings, output_text, filtered_tags
|
181 |
|
182 |
|
183 |
+
#获取图片调用image_to_wd14_tags函数获取返回 ->"ratings, output_text, filtered_tags"
|
|
|
184 |
@app.route("/getOriginalMangaList", methods=["GET", "POST"])
|
185 |
def getOriginalMangaList(image: UploadFile = File(...)):
|
186 |
print("收到请求")
|
187 |
|
188 |
+
img = image.read()
|
189 |
image_data = Image.open(io.BytesIO(img)).convert("L").convert("RGB")
|
190 |
|
191 |
return image_to_wd14_tags(image_data,'chen-moat2',0.5,True,True)
|