Parcourir la source

update cityMgerment model

master
wangjin0928 il y a 1 an
Parent
révision
25aecfbce7
6 fichiers modifiés avec 8 ajouts et 8 suppressions
  1. +3
    -4
      AI.py
  2. BIN
      __pycache__/AI.cpython-38.pyc
  3. +2
    -1
      readme.md
  4. +2
    -2
      weights/conf/cityMangement/labelnames.json
  5. +1
    -1
      weights/conf/cityMangement/para.json
  6. BIN
      weights/conf/cityMangement/yolov5.pt

+ 3
- 4
AI.py Voir le fichier

@@ -43,7 +43,7 @@ def get_postProcess_para_dic(parfile):
par = json.load(fp)
parPost=par['post_process']
return parPost
def AI_process(im0s,model,segmodel,names,label_arraylist,rainbows,objectPar={ 'half':True,'device':'cuda:0' ,'conf_thres':0.25,'iou_thres':0.45,'allowedList':[0,1,2,3],'slopeIndex':[5,6,7],'segRegionCnt':1, 'trtFlag_det':False,'trtFlag_seg':False }, font={ 'line_thickness':None, 'fontSize':None,'boxLine_thickness':None,'waterLineColor':(0,255,255),'waterLineWidth':3} ,segPar={'modelSize':(640,360),'mean':(0.485, 0.456, 0.406),'std' :(0.229, 0.224, 0.225),'numpy':False, 'RGB_convert_first':True},mode='others',postPar=None):
def AI_process(im0s,model,segmodel,names,label_arraylist,rainbows,objectPar={ 'half':True,'device':'cuda:0' ,'conf_thres':0.25,'iou_thres':0.45,'allowedList':[0,1,2,3],'segRegionCnt':1, 'trtFlag_det':False,'trtFlag_seg':False }, font={ 'line_thickness':None, 'fontSize':None,'boxLine_thickness':None,'waterLineColor':(0,255,255),'waterLineWidth':3} ,segPar={'modelSize':(640,360),'mean':(0.485, 0.456, 0.406),'std' :(0.229, 0.224, 0.225),'numpy':False, 'RGB_convert_first':True},mode='others',postPar=None):
#输入参数
# im0s---原始图像列表
@@ -59,7 +59,7 @@ def AI_process(im0s,model,segmodel,names,label_arraylist,rainbows,objectPar={ 'h
# Letterbox
half,device,conf_thres,iou_thres,allowedList = objectPar['half'],objectPar['device'],objectPar['conf_thres'],objectPar['iou_thres'],objectPar['allowedList']
slopeIndex, trtFlag_det,trtFlag_seg,segRegionCnt = objectPar['slopeIndex'],objectPar['trtFlag_det'],objectPar['trtFlag_seg'],objectPar['segRegionCnt']
trtFlag_det,trtFlag_seg,segRegionCnt = objectPar['trtFlag_det'],objectPar['trtFlag_seg'],objectPar['segRegionCnt']
if 'ovlap_thres_crossCategory' in objectPar.keys():
ovlap_thres = objectPar['ovlap_thres_crossCategory']
else:
@@ -100,8 +100,7 @@ def AI_process(im0s,model,segmodel,names,label_arraylist,rainbows,objectPar={ 'h
pred = model(img,augment=False)[0]
time2=time.time()
#datas = [[''], img, im0s, None,pred,seg_pred,10]
#ObjectPar={ 'object_config':allowedList, 'slopeIndex':slopeIndex ,'segmodel':segFlag,'segRegionCnt':segRegionCnt }
#p_result,timeOut = post_process_(datas,conf_thres, iou_thres,names,label_arraylist,rainbows,10,ObjectPar=ObjectPar,font=font,padInfos=padInfos,ovlap_thres=ovlap_thres)

BIN
__pycache__/AI.cpython-38.pyc Voir le fichier


+ 2
- 1
readme.md Voir le fichier

@@ -38,4 +38,5 @@
2.demo.py中添加noParking 1.0版本,不成熟,后面还要更新。
3.demo3.0.py中对'river', 'highWay2','noParking','drowning','forest2','vehicle','pedestrian','smogfire' , 'AnglerSwimmer','channelEmergency', 'countryRoad','cityMangement',增加跟踪功能。

2023.7.17
1.demo.py,demo3.0.py 的cityMangement模型增加“流动商贩”类别,修改后的模型检测类别是:“车辆”、“垃圾”、“流动商贩”

+ 2
- 2
weights/conf/cityMangement/labelnames.json Voir le fichier

@@ -1,4 +1,4 @@
{
"labelnames":["车辆","垃圾"],
"labelIndexs":["SL01","SL02"]
"labelnames":["车辆","垃圾","商贩"],
"labelIndexs":["SL01","SL02","SL03"]
}

+ 1
- 1
weights/conf/cityMangement/para.json Voir le fichier

@@ -1,7 +1,7 @@
{


"post_process":{ "name":"post_process","conf_thres":0.25,"iou_thres":0.45,"ovlap_thres_crossCategory":0.6,"classes":2,"rainbows":[ [0,0,255],[0,255,0],[255,0,0],[255,0,255],[255,255,0],[255,129,0],[255,0,127],[127,255,0],[0,255,127],[0,127,255],[127,0,255],[255,127,255],[255,255,127],[127,255,255],[0,255,255],[255,127,255],[127,255,255], [0,127,0],[0,0,127],[0,255,255]] }
"post_process":{ "name":"post_process","conf_thres":0.25,"iou_thres":0.45,"classes":5,"rainbows":[ [0,0,255],[0,255,0],[255,0,0],[255,0,255],[255,255,0],[255,129,0],[255,0,127],[127,255,0],[0,255,127],[0,127,255],[127,0,255],[255,127,255],[255,255,127],[127,255,255],[0,255,255],[255,127,255],[127,255,255], [0,127,0],[0,0,127],[0,255,255]] }


}

BIN
weights/conf/cityMangement/yolov5.pt Voir le fichier


Chargement…
Annuler
Enregistrer