备份一份涂抹结果在本地
This commit is contained in:
@@ -19,7 +19,7 @@ from config.ucloud import BUCKET
|
|||||||
from models import ZxPhrec, ZxPhhd
|
from models import ZxPhrec, ZxPhhd
|
||||||
from ucloud import ucloud
|
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):
|
def open_image(img_path):
|
||||||
@@ -253,6 +253,7 @@ def photo_mask(pk_phhd, content):
|
|||||||
(255, 255, 255), -1, 0)
|
(255, 255, 255), -1, 0)
|
||||||
with tempfile.NamedTemporaryFile(delete=False, suffix=".jpg") as temp_file:
|
with tempfile.NamedTemporaryFile(delete=False, suffix=".jpg") as temp_file:
|
||||||
cv2.imwrite(temp_file.name, image)
|
cv2.imwrite(temp_file.name, image)
|
||||||
|
cv2.imwrite(f"./mask_test2/{phrec.cfjaddress}.jpg", image)
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
is_upload_success = ucloud.upload_file(phrec.cfjaddress, temp_file.name)
|
is_upload_success = ucloud.upload_file(phrec.cfjaddress, temp_file.name)
|
||||||
if is_upload_success:
|
if is_upload_success:
|
||||||
|
|||||||
Reference in New Issue
Block a user