diff --git a/deploy_api.py b/deploy_api.py index ef4494e5..1f0851a8 100644 --- a/deploy_api.py +++ b/deploy_api.py @@ -27,14 +27,14 @@ def numpy_2_base64(img: np.ndarray): @app.post("/idphoto") async def idphoto_inference( input_image: UploadFile, - height: str = Form(...), - width: str = Form(...), + height: int = Form(413), + width: int = Form(295), human_matting_model: str = Form("hivision_modnet"), face_detect_model: str = Form("mtcnn"), - head_measure_ratio=0.2, - head_height_ratio=0.45, - top_distance_max=0.12, - top_distance_min=0.10, + head_measure_ratio: float = 0.2, + head_height_ratio: float = 0.45, + top_distance_max: float = 0.12, + top_distance_min: float = 0.10, ): image_bytes = await input_image.read() @@ -101,7 +101,7 @@ async def idphoto_inference( async def photo_add_background( input_image: UploadFile, color: str = Form(...), - kb: str = Form(None), + kb: int = Form(None), render: int = Form(0), ): render_choice = ["pure_color", "updown_gradient", "center_gradient"] @@ -147,7 +147,7 @@ async def generate_layout_photos( input_image: UploadFile, height: str = Form(...), width: str = Form(...), - kb: str = Form(None), + kb: int = Form(None), ): # try: image_bytes = await input_image.read() diff --git a/docs/api_CN.md b/docs/api_CN.md index 470d7469..4763b7ac 100644 --- a/docs/api_CN.md +++ b/docs/api_CN.md @@ -68,7 +68,7 @@ cURL 是一个命令行工具,用于使用各种网络协议传输数据。以 ```bash curl -X POST "http://127.0.0.1:8080/idphoto" \ --F "input_image=@demo/images/test.jpg" \ +-F "input_image=@demo/images/test0.jpg" \ -F "height=413" \ -F "width=295" \ -F "human_matting_model=hivision_modnet" \ @@ -99,7 +99,7 @@ curl -X POST "http://127.0.0.1:8080/generate_layout_photos" \ ```bash curl -X POST "http://127.0.0.1:8080/human_matting" \ --F "input_image=@demo/images/test.jpg" \ +-F "input_image=@demo/images/test0.jpg" \ -F "human_matting_model=hivision_modnet" ``` @@ -115,7 +115,7 @@ curl -X POST "http://127.0.0.1:8080/human_matting" \ import requests url = "http://127.0.0.1:8080/idphoto" -input_image_path = "images/test.jpg" +input_image_path = "demo/images/test0.jpg" files = {"input_image": open(input_image_path, "rb")} data = {"height": 413, "width": 295, "human_matting_model": "hivision_modnet", "face_detect_model": "mtcnn"} @@ -509,7 +509,7 @@ async function uploadImage(inputImagePath) { } // 示例调用 -uploadImage("demo/images/test.jpg").then(response => { +uploadImage("demo/images/test0.jpg").then(response => { console.log(response); }); ``` \ No newline at end of file diff --git a/docs/api_EN.md b/docs/api_EN.md index 1d75308b..cfb7f262 100644 --- a/docs/api_EN.md +++ b/docs/api_EN.md @@ -68,7 +68,7 @@ cURL is a command-line tool for transferring data using various network protocol ```bash curl -X POST "http://127.0.0.1:8080/idphoto" \ --F "input_image=@demo/images/test.jpg" \ +-F "input_image=@demo/images/test0.jpg" \ -F "height=413" \ -F "width=295" \ -F "human_matting_model=hivision_modnet" \ @@ -99,7 +99,7 @@ curl -X POST "http://127.0.0.1:8080/generate_layout_photos" \ ```bash curl -X POST "http://127.0.0.1:8080/human_matting" \ --F "input_image=@demo/images/test.jpg" \ +-F "input_image=@demo/images/test0.jpg" \ -F "human_matting_model=hivision_modnet" ``` @@ -115,7 +115,7 @@ curl -X POST "http://127.0.0.1:8080/human_matting" \ import requests url = "http://127.0.0.1:8080/idphoto" -input_image_path = "images/test.jpg" +input_image_path = "images/test0.jpg" files = {"input_image": open(input_image_path, "rb")} data = {"height": 413, "width": 295, "human_matting_model": "hivision_modnet", "face_detect_model": "mtcnn"} @@ -430,7 +430,7 @@ async function generateIdPhoto(inputImagePath, height, width) { } // Example call -generateIdPhoto("images/test.jpg", 413, 295).then(response => { +generateIdPhoto("images/test0.jpg", 413, 295).then(response => { console.log(response); }); ``` @@ -507,7 +507,7 @@ async function uploadImage(inputImagePath) { } // Example call -uploadImage("demo/images/test.jpg").then(response => { +uploadImage("demo/images/test0.jpg").then(response => { console.log(response); }); ``` \ No newline at end of file diff --git a/docs/api_JP.md b/docs/api_JP.md index 2cc65710..7e1aa258 100644 --- a/docs/api_JP.md +++ b/docs/api_JP.md @@ -67,7 +67,7 @@ cURLは、さまざまなネットワークプロトコルを使用してデー ```bash curl -X POST "http://127.0.0.1:8080/idphoto" \ --F "input_image=@demo/images/test.jpg" \ +-F "input_image=@demo/images/test0.jpg" \ -F "height=413" \ -F "width=295" \ -F "human_matting_model=hivision_modnet" \ @@ -98,7 +98,7 @@ curl -X POST "http://127.0.0.1:8080/generate_layout_photos" \ ```bash curl -X POST "http://127.0.0.1:8080/human_matting" \ --F "input_image=@demo/images/test.jpg" \ +-F "input_image=@demo/images/test0.jpg" \ -F "human_matting_model=hivision_modnet" ``` @@ -114,7 +114,7 @@ curl -X POST "http://127.0.0.1:8080/human_matting" \ import requests url = "http://127.0.0.1:8080/idphoto" -input_image_path = "images/test.jpg" +input_image_path = "images/test0.jpg" files = {"input_image": open(input_image_path, "rb")} data = {"height": 413, "width": 295, "human_matting_model": "hivision_modnet", "face_detect_model": "mtcnn"} @@ -430,7 +430,7 @@ async function generateIdPhoto(inputImagePath, height, width) { } // サンプル呼び出し -generateIdPhoto("images/test.jpg", 413, 295).then(response => { +generateIdPhoto("images/test0.jpg", 413, 295).then(response => { console.log(response); }); ``` @@ -507,7 +507,7 @@ async function uploadImage(inputImagePath) { } // サンプル呼び出し -uploadImage("demo/images/test.jpg").then(response => { +uploadImage("demo/images/test0.jpg").then(response => { console.log(response); }); ``` \ No newline at end of file diff --git a/docs/api_KO.md b/docs/api_KO.md index c4925ef0..3edb91df 100644 --- a/docs/api_KO.md +++ b/docs/api_KO.md @@ -68,7 +68,7 @@ cURL은 다양한 네트워크 프로토콜을 사용하여 데이터를 전송 ```bash curl -X POST "http://127.0.0.1:8080/idphoto" \ --F "input_image=@demo/images/test.jpg" \ +-F "input_image=@demo/images/test0.jpg" \ -F "height=413" \ -F "width=295" \ -F "human_matting_model=hivision_modnet" \ @@ -99,7 +99,7 @@ curl -X POST "http://127.0.0.1:8080/generate_layout_photos" \ ```bash curl -X POST "http://127.0.0.1:8080/human_matting" \ --F "input_image=@demo/images/test.jpg" \ +-F "input_image=@demo/images/test0.jpg" \ -F "human_matting_model=hivision_modnet" ``` @@ -115,7 +115,7 @@ curl -X POST "http://127.0.0.1:8080/human_matting" \ import requests url = "http://127.0.0.1:8080/idphoto" -input_image_path = "images/test.jpg" +input_image_path = "images/test0.jpg" files = {"input_image": open(input_image_path, "rb")} data = {"height": 413, "width": 295, "human_matting_model": "hivision_modnet", "face_detect_model": "mtcnn"} @@ -432,7 +432,7 @@ async function generateIdPhoto(inputImagePath, height, width) { } // 예시 호출 -generateIdPhoto("images/test.jpg", 413, 295).then(response => { +generateIdPhoto("images/test0.jpg", 413, 295).then(response => { console.log(response); }); ``` @@ -509,7 +509,7 @@ async function uploadImage(inputImagePath) { } // 예시 호출 -uploadImage("demo/images/test.jpg").then(response => { +uploadImage("demo/images/test0.jpg").then(response => { console.log(response); }); ``` \ No newline at end of file