备份一份涂抹结果在本地

This commit is contained in:
2024-07-10 09:22:11 +08:00
parent 40953d4cf4
commit ce0e0f3bbd

View File

@@ -19,7 +19,7 @@ from config.ucloud import BUCKET
from models import ZxPhrec, ZxPhhd
from ucloud import ucloud
OCR = PaddleOCR(use_angle_cls=False, lang="ch", show_log=False, gpu_id=1)
OCR = PaddleOCR(use_angle_cls=False, lang="ch", show_log=False)
def open_image(img_path):
@@ -253,6 +253,7 @@ def photo_mask(pk_phhd, content):
(255, 255, 255), -1, 0)
with tempfile.NamedTemporaryFile(delete=False, suffix=".jpg") as temp_file:
cv2.imwrite(temp_file.name, image)
cv2.imwrite(f"./mask_test2/{phrec.cfjaddress}.jpg", image)
for i in range(3):
is_upload_success = ucloud.upload_file(phrec.cfjaddress, temp_file.name)
if is_upload_success: