paraUdate
23
demo.py
|
|
@ -9,6 +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():
|
||||||
##预先设置的参数
|
##预先设置的参数
|
||||||
|
|
@ -21,7 +22,27 @@ 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]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##加载模型,准备好显示字符
|
##加载模型,准备好显示字符
|
||||||
|
|
|
||||||
|
After Width: | Height: | Size: 411 KiB |
|
After Width: | Height: | Size: 407 KiB |
|
After Width: | Height: | Size: 416 KiB |
|
After Width: | Height: | Size: 420 KiB |
|
After Width: | Height: | Size: 426 KiB |
|
After Width: | Height: | Size: 420 KiB |
|
After Width: | Height: | Size: 408 KiB |
|
After Width: | Height: | Size: 401 KiB |
|
After Width: | Height: | Size: 399 KiB |
|
After Width: | Height: | Size: 391 KiB |
|
After Width: | Height: | Size: 409 KiB |
|
After Width: | Height: | Size: 402 KiB |
|
After Width: | Height: | Size: 409 KiB |
|
After Width: | Height: | Size: 410 KiB |
|
After Width: | Height: | Size: 430 KiB |
|
After Width: | Height: | Size: 438 KiB |
|
After Width: | Height: | Size: 456 KiB |
|
After Width: | Height: | Size: 457 KiB |
|
After Width: | Height: | Size: 459 KiB |
|
After Width: | Height: | Size: 457 KiB |
|
After Width: | Height: | Size: 450 KiB |
|
After Width: | Height: | Size: 451 KiB |