yolov5只检测单一类别或者特定的类

在detect.py中
170行

                    if save_img or save_crop or view_img:  # Add bbox to image
                        c = int(cls)  # integer class
                        # FIXME:
                        if names[int(cls)] == "name_sign":
                        		label = None if hide_labels else (names[c] if hide_conf else f'{names[c]} {conf:.2f}')
                        		annotator.box_label(xyxy, label, color=colors(c, True),counta = counta)
                        		if save_crop:
                           				 save_one_box(xyxy, imc, file=save_dir / 'crops' / names[c] / f'{p.stem}.jpg', BGR=True)
上一篇:一文过pandas入门(中篇)——才疏学浅的莫笑天


下一篇:Converting a List to String in Java