digitSize
This commit is contained in:
parent
74261cf8b9
commit
69d04d8c8b
8
demo.py
8
demo.py
|
|
@ -86,10 +86,12 @@ def road_forest_demo(business ):
|
||||||
#business='forest';imageW=4916 ####森林模型
|
#business='forest';imageW=4916 ####森林模型
|
||||||
#business='road';
|
#business='road';
|
||||||
imageW=1536 ####道路模型
|
imageW=1536 ####道路模型
|
||||||
|
digitFont= { 'line_thickness':2, 'fontSize':1.0} ###数字显示的线宽度,大小; 如果都是None,则采用默认大小
|
||||||
Detweights="../AIlib/weights/%s/best.pt"%(business)
|
Detweights="../AIlib/weights/%s/best.pt"%(business)
|
||||||
labelnames = "../AIlib/weights/%s/labelnames.json"%(business)
|
labelnames = "../AIlib/weights/%s/labelnames.json"%(business)
|
||||||
postFile= '../AIlib/conf/para.json'
|
|
||||||
|
|
||||||
|
postFile= '../AIlib/conf/para.json'
|
||||||
|
print( Detweights,labelnames )
|
||||||
conf_thres,iou_thres,classes,rainbows=get_postProcess_para(postFile)
|
conf_thres,iou_thres,classes,rainbows=get_postProcess_para(postFile)
|
||||||
|
|
||||||
####模型选择参数用如下:
|
####模型选择参数用如下:
|
||||||
|
|
@ -139,7 +141,7 @@ def road_forest_demo(business ):
|
||||||
im0s=[cv2.imread(imgpath)]
|
im0s=[cv2.imread(imgpath)]
|
||||||
time00 = time.time()
|
time00 = time.time()
|
||||||
#使用不同的函数。每一个领域采用一个函数
|
#使用不同的函数。每一个领域采用一个函数
|
||||||
p_result,timeOut = AI_process_forest(im0s,model,segmodel,names,label_arraylist,rainbows,half,device,conf_thres, iou_thres,allowedList)
|
p_result,timeOut = AI_process_forest(im0s,model,segmodel,names,label_arraylist,rainbows,half,device,conf_thres, iou_thres,allowedList,font=digitFont)
|
||||||
time11 = time.time()
|
time11 = time.time()
|
||||||
image_array = p_result[1]
|
image_array = p_result[1]
|
||||||
cv2.imwrite( os.path.join( outpth,folders[i] ) ,image_array )
|
cv2.imwrite( os.path.join( outpth,folders[i] ) ,image_array )
|
||||||
|
|
@ -152,5 +154,5 @@ def road_forest_demo(business ):
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
#river_demo()
|
#river_demo()
|
||||||
road_forest_demo('road' )
|
road_forest_demo('forest' )
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue