Giter Club home page Giter Club logo

yolo-windows's Introduction

Yolo-Windows v1

"You Only Look Once: Unified, Real-Time Object Detection"

Here is a Yolo v1 windows version (for object detection)

Contributtors: https://github.com/pjreddie/darknet/graphs/contributors

This repository is forked from: https://github.com/frischzenger/yolo-windows Which is forked from Linux-version: https://github.com/pjreddie/darknet

More details: http://pjreddie.com/darknet/yolov1/

Requires:
Pre-trained models for different cfg-files can be downloaded from (smaller -> faster & lower quality):
Examples of results:

Everything Is AWESOME

Others: https://www.youtube.com/channel/UC7ev3hNVkx4DzZ3LO19oebg

Example of usage in cmd-files:
  • darknet.cmd - initialization with 1 GB model yolo.weights & yolo.cfg and get command prompt: enter the jpg-image-filename
  • darknet_demo.cmd - initialization with 1 GB model yolo.weights & yolo.cfg and play your video file which you must rename to: test.mp4
  • darknet_demo_small.cmd - initialization with 359 MB small model yolo-small.weights & yolo-small.cfg and play your video file which you must rename to: test.mp4
  • darknet_net_cam.cmd - initialization with 1 GB model, play video from network video-camera mjpeg-stream and store result to: test_dnn_out.avi
For using network video-camera mjpeg-stream with any Android smartphone:
  1. Download for Android phone mjpeg-stream soft: IP Webcam / Smart WebCam

Smart WebCam - preferably: https://play.google.com/store/apps/details?id=com.acontech.android.SmartWebCam IP Webcam: https://play.google.com/store/apps/details?id=com.pas.webcam

  1. Connect your Android phone to computer by WiFi (through a WiFi-router) or USB
  2. Start Smart WebCam on your phone
  3. Replace the address below, on shown in the phone application (Smart WebCam) and launch:
darknet.exe yolo demo yolo.cfg yolo.weights http://192.168.0.80:8080/video?dummy=param.mjpg -i 0

Windows (Visual Studio) Support Now yolo supports windows with Visual Studio. Just change the include directories / library directories to your own ones, and compile the codes with X64 Release mode. You may need pthread-windows while compiling and linking

How to train yourself:

To training for your 20 objects download pre-trained convolutional layers:

Then use the following command lines:

  • For tiny-model: darknet yolo train yolo-tiny.cfg darknet.conv.weights
  • For small-model: darknet yolo train yolo-small.cfg extraction.conv.weights
  • For full-model: darknet yolo train yolo.cfg extraction.conv.weights

To train for a different number of objects (not 20) or for different number of sides (not 7), you should change your .cfg-file 3 lines:

  • output= (5 x 2 + C) x S x S
  • classes= C
  • side= S

Where:

  • C = number of objects (by default 20)
  • S = number of sides (by default 7)

More details: http://pjreddie.com/darknet/yolov1/

How to compile:

  1. If you have CUDA 7.5, OpenCV 2.4.9 (C:\opencv_2.4.9) and MSVS 2013 (or 2015) then start MSVS, open yolo-windows\build\darknet\darknet.sln and do the: Build -> Build darknet

  2. If you have other version of CUDA (not 7.5) then open yolo-windows\build\darknet\darknet\darknet.vcxproj by using Notepad, find 2 places with "CUDA 7.5" and change it to your CUDA-version, then do step 1

  3. If you have other version of OpenCV 2.4.x (not 2.4.9) then you should change pathes after \darknet.sln is opened

3.1 (right click on project) -> properties -> C/C++ -> General -> Additional Include Directories

3.2 (right click on project) -> properties -> Linker -> General -> Additional Library Directories

  1. If you have other version of OpenCV 3.x (not 2.4.x) then you should change many places in code by yourself.

How to compile (custom):

Also, you can to create your own darknet.sln & darknet.vcxproj, this example for CUDA 7.5 and OpenCV 2.4.9

Then add to your created project:

  • (right click on project) -> properties -> C/C++ -> General -> Additional Include Directories, put here:

C:\opencv_2.4.9\opencv\build\include;..\..\..\3rdparty\include;%(AdditionalIncludeDirectories);$(CudaToolkitIncludeDir)

C:\opencv_2.4.9\opencv\build\x64\vc12\lib;$(CUDA_PATH)lib\$(PlatformName);%(AdditionalLibraryDirectories)

  • (right click on project) -> properties -> Linker -> Input -> Additional dependecies, put here:

..\..\..\3rdparty\lib\x64\pthreadVC2.lib;cublas.lib;curand.lib;cudart.lib;%(AdditionalDependencies)

  • (right click on project) -> properties -> C/C++ -> Preprocessor -> Preprocessor Definitions

OPENCV;_CRT_SECURE_NO_WARNINGS;GPU;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)

  • compile to .exe (X64 & Release) and put .dll`s near with .exe:

pthreadVC2.dll, pthreadGC2.dll from yolo-windows\3rdparty\dll\x64

cusolver64_75.dll, curand64_75.dll, cudart64_75.dll, cublas64_75.dll - 75 for CUDA 7.5 or your version, from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\bin

yolo-windows's People

Contributors

alexeyab avatar frischzenger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yolo-windows's Issues

Compile errors with yolo2_light

I have some trouble with yolo2_light,

in README.md, it says
To compile for CPU just do make on Linux

when I do that it turns out

find . -name "*.sh" -exec chmod +x {} \;
gcc  -Wall -Wfatal-errors -Ofast obj/main.o obj/additionally.o obj/box.o obj/yolov2_forward_network.o -o bin/darknet -lm -pthread 
obj/main.o: In function `test_detector_cpu':
main.c:(.text+0x4e0): undefined reference to `network_predict_quantized'
collect2: error: ld returned 1 exit status
make: *** [bin/darknet] Error 1

I wonder if I should do sth. to Makefile or there're any other solutions?

Memory Leak

Hi, I compiled YOLO on windows and it works well. I am using it for object detection using webcam in real-time.

But, the memory usage by Darknet (YOLO) in Windows slowly keeps on increasing and about after 10 minutes my computer runs out of memory (16 GB RAM). I was wondering if you faced similar issue.

How to make yolo cpp dll thread safe

Hello

I'm using yolo_cpp_dll_no_gpu.dll in a secondary c++ project. If I have one thread using this Dll every thing is OK, but how can I use darknet functions in multiple threads?

I'm using c++ and not much familiar with C.
I tried to make an Interface c++ object, in which I can use the dll in multiple threads but, only with mutexes and lockes, but of course the performance will be compromised.

Thanks.

How to test image?

when initialization with 1 GB model yolo.weights & yolo.cfg

it shows as follows:

Cannot load image "data/labels/aeroplane.png"
STB Reason: can't fopen

problem when i compile darknet

when i compile the darknet.it comes out many errors such as
错误 114 error : this declaration may not have extern "C" linkage C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\limits 78 1 darknet2
in limits iosfwd and type_traits
and something wrong in avgpool_layer

I didn't get any detcted boxes after training new data

I trained new data using "train_yolo" method,
I changed the 'CLASSNUM' in yolo.c and 'classes' in .cfg file
Then changed output in .cfg in [connected] based on this equation (5 * 2 + C) * S * S

after training 600 batches I tested the "yolo_600.weight" file and It didn't detect anything

I used same .cfg file of training for testing..

how many batches I should train until I start get any result?
is there any another steps I should made?
I even put "-thresh 0" and didn't get any box??
there is an article said that I should change CLS_NUM in yolo_kernels.cu as well .. but I didn't see this parameter?

Do you know how to run ssd on windows?

Thank you for your project. It runs good on Windows. I’m working on ssd (Single Shot MultiBox Detector)now. Accuracy rate of ssd is as same as that of faster Rcnn while its speed is as quick as yolo’s. But some problems occur when migrating it to Windows(boost lib problems ). Have you thought about migrating ssd to Window?
This is home page of the ssd project: https://github.com/weiliu89/caffe/tree/ssd
System VOC2007 mAP FPS (Titan X)
Faster R-CNN (VGG16) 73.2 7 7
YOLO 63.4 45
SSD300 (VGG16) 72.1 58
SSD500 (VGG16) 75.1 23

How can I use it without GPU

hello guys,
I know the GPU is very very good at YOLO, but.... I want to know how compiler it without GPU. When I delete GPU in precompiler, it will show a lot of error such as "identifier BLOCK is undefined" and "check_error" is undefined and so on.

OpenCV 3.3 Compile Errors

Using CUDA 8.0 and Visual Studio 2015, OpenCV 3.3.0:

Anyone else having this error when compiling?

cannot open source file 'opencv2/highgui/highgui_c.h'
cannot open source file 'opencv2/imgproc/imgproc_c.h'

I've set the additional directories in the project settings and the linker.

Installation help

I'm sorry, I'm relatively new to Visual Studio and am unsure of what steps I should take to compile. Is there a step by step guide? If not, currently I have CUDA 6.5 x64 installed (as well as 7.5) and OpenCV 2.4.9, and I'm trying to load the yolo-windows-master\build\darknet\darknet.sln with VS 2013, but to no luck.

C:\Users(username)\Downloads\yolo-windows-master (vs2013, Cuda 6.5, Git AlexeyAB)\yolo-windows-master\build\darknet\darknet\darknet.vcxproj : error : Unable to read the project file "darknet.vcxproj".

C:\Users(username)\Downloads\yolo-windows-master (vs2013, Cuda 6.5, Git AlexeyAB)\yolo-windows-master\build\darknet\darknet\darknet.vcxproj(55,5): The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 6.5.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Any help is much appreciated. Thank you for your time.

EDIT: I wanted to add that I've installed YOLO on Ubuntu, so I have a (very vague) idea of how it should work. Main problem with that installation is, I could get my GPU to function within Virtual Box, and because I need web cam real-time detection in my work, I'm trying to install YOLO on windows instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.