4 Commits
master ... test

Author SHA1 Message Date
b3b7171c8b testupdate 2022-12-14 15:23:09 +08:00
0f3433ece9 update 2022-12-05 17:55:50 +08:00
3d6223e1da update 2022-12-05 16:21:01 +08:00
b224d1bbfa test push 2022-11-30 08:59:03 +08:00
2 changed files with 18 additions and 17 deletions

View File

@ -51,8 +51,9 @@ _C.fgbgmask_old = '../module/ieemoo-ai-searchv2/model/now/ori_old.jpg'
_C.URL = 'https://api.ieemoo.com/emoo-api/intelligence' #online _C.URL = 'https://api.ieemoo.com/emoo-api/intelligence' #online
#_C.URL = 'http://api.test.ieemoo.com/emoo-api/intelligence' #_C.URL = 'http://api.test.ieemoo.com/emoo-api/intelligence'
#_C.Vre = 'http://api.test2.ieemoo.cn/emoo-api/intelligence/queryVideoCompareResult.do' _C.VreTest = 'http://api.test.ieemoo.cn/emoo-api/intelligence/queryVideoCompareResult.do'
_C.Vre = 'https://api.ieemoo.com/emoo-api/intelligence/queryVideoCompareResult.do' #online _C.VreTest2 = 'http://api.test2.ieemoo.cn/emoo-api/intelligence/queryVideoCompareResult.do'
#_C.Vre = 'https://api.ieemoo.com/emoo-api/intelligence/queryVideoCompareResult.do' #online
_C.Ocrimg = '../module/ieemoo-ai-assist/imgs'#post ocr img _C.Ocrimg = '../module/ieemoo-ai-assist/imgs'#post ocr img
_C.Ocrtxt = '../module/ieemoo-ai-assist/document'#post ocr txts _C.Ocrtxt = '../module/ieemoo-ai-assist/document'#post ocr txts

View File

@ -17,6 +17,8 @@ def AddObs(file_path, status):
with lock: with lock:
if not cfg.flag: if not cfg.flag:
addobs(file_path, status) addobs(file_path, status)
os.remove(file_path)
else: else:
if status == '02': if status == '02':
addobs(file_path, status) addobs(file_path, status)
@ -26,22 +28,20 @@ def AddObs(file_path, status):
shutil.move(file_path, f_dst) shutil.move(file_path, f_dst)
def addobs(file_path, status): #save videos def addobs(file_path, status): #save videos
ti.sleep(3) ti.sleep(5)
num = 0
videoUuid = os.path.basename(file_path).split('_')[1] videoUuid = os.path.basename(file_path).split('_')[1]
json_data = {'videoUuid': videoUuid} json_data = {'videoUuid': videoUuid}
resp = requests.post(url=cfg.Vre, for vre in [cfg.VreTest, cfg.VreTest2]:
data=json_data) resp = requests.post(url=vre, data=json_data)
status = resp.json() status = resp.json()
if not 'data' in status:#延迟设置 if not 'data' in status:#延迟设置
while num < 20: ti.sleep(10)
ti.sleep(2)
num += 1
resp = requests.post(url=cfg.Vre, data=json_data) resp = requests.post(url=cfg.Vre, data=json_data)
status = resp.json() status = resp.json()
if not 'data' in status: if 'data' in status:
continue break
else:break else:
break
status = status['data'] status = status['data']
objectkey = os.path.basename(file_path) objectkey = os.path.basename(file_path)
@ -49,7 +49,7 @@ def addobs(file_path, status): #save videos
if objectkey.split('.')[-1] in ['avi','mp4']: if objectkey.split('.')[-1] in ['avi','mp4']:
objectkey = 'videos/'+time+'/'+status+'/'+status+'_'+objectkey objectkey = 'videos/'+time+'/'+status+'/'+status+'_'+objectkey
resp = obsClient.putFile(bucketName, objectkey, file_path) resp = obsClient.putFile(bucketName, objectkey, file_path)
os.remove(file_path) #os.remove(file_path)
def Addimg(uuid_barcode): def Addimg(uuid_barcode):
time = uuid_barcode.split('-')[0].split('_')[-1] time = uuid_barcode.split('-')[0].split('_')[-1]