原因:
1.主要是想加快识别速度(在减小识别类别的情况下)
2.减小数据库大小
3.去掉不想要的类别
4.仍然想用官方的weight(比我自己训练的精准)
5.因为对keras不熟, 不知道怎么在convert.py时直接从数据库中阉割掉
过程:
yolo3不管是视频还是图片检测 调用的都是 yolo.py 中的 detect_image
yolo.py 中 detect_image 关于 类别self.classes 由
out_boxes, out_scores, out_classes = self.sess.run(
[self.boxes, self.scores, self.classes],
feed_dict={
self.yolo_model.input: image_data,
self.input_image_shape: [image.size[1], image.size[0]],
K.learning_phase(): 0
})
generate(__init__调用)中的
boxes, scores, classes = yolo_eval(self.yolo_model.output, self.anchors,
len(self.class_names), self.input_image_shape,
score_threshold=self.score, iou_threshold=self.iou)
return boxes, scores, classes
中的yolo_eval(位于yolo3中的 model.py)中的下一段, 添加一条if语句即可(第二行注释掉的)
for c in range(num_cl