Compare commits

..

No commits in common. "81f88f5025142e259fa9b27cc77dd7e278f0fb1e" and "8d3d6cba99bca88553b9ff7cc6af6cc50e86bbe7" have entirely different histories.

1 changed files with 2 additions and 23 deletions

25
demo.py
View File

@ -9,8 +9,7 @@ from utils.torch_utils import select_device
from utilsK.queRiver import get_labelnames,get_label_arrays from utilsK.queRiver import get_labelnames,get_label_arrays
import numpy as np import numpy as np
import torch import torch
from utilsK.masterUtils import get_needed_objectsIndex
def main(): def main():
##预先设置的参数 ##预先设置的参数
device_='1' ##选定模型,可选 cpu,'0','1' device_='1' ##选定模型,可选 cpu,'0','1'
@ -22,29 +21,9 @@ def main():
conf_thres,iou_thres,classes= 0.25,0.45,5 conf_thres,iou_thres,classes= 0.25,0.45,5
labelnames = "../AIlib/weights/yolov5/class5/labelnames.json" labelnames = "../AIlib/weights/yolov5/class5/labelnames.json"
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]] 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]]
####模型选择参数用如下: allowedList=[0,1,2,3]
mode_paras=[
{
"id":"0",
"config":{
"k1":"v1",
"k2":"v2"
}
},
{
"id":"1",
"config":{
"k1":"v1",
"k2":"v2"
}
}
]
allowedList,allowedList_string=get_needed_objectsIndex(mode_paras)
#allowedList=[0,1,2,3]
##加载模型,准备好显示字符 ##加载模型,准备好显示字符
device = select_device(device_) device = select_device(device_)
names=get_labelnames(labelnames) names=get_labelnames(labelnames)