pgigioli / darknet_ros

YOLO integration with ROS for real-time object detection
51 stars 23 forks source link

Cannot run with different cfg file #14

Open anthcolange opened 6 years ago

anthcolange commented 6 years ago

Hi, so I've been trying to run with a different weight and cfg file than voc, and have gotten it to run but no detection occurs. I've simply changed the two parameters in yolo_ros.cpp. Is there anything else that needs to be changed in order to run with a different network such as yolo-obj.cfg?

pgigioli commented 6 years ago

Did you change the class labels on line 31 in yolo_ros.cpp?

anthcolange commented 6 years ago

Yes, I'm just using a single class so I changed that accordingly.

pgigioli commented 6 years ago

Hmm, that should be all that you need to change. you can try testing it with the single_image_test node if you have an image that you know should pick up a detection

anthcolange commented 6 years ago

I'm still not getting any detection. However in this case it is running the network. When I run with video the camera's also never open and the network never initializes. For clarity the network I'm using is this https://github.com/AlexeyAB/Yolo_mark/blob/master/x64/Release/yolo-obj.cfg . Is there anything that needs to be changed in that file?

Additionally I'm trying to make this run on six different camera's and I've managed to get everything running with them except the bounding boxes. This is all done with the yolo-voc configuation and I've simply remapped arguments in the launch file under 6 different nodes, one for each camera: the remapped arguments are CAMERA_TOPIC_NAME /found_object and /YOLO_boxes. This has worked in producing six /found_object topics and six /YOLO_boxes topics, however the /YOLO_boxes topic only indicates the confidence of the object and not the coordinates of the bounding box. It simply displays 0's for the coordinates. And in the image windows the name of the object detected by the camera is displayed, but no box is output. Would you know which other things should be remapped for the bounding boxes to work as well on multiple cameras? Thank you so much!

rongfeng-china commented 6 years ago

Same problem for me... I have tried with yolov3.cfg, yolov3.weights, and changed the class to be 'person' only. I feel that the current code can only deal with yolo-voc.cfg. If anyone wants to go deeper, probably this link is helpful: here and here

pgigioli commented 6 years ago

@rongfeng-china if you are using a yolov3 cfg, then it won't work as this repo only has compatibility up to yolov2.

@anthcolange Is that yolo-obj.cfg based off of yolov3? If so, it probably won't work. I'm not sure about the 6 camera set up. Are you saying that you have a single yolo node that subscribes to 6 different camera topics or are you running the yolo node 6 different times for each camera separately? I wonder if bounding boxes are getting mixed up with different camera frames since the code isn't really meant to handle multiple cameras at once.

davidsanchezf commented 6 years ago

Same issue here, I have tried with yolo 2 config [yolo_2class_box11.cfg] and yolo 2 weights:

yolo_2class_box11_3000.weights from http://guanghan.info/blog/en/my-works/train-yolo/

but I was not able to detect anything. (now I have doubts if on that testing I changed the classes in the yolo_ros.cpp file

With

char cfg = "/home/catkin_ws/src/darknet_ros/cfg/yolo-voc.cfg"; char weights = "/home/catkin_ws/src/darknet_ros/weights/yolo-voc.weights";

it works perfect, if I change the weights I have had a case in which it detectted too much.

I guess if you or anybody can share his/her experience on testing the model with different config and weights. My purpose is to use it with my own trained data, one of them would be: yolo_2class_box11.cfg

Thanks so much in advance for your help,

David

davidsanchezf commented 6 years ago

I will keep testing during this weekend, keep you informed if I am able to make it work,

David

davidsanchezf commented 6 years ago

Hello again,

I was able to train my own weights with my own data based on yolo2 based on this git

git clone https://github.com/AlexeyAB/darknet.git

Got less than 0,06 loss average

I tested the detection directly by executing

./darknet detector test cfg/obj.data cfg/yolov2-voc.cfg yolov2-voc_2300.weights data/myownimages.jpg

And the detection was positive 93%

I tested again on your yolo ros *after changing

const std::string class_labels[] = { "stopsign", "yieldsign" }; but I did detect nothing.

I have started a new training with yolo-voc.cfg and darknet19_448.conv.23 to see if that way I can detect something. I do not see big deferences between yolo-voc.cfg and yolov2-voc.cfg.

I have to add that if I use the weights you have in yolo_ros.cpp in combination with yolov2-voc.cfg the results are like a chaos.

Can you help me with these? I have been stucked for the last week and got no advances.

In this we transfer you can download my the weights I used to train, the cfg I used to train and the weights I obtained *tested and worked with the command I refer to above.

https://we.tl/kPkMRX5zHI

Thanks so much in advance for your help,

David