优化flask接口

This commit is contained in:
2024-09-20 14:47:43 +08:00
parent f0c03e763b
commit a2a82df21c
2 changed files with 9 additions and 5 deletions

View File

@@ -56,7 +56,7 @@ def get_book_areas(image):
@retry(stop=stop_after_attempt(3), wait=wait_random(1, 3), reraise=True,
after=lambda x: logging.warning("获取文档区域失败!"))
def request_book_areas(image):
url = "http://det_api:5000/det/detect_books"
url = "http://det_api:5000/det/books"
_, encoded_image = cv2.imencode('.jpg', image)
byte_stream = encoded_image.tobytes()
files = {"image": ("image.jpg", byte_stream)}