Browse Source

update noParking parameters

master
wangjin0928 1 year ago
parent
commit
b1b673208c
2 changed files with 11 additions and 9 deletions
  1. +8
    -6
      demo.py
  2. +3
    -3
      demo3.0.py

+ 8
- 6
demo.py View File

@@ -116,8 +116,9 @@ def process_video(video,par0,mode='detSeg'):
else:
p_result,timeOut = AI_process_forest([imgarray],par0['model'],par0['segmodel'],par0['names'],par0['label_arraylist'],par0['rainbows'],par0['half'],par0['device'],par0['conf_thres'], par0['iou_thres'],par0['allowedList'],font=par0['digitFont'],trtFlag_det=par0['trtFlag_det'])
p_result[1] = drawAllBox(p_result[2],p_result[1],par0['label_arraylist'],par0['rainbows'],par0['digitFont'])
if mode != 'track':
image_array = p_result[1];num+=1
ret = vid_writer_AI.write(image_array)
@@ -184,20 +185,21 @@ def detSeg_demo(opt):
'seg_nclass':3,###分割模型类别数目,默认2类
'segRegionCnt':2,###分割模型结果需要保留的等值线数目
'segPar':{'modelSize':(640,360),'mean':(0.485, 0.456, 0.406),'std' :(0.229, 0.224, 0.225),'predResize':True,'numpy':False, 'RGB_convert_first':True,###分割模型预处理参数
'segPar':{'modelSize':(1920,1080),'mean':(0.485, 0.456, 0.406),'std' :(0.229, 0.224, 0.225),'predResize':True,'numpy':False, 'RGB_convert_first':True,###分割模型预处理参数
'mixFunction':{'function':tracfficAccidentMixFunction,
'pars':{ 'RoadArea': 16000, 'roadVehicleAngle': 15, 'speedRoadVehicleAngleMax': 75, 'roundness': 1.0, 'cls': 9, 'vehicleFactor': 0.1, 'confThres':0.25,'roadIou':0.6,'radius': 50 ,'vehicleFlag':True,'distanceFlag': False}
'pars':{ 'RoadArea': 16000, 'roadVehicleAngle': 15, 'speedRoadVehicleAngleMax': 75, 'roundness': 1.0, 'cls': 9, 'vehicleFactor': 0.1, 'confThres':0.25,'roadIou':0.6,'radius': 50 ,'vehicleFlag':False,'distanceFlag': False}
}
},
'Segweights' : "../weights/%s/AIlib2/%s/stdc_360X640_%s_fp16.engine"%(opt['gpu'], opt['business'] ,opt['gpu'] ),###分割模型权重位置
#'Segweights' :'/mnt/thsw2/DSP2/weights/highWay2/stdc_360X640.pth',
'postFile': '../AIlib2/weights/conf/%s/para.json'%(opt['business'] ),###后处理参数文件
'txtFontSize':20,###文本字符的大小
'digitFont': { 'line_thickness':2,'boxLine_thickness':1, 'fontSize':1.0,'waterLineColor':(0,255,255),'segLineShow':True,'waterLineWidth':2},###显示框、线设置
#'testImgPath':'images/highWay2/',###测试图像的位置
'testImgPath':'images/noParking',
'testImgPath':'/mnt/thsw2/DSP2/videos/hightWay2',
'testOutPath':'images/results/',###输出测试图像位置
}
@@ -905,7 +907,7 @@ if __name__=="__main__":
#jkm_demo()
businessAll=['river2','AnglerSwimmer', 'countryRoad','forest2', 'pedestrian' , 'smogfire' , 'vehicle','ship2',"highWay2","channelEmergency","cityMangement","drowning","noParking","illParking"]
businessAll = ['highWay2']
businessAll = ['noParking']
# forest 、 ocr2 、ocr_en 、 river 、 road 、 ship ,目前都没有在用

+ 3
- 3
demo3.0.py View File

@@ -265,8 +265,8 @@ def det_track_demo(business ):
'mixFunction':{'function':mixNoParking_road_postprocess,
'pars':
#{ 'roundness': 0.3, 'cls': 9, 'laneArea': 10, 'laneAngleCha': 5 ,'RoadArea': 16000, }
{'RoadArea': 16000, 'roadVehicleAngle': 15,'radius': 50, 'distanceFlag': False, 'vehicleFlag': False}
{ 'roundness': 0.3, 'cls': 9, 'laneArea': 10, 'laneAngleCha': 5 ,'RoadArea': 16000}
}
},
@@ -831,7 +831,7 @@ if __name__=="__main__":
#jkm_demo()
#businessAll=['river', 'river2','highWay2','noParking','drowning','forest2','vehicle','pedestrian','smogfire' , 'AnglerSwimmer','channelEmergency', 'countryRoad','cityMangement','ship2']
businessAll = ['highWay2']
businessAll = ['noParking']
for busi in businessAll:
print('-'*40,'beg to test:',busi,'-'*40)

Loading…
Cancel
Save