dongchangxi 11 months ago
parent
commit
6a558e93d5
  1. 15
      old_to_new_build/get_reg_info_by_self.py

15
old_to_new_build/get_reg_info_by_self.py

@ -1,6 +1,7 @@
import os, sys, time, shlex, subprocess, shutil, requests, cv2, numpy as np import os, sys, time, shlex, subprocess, shutil, requests, cv2, numpy as np
from PIL import Image from PIL import Image
import platform,json,redis import platform,json,redis
import tools_to_xmps
if platform.system() == 'Windows': if platform.system() == 'Windows':
sys.path.append('e:\\libs\\') sys.path.append('e:\\libs\\')
#sys.path.append('libs') #sys.path.append('libs')
@ -48,8 +49,18 @@ def check_pid_file(pid):
#根据参数初始化操作 #根据参数初始化操作
def cmd_run(pid,usePhoto = "1",lock=False): def cmd_run(pid,usePhoto = "1",lock=False):
pid = str(pid) pid = str(pid)
#检测文件并且下载处理文件 #判断是否存在该目录
check_pid_file(pid) if os.path.exists(os.path.join(config.workdir, pid)) == False:
#下载照片
libs.down_from_oss(config.oss_bucket, config.workdir, pid)
else:
#移除文件夹
shutil.rmtree(os.path.join(config.workdir, pid), ignore_errors=True)
#下载照片
libs.down_from_oss(config.oss_bucket, config.workdir, pid)
print(f"旋转图片:{pid}")
tools_to_xmps.rateImages(pid)
start_time = time.time() start_time = time.time()
#文件路径 #文件路径

Loading…
Cancel
Save