新增4个模型:
This commit is contained in:
commit
20f0ce2a98
13
AI.py
13
AI.py
|
|
@ -24,16 +24,16 @@ def get_images_videos(impth, imageFixs=['.jpg','.JPG','.PNG','.png'],videoFixs=[
|
||||||
videopaths=[]###获取文件里所有的视频
|
videopaths=[]###获取文件里所有的视频
|
||||||
if os.path.isdir(impth):
|
if os.path.isdir(impth):
|
||||||
for postfix in imageFixs:
|
for postfix in imageFixs:
|
||||||
imgpaths.extend(glob.glob('%s/*%s'%(impth,postfix)))
|
imgpaths.extend(glob.glob('%s/*%s'%(impth,postfix )) )
|
||||||
for postfix in videoFixs:
|
for postfix in videoFixs:
|
||||||
videopaths.extend(glob.glob('%s/*%s'%(impth,postfix)))
|
videopaths.extend(glob.glob('%s/*%s'%(impth,postfix )) )
|
||||||
else:
|
else:
|
||||||
postfix = os.path.splitext(impth)[-1]
|
postfix = os.path.splitext(impth)[-1]
|
||||||
if postfix in imageFixs: imgpaths=[impth]
|
if postfix in imageFixs: imgpaths=[ impth ]
|
||||||
if postfix in videoFixs: videopaths = [impth]
|
if postfix in videoFixs: videopaths = [impth ]
|
||||||
|
|
||||||
print('%s: test Images:%d , test videos:%d '%(impth, len(imgpaths), len(videopaths)))
|
print('%s: test Images:%d , test videos:%d '%(impth, len(imgpaths), len(videopaths)))
|
||||||
return imgpaths,videopaths
|
return imgpaths,videopaths
|
||||||
|
|
||||||
def xywh2xyxy(box,iW=None,iH=None):
|
def xywh2xyxy(box,iW=None,iH=None):
|
||||||
xc,yc,w,h = box[0:4]
|
xc,yc,w,h = box[0:4]
|
||||||
|
|
@ -345,7 +345,7 @@ def AI_process_forest(im0s,model,segmodel,names,label_arraylist,rainbows,half=Tr
|
||||||
p_result,timeOut = post_process_(datas,conf_thres, iou_thres,names,label_arraylist,rainbows,10,ObjectPar=ObjectPar,font=font,padInfos=padInfos,ovlap_thres=SecNms)
|
p_result,timeOut = post_process_(datas,conf_thres, iou_thres,names,label_arraylist,rainbows,10,ObjectPar=ObjectPar,font=font,padInfos=padInfos,ovlap_thres=SecNms)
|
||||||
#print('###line274:',p_result[2])
|
#print('###line274:',p_result[2])
|
||||||
#p_result,timeOut = post_process_(datas,conf_thres, iou_thres,names,label_arraylist,rainbows,10,object_config=allowedList,segmodel=segFlag,font=font,padInfos=padInfos)
|
#p_result,timeOut = post_process_(datas,conf_thres, iou_thres,names,label_arraylist,rainbows,10,object_config=allowedList,segmodel=segFlag,font=font,padInfos=padInfos)
|
||||||
time_info = 'letterbox:%.1f, infer:%.1f, '%((time1-time0)*1000,(time2-time1)*1000 )
|
time_info = 'letterbox:%.1f, infer:%.1f, '%( (time1-time0)*1000,(time2-time1)*1000 )
|
||||||
return p_result,time_info+timeOut
|
return p_result,time_info+timeOut
|
||||||
def AI_det_track( im0s_in,modelPar,processPar,sort_tracker,segPar=None):
|
def AI_det_track( im0s_in,modelPar,processPar,sort_tracker,segPar=None):
|
||||||
im0s,iframe=im0s_in[0],im0s_in[1]
|
im0s,iframe=im0s_in[0],im0s_in[1]
|
||||||
|
|
@ -671,7 +671,6 @@ def AI_det_track_batch_N(imgarray_list, iframe_list ,modelList,postProcess,sort_
|
||||||
#[ifrmae, x0 ,y0 ,x1 ,y1 ,conf,cls,trackId ]
|
#[ifrmae, x0 ,y0 ,x1 ,y1 ,conf,cls,trackId ]
|
||||||
detResults.append( res )
|
detResults.append( res )
|
||||||
|
|
||||||
|
|
||||||
retResults=[imgarray_list,track_det_result,detResults ]
|
retResults=[imgarray_list,track_det_result,detResults ]
|
||||||
t2 = time.time()
|
t2 = time.time()
|
||||||
timeInfos = 'detTrack:%.1f TrackPost:%.1f, %s'%(get_ms(t1,t0),get_ms(t2,t1), timeInfos_track )
|
timeInfos = 'detTrack:%.1f TrackPost:%.1f, %s'%(get_ms(t1,t0),get_ms(t2,t1), timeInfos_track )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue