Open louxy126 opened 6 years ago
i use the yolo.h5 provided by this hub and follw this https://github.com/Qidian213/deep_sort_yolov3/issues/7 it is very funny that it works to tracking cars
when i change ` if predicted_class != 'car' : continue box = out_boxes[i]
x = int(box[1])
y = int(box[0])
w = int(box[3]-box[1])
h = int(box[2]-box[0])
if x < 0 :
w = w + x
x = 0
if y < 0 :
h = h + y
y = 0
return_boxs.append([x,y,w,h])`
to ` if predicted_class == 'car' or 'person':
box = out_boxes[i]
# score = out_scores[i]
x = int(box[1])
y = int(box[0])
w = int(box[3] - box[1])
h = int(box[2] - box[0])
if x < 0:
w = w + x
x = 0
if y < 0:
h = h + y
y = 0
return_boxs.append([x, y, w, h])
return return_boxs`
it can track cars and person at the same time,but trafficlight 、bicyclist are also tracked!!!! and the outcome is not good,and i still want to find how to use my own model!
i think this is because the default yolo.h5 is trained in coco which contains 80 classes!
I afraid that it can track cars and person at the same time,but trafficlight 、bicyclist are also tracked!!!!
because of the model you trained was not performs well. And i found that the deep sort
model also need to improve.
Did you solve the problem? I have the exact same error when try to use self-trained .h5 file.
@GuanzhaoLi 可以的,是博主的整合代码的时候没有把那部分放进去,我过两天fork一下博主的,然后把那部分的代码更新一下
多谢大佬,能问一下到底是哪部分代码导致的不能使用keras yolo 训练出来的模型吗?
@louxy126 您好,我也有这个问题,请问怎么改变代码呢
@louxy126 请问现在您的代码可以使用自己训练的h5模型吗
I want to run with local video. What should I do? Looking forward to reply.
I would like to track cars and pedestrians,so I trained a model with https://github.com/qqwweee/keras-yolo3 ,and the model is trained_weights.h5. I chenged the path in yolo.py to
self.model_path = '~/PycharmProjects/keras-yolo3-master/logs/000/trained_weights.h5' self.anchors_path = '~/PycharmProjects/keras-yolo3-master/model_data/yolo_anchors.txt' self.classes_path = '~/PycharmProjects/keras-yolo3-master/model_data/voc_classes.txt'
the yolo_anchors.txt and voc_classes.txt' are what I used when train trained_weights.h5. but when i python demo.py ,errorTraceback (most recent call last): File "/media/jsu/205E470B5E46D8E4/lxy/deep_sort_yolov3/demo.py", line 112, in main(YOLO()) File "/media/jsu/205E470B5E46D8E4/lxy/deep_sort_yolov3/yolo.py", line 33, in init self.boxes, self.scores, self.classes = self.generate() File "/media/jsu/205E470B5E46D8E4/lxy/deep_sort_yolov3/yolo.py", line 54, in generate self.yolo_model = load_model(model_path, compile=False) File "/home/jsu/anaconda3/envs/deep_sort/lib/python3.5/site-packages/keras/models.py", line 241, in load_model raise ValueError('No model found in config file.') ValueError: No model found in config file.
anybody know how to deal with it? thanks!