edgeUpdate
This commit is contained in:
@ -53,7 +53,9 @@ _C.URL = 'https://api.ieemoo.com/emoo-api/intelligence' #online
|
|||||||
|
|
||||||
_C.VreTest = 'http://api.test.ieemoo.cn/emoo-api/intelligence/queryVideoCompareResult.do'
|
_C.VreTest = 'http://api.test.ieemoo.cn/emoo-api/intelligence/queryVideoCompareResult.do'
|
||||||
_C.VreTest2 = 'http://api.test2.ieemoo.cn/emoo-api/intelligence/queryVideoCompareResult.do'
|
_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.Vre = 'https://api.ieemoo.com/emoo-api/intelligence/queryVideoCompareResult.do' #online
|
||||||
|
|
||||||
|
_C.backups = '../module/output/videos'
|
||||||
|
|
||||||
_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
|
||||||
|
@ -17,6 +17,7 @@ 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,14 +27,14 @@ 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)
|
||||||
videoUuid = os.path.basename(file_path).split('_')[1]
|
videoUuid = os.path.basename(file_path).split('_')[1]
|
||||||
json_data = {'videoUuid': videoUuid}
|
json_data = {'videoUuid': videoUuid}
|
||||||
for vre in [cfg.VreTest, cfg.VreTest2]:
|
for vre in [cfg.Vre]:#[cfg.VreTest, cfg.VreTest2, cfg.Vre]:
|
||||||
resp = requests.post(url=vre, 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:#延迟设置
|
||||||
ti.sleep(5)
|
ti.sleep(15)
|
||||||
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 'data' in status:
|
if 'data' in status:
|
||||||
@ -41,13 +42,14 @@ def addobs(file_path, status): #save videos
|
|||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
status = status['data']
|
status = status['data']
|
||||||
|
|
||||||
objectkey = os.path.basename(file_path)
|
objectkey = os.path.basename(file_path)
|
||||||
|
backups_path = os.sep.join([cfg.backups, status+'_'+objectkey])
|
||||||
time = os.path.basename(file_path).split('-')[0]
|
time = os.path.basename(file_path).split('-')[0]
|
||||||
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)
|
shutil.move(file_path, backups_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]
|
||||||
|
Reference in New Issue
Block a user