IT_Server/modules/test_translate_api.py

22 lines
581 B
Python

import requests
import json
API_URL = "http://127.0.0.1:7000/translate_image"
payload = {
"local_image_path": "d:/py/IT_Server/modules/img/6.jpg",
"file_prefix": "test",
"toggle_states": {"ocr": True},
"unwanted_texts": {"크리스탈": "크리미"},
"watermark_text": "테스트 워터마크",
"watermark_opacity": 0.5,
"watermark_font_size": 32
}
headers = {"Content-Type": "application/json"}
response = requests.post(API_URL, data=json.dumps(payload), headers=headers)
print("응답 결과:")
print(response.status_code)
print(response.json())