- yolov5模型中,设置detect.py脚本中的‘–classes’来选择要检测的类,在help前加入
default=0,
就是只检测‘0’这个类。 - 也可以在调用的detect.py脚本的时候加入这个参数。
python detect.py --weights ./weights/best.pt --classes 0 --img 640 --conf 0.5 --source ../test
default=0,
就是只检测‘0’这个类。python detect.py --weights ./weights/best.pt --classes 0 --img 640 --conf 0.5 --source ../test