frischzenger / yolo-windows

a yolo windows version(for object detection)
50 stars 101 forks source link

Yolo returns uniformly placed detections (bboxes) with almost equal confidence. #1

Open rap9430 opened 8 years ago

rap9430 commented 8 years ago

Darknet compiles and runs correctly under window, but the yolo's result is not rational (see attached image). Is this a known issue? thanks. predictions

tanger830 commented 8 years ago

I get the samilar result, someone in the google group argue that maybe caused by the file read mode 'r' and 'rb' difference between linux and windows, but i try it and cannot make it work. btw: let me know if you make it works.

rap9430 commented 8 years ago

Yes, that didn't work for me too.

tanger830 commented 8 years ago

I find the problem, this is because the yolo.weights and yolo.cfg you download is up to date,but loading code in this project is out of date, so it cannot recognize some field name defined in yolo.cfg and just ignore it, this is the beginning of wrong weight load.

rap9430 commented 8 years ago

Hm... Did you find a solution, too? If yes, then could you please share it with us?

zhangxuzju commented 8 years ago

Hi, i also encountered the problem above. what i want to ask is that is there any hint or instruction on how to compile this project on windows? if we learned this method.so maybe we could create yolo-windows ourselves

AlexeyAB commented 8 years ago

@2LOVES7 @rap9430

Hi, you can try this fork: https://github.com/AlexeyAB/yolo-windows

I've just got this result on Windows 7 x64 with yolo.cfg from my fork and yolo.weights from here: http://pjreddie.com/media/files/yolo.weights

predictions

rap9430 commented 8 years ago

@AlexeyAB

Thanks! It works like charm. :D

abhigarg commented 8 years ago

@AlexeyAB

Can I compile your version of yolo using Visual Studio 2012?

I tried with VS2012 and I have changed include and library paths to my opencv 3.0.0 and CUDA 7.5.

I am getting linkage errors:

1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\limits(80): error : this declaration may not have extern "C" linkage

this and many more like this for avgpool_layer_kernels.cu

AlexeyAB commented 8 years ago

@abhigarg

It can't be compiled using MSVS 2012 (v110) without code changes, because MSVS 2012 uses C89 standard of C, then must be declaring/initializing all local variables at the beginning of a code block (directly after an opening brace { ): http://stackoverflow.com/a/9903698/1558037

Otherwise there will be a lot of errors in lines like this: https://github.com/AlexeyAB/yolo-windows/blob/0bbef8e57ebd2d77d5ee46ed43e98db0c48c4cba/src/avgpool_layer.c#L8

About C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\limits(80): error : this declaration may not have extern "C" linkage perhaps this error is related to compile with OpenCV 3.0, and maybe this will help you: https://groups.google.com/forum/#!searchin/darknet/opencv$203/darknet/AfZcD-C6yXY/RWp5V2tXBAAJ

anas-899 commented 7 years ago

Is anyone succeeded in training YOLO over windows ? (the test is working but the output weight file from training is not detecting anything)

if so, could you please refer to that Fork?

abhigarg commented 7 years ago

the training was working but the trained weights file have some issues. It can not be re-used for further training. I cant remember if it was working for test. I think I used this fork only.

On Thu 25 Aug, 2016, 11:23 anas-899, notifications@github.com wrote:

Is anyone succeeded in training YOLO over windows ? the test is working but the training is not.

if so, could you please refer to that Fork?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/frischzenger/yolo-windows/issues/1#issuecomment-242287591, or mute the thread https://github.com/notifications/unsubscribe-auth/ACiH_N7ZmwjU2o0QV_ukF0mpX-Cjp9g7ks5qjS3PgaJpZM4HoBZe .

anas-899 commented 7 years ago

@abhigarg yes, I also finished the training successfully but the output weight file is not detecting anything when I made that train on windows. that's why I think there is a problem by training over the windows.

abhigarg commented 7 years ago

I feel it has something to do with the way file is being written over windows. Most probably there is something wrong happening there. I remember trying different forks for different MSVC 2012, 2013, 2015 and all were giving same problem for training.

On Thu 25 Aug, 2016, 11:31 anas-899, notifications@github.com wrote:

@abhigarg https://github.com/abhigarg yes, I also finished the training successfully but the output weight file is not detecting anything when I made that train on windows. that's why I think there is a problem by training over the windows.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/frischzenger/yolo-windows/issues/1#issuecomment-242288723, or mute the thread https://github.com/notifications/unsubscribe-auth/ACiH_FgsEZHVGT1JBG07LhteU0DuKpabks5qjS_OgaJpZM4HoBZe .

anas-899 commented 7 years ago

@abhigarg I solved the saving weight issue. It needs to change in @AlexeyAB fork in two position (https://github.com/AlexeyAB/yolo-windows) : first: src/parser.c you should change the line FILE fp = fopen(filename, "w"); to FILE fp = fopen(filename, "wb");

second: src/utils.c you should change the line if(c==' '||c=='\t'||c=='\n') ++offset; to if(c==' '||c=='\t'||c=='\n'||c=='\r') ++offset;

then the training on windows will save the weight correctly.

abhigarg commented 7 years ago

thanks a lot .. I knew it would be somewhere there but could not find the time to look into it.

I will try these changes and see at my end.

On Fri 26 Aug, 2016, 11:23 anas-899, notifications@github.com wrote:

@abhigarg https://github.com/abhigarg I solved the saving weight issue. It needs to change in AlexeyAB fork in two position ( https://github.com/AlexeyAB/yolo-windows) : first: src/parser.c you should change the line FILE fp = fopen(filename, "w"); to FILE fp = fopen(filename, "wb");

second: src/utils.c you should change the line if(c==' '||c=='\t'||c=='\n') ++offset; to if(c==' '||c=='\t'||c=='\n'||c=='\r') ++offset;

then the training on windows will save the weight correctly.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/frischzenger/yolo-windows/issues/1#issuecomment-242636758, or mute the thread https://github.com/notifications/unsubscribe-auth/ACiH_C4-4l2VKpx3tZJrgxKmYi6VtlZZks5qjn9mgaJpZM4HoBZe .

richipower commented 7 years ago

Hi, i tried both of them but no success, on the @AlexeyAB fork when i try to open the solution i get "One or more projects in the solution were not loaded correctly" actually i get this on both solutions, so I tried to compile the source by myself (just adding all the files on the src folder to an empty project) and got errors with the files "old.c" and "server.c" so I deleted them to see what happens, it compiles succesfully, and when running with both cfg files and weights I get the weird results as @rap9430 or just a colored image, yellow or green rectangle.. does anyone experiences the same error or has some idea what I might be doing wrong? greeeetz and thaaanks!

AlexeyAB commented 7 years ago

@richipower What version of MSVS, CUDA and OpenCV do you use?

richipower commented 7 years ago

hello, @AlexeyAB and thank you for your very fast answer, i was trying this past days.. i am using MSVS 2015, CUDA 8, Opencv 2.4.13, still no success, (now trying v2) compiles succesfully (excluding CUDA and OpenCV) but maybe i am reading the wrong cfg/weight files(?), I tested with the documents provided from: https://github.com/AlexeyAB/darknet and downloaded the weights also from there, the problem now is that there are no predictions, even with threshold as zero.. I did the same procedure with the version 1 (MSVS_2013) also from your fork and it succesfully worked, with the given weights and cfg´s :-) do you have maybe an idea what can be going wrong here with the v2? greetz and thaaanks!

AlexeyAB commented 7 years ago

@richipower Try to compile Yolo v2 with CUDA+OpenCV and run on video-file.

About Yolo v2:

About Yolo v1: now it works propertly only on MSVS2013.

AlexeyAB commented 7 years ago

@richipower

After the update the latest changes you can use this in Yolo v2:

To detection on image-file:

To detection on video-file:

richipower commented 7 years ago

hello! I was testing with the video files, everything works flawless. Now I will check with the images, thank you for your support! :-)

AlexeyAB commented 7 years ago

Current Yolo version 2 for Windows tested for custom training & detection: https://github.com/AlexeyAB/darknet