schwittlick / ofxDarknet

darknet neural network addon for openFrameworks
MIT License
496 stars 89 forks source link

YOLO examples don't align with current code state #27

Closed colejd closed 7 years ago

colejd commented 7 years ago

Hello!

I'm trying to use the YOLO part of this library in Visual Studio 2015.

The examples in the readme show setups where you set up darknet by calling the following:

darknet.init( cfgfile, weightfile, datacfg, nameslist );

However, the init function only takes 3 parameters:

void init( std::string cfgfile, std::string weightfile, std::string nameslist = "");

By omitting datacfg in my code, it seems to run, but I'm having issues with the names of the detected objects (unicode garbage attached to the front).

My question, then, is this: How do I use YOLO, given that I've set up VS correctly?

(Other thing I thought I'd point out: "cfg/names.list" in the first example for YOLO is not a file in the project)

schwittlick commented 7 years ago

Hey @seieibob

I've just updated the readme on this branch: https://github.com/mrzl/ofxDarknet/tree/mrzl/windows

Can you check and run things by following the instructions here: https://github.com/mrzl/ofxDarknet/issues/23#issuecomment-307658348

All the config files should be there: https://github.com/mrzl/ofxDarknet/tree/mrzl/windows/example-yolo2/bin/data/cfg you just need to download the weights file: http://pjreddie.com/media/files/yolo9000.weights

Let me know how it's going!

colejd commented 7 years ago

I was actually already using the branch mentioned at #23, coincidentally. It works, and the updated readme helped me fix the problem! I was passing in the data file as the third parameter instead of the names file, since it was (at one point) the only way it was working. That was the problem. Perhaps there should be a check on the extension of each file to make sure you're not giving it the wrong thing?

Regarding the unicode garbage, I just had to cast the labels with c_str(). I don't think it has anything to do with your library but I'll mention it here in case someone else has the same problem.

Thanks for getting back to me so quickly! I'll call this closed.

colejd commented 7 years ago

One last thing I noticed -- in the first example on that readme, you have the following line:

std::string nameslist = ofToDataPath( "cfg/names.list" );

Should the path be "cfg/coco.names"? I couldn't find a file called names.list.