Coder Social home page Coder Social logo

952480831 / darknet_box Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wpddmcmc/darknet_box

0.0 0.0 0.0 3.51 MB

To output the bounding box position of darknet

License: Other

Makefile 0.32% Python 0.92% C 90.41% Shell 0.21% Cuda 7.82% C++ 0.32%

darknet_box's Introduction

Darknet_fix


Author: Mingcong Chen

Date: 21/Dec/2018


996.icu

LICENSE

What's changed

Add position output, the position of detection will be saved into an array. Change the source file in include/darknet.h and src/image.c Add a function:

void get_detections(image im, detection *dets, int num, float thresh, char names, image alphabet, int classes,int rect_scalar[][4])
int rect_scalar[][4]
//The first dimension is the index of objects
//The second dimension is:
//rect_scalar[i][0]	left
//rect_scalar[i][1]	right
//rect_scalar[i][2]	top
//rect_scalar[i][3]	bottom
/*
    left           right
      |              |
top-----------------------
      |				 |
      |				 |
      |				 |
      |				 |
bottom--------------------
      |              |
*/

Installation

make

If this works you should see a whole bunch of compiling information fly by:

mkdir -p obj
gcc -I/usr/local/cuda/include/  -Wall -Wfatal-errors  -Ofast....
gcc -I/usr/local/cuda/include/  -Wall -Wfatal-errors  -Ofast....
gcc -I/usr/local/cuda/include/  -Wall -Wfatal-errors  -Ofast....
.....
gcc -I/usr/local/cuda/include/  -Wall -Wfatal-errors  -Ofast -lm....

If you have any errors, try to fix them? If everything seems to have compiled correctly, try running it!

./darknet

You should get the output:

usage: ./darknet <function>

Compiling With CUDA

Darknet on the CPU is fast but it's like 500 times faster on GPU! You'll have to have an Nvidia GPU and you'll have to install CUDA. I won't go into CUDA installation in detail because it is terrifying.

Once you have CUDA installed, change the first line of the Makefile in the base directory to read:

GPU=1

Now you can make the project and CUDA will be enabled. By default it will run the network on the 0th graphics card in your system (if you installed CUDA correctly you can list your graphics cards using nvidia-smi). If you want to change what card Darknet uses you can give it the optional command line flag -i <index>, like:

./darknet -i 1 imagenet test cfg/alexnet.cfg alexnet.weights

If you compiled using CUDA but want to do CPU computation for whatever reason you can use -nogpu to use the CPU instead:

./darknet -nogpu imagenet test cfg/alexnet.cfg alexnet.weights

Enjoy your new, super fast neural networks!

Darknet Logo

Darknet

Darknet is an open source neural network framework written in C and CUDA. It is fast, easy to install, and supports CPU and GPU computation.

For more information see the Darknet project website.

For questions or issues please use the Google Group.

If Bugs?

Connect me by wechat

wechat

darknet_box's People

Contributors

wpddmcmc avatar

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.