Spaces:
Sleeping
Sleeping
rogerxavier
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -181,14 +181,13 @@ def image_to_wd14_tags(image: Image.Image, model_name: str, threshold: float,
|
|
181 |
|
182 |
|
183 |
#获取图片调用image_to_wd14_tags函数获取返回 ->"ratings, output_text, filtered_tags"
|
184 |
-
@app.
|
185 |
-
def getOriginalMangaList(image: UploadFile = File(...)):
|
186 |
print("收到请求")
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
return image_to_wd14_tags(image_data,'chen-moat2',0.5,True,True)
|
192 |
|
193 |
|
194 |
if __name__ == "__main__":
|
|
|
181 |
|
182 |
|
183 |
#获取图片调用image_to_wd14_tags函数获取返回 ->"ratings, output_text, filtered_tags"
|
184 |
+
@app.post("/getOriginalMangaList")
|
185 |
+
def getOriginalMangaList(image: List[UploadFile] = File(...)):
|
186 |
print("收到请求")
|
187 |
+
for idx, image in enumerate(images):
|
188 |
+
img = image.file.read()
|
189 |
+
image_data = Image.open(io.BytesIO(img)).convert("L").convert("RGB")
|
190 |
+
return image_to_wd14_tags(image_data,'chen-moat2',0.5,True,True)
|
|
|
191 |
|
192 |
|
193 |
if __name__ == "__main__":
|