All Projects → schwittlick → Ofxdarknet

schwittlick / Ofxdarknet

Licence: mit
darknet neural network addon for openFrameworks

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Ofxdarknet

Bipropagation
Stars: ✭ 41 (-91.68%)
Mutual labels:  neural-networks, machine-learning-algorithms
Mlalgorithms
Minimal and clean examples of machine learning algorithms implementations
Stars: ✭ 8,733 (+1671.4%)
Mutual labels:  neural-networks, machine-learning-algorithms
Daily Neural Network Practice 2
Daily Dose of Neural Network that Everyone Needs
Stars: ✭ 18 (-96.35%)
Mutual labels:  neural-networks, machine-learning-algorithms
Machine Learning Articles
Monthly Series - Top 10 Machine Learning Articles
Stars: ✭ 516 (+4.67%)
Mutual labels:  neural-networks, machine-learning-algorithms
Igel
a delightful machine learning tool that allows you to train, test, and use models without writing code
Stars: ✭ 2,956 (+499.59%)
Mutual labels:  neural-networks, machine-learning-algorithms
Machine Learning Notebooks
Machine Learning notebooks for refreshing concepts.
Stars: ✭ 222 (-54.97%)
Mutual labels:  neural-networks, machine-learning-algorithms
Machine Learning From Scratch
Succinct Machine Learning algorithm implementations from scratch in Python, solving real-world problems (Notebooks and Book). Examples of Logistic Regression, Linear Regression, Decision Trees, K-means clustering, Sentiment Analysis, Recommender Systems, Neural Networks and Reinforcement Learning.
Stars: ✭ 42 (-91.48%)
Mutual labels:  neural-networks, machine-learning-algorithms
Machine learning basics
Plain python implementations of basic machine learning algorithms
Stars: ✭ 3,557 (+621.5%)
Mutual labels:  neural-networks, machine-learning-algorithms
Echotorch
A Python toolkit for Reservoir Computing and Echo State Network experimentation based on pyTorch. EchoTorch is the only Python module available to easily create Deep Reservoir Computing models.
Stars: ✭ 231 (-53.14%)
Mutual labels:  neural-networks, machine-learning-algorithms
Color Accessibility Neural Network Deeplearnjs
🍃 Using a Neural Network to improve web accessibility in JavaScript.
Stars: ✭ 230 (-53.35%)
Mutual labels:  neural-networks, machine-learning-algorithms
Netket
Machine learning algorithms for many-body quantum systems
Stars: ✭ 256 (-48.07%)
Mutual labels:  neural-networks, machine-learning-algorithms
Learn Data Science For Free
This repositary is a combination of different resources lying scattered all over the internet. The reason for making such an repositary is to combine all the valuable resources in a sequential manner, so that it helps every beginners who are in a search of free and structured learning resource for Data Science. For Constant Updates Follow me in …
Stars: ✭ 4,757 (+864.91%)
Mutual labels:  neural-networks, machine-learning-algorithms
Deep Metric Learning Baselines
PyTorch Implementation for Deep Metric Learning Pipelines
Stars: ✭ 442 (-10.34%)
Mutual labels:  neural-networks
Beholder
A TensorBoard plugin for visualizing arbitrary tensors in a video as your network trains.
Stars: ✭ 472 (-4.26%)
Mutual labels:  neural-networks
Pytorch Flows
PyTorch implementations of algorithms for density estimation
Stars: ✭ 439 (-10.95%)
Mutual labels:  neural-networks
Geneticalgorithmpython
Source code of PyGAD, a Python 3 library for building the genetic algorithm and training machine learning algorithms (Keras & PyTorch).
Stars: ✭ 435 (-11.76%)
Mutual labels:  neural-networks
Diffeqflux.jl
Universal neural differential equations with O(1) backprop, GPUs, and stiff+non-stiff DE solvers, demonstrating scientific machine learning (SciML) and physics-informed machine learning methods
Stars: ✭ 473 (-4.06%)
Mutual labels:  neural-networks
Seq2seqchatbots
A wrapper around tensor2tensor to flexibly train, interact, and generate data for neural chatbots.
Stars: ✭ 466 (-5.48%)
Mutual labels:  neural-networks
Ruby Fann
Ruby library for interfacing with FANN (Fast Artificial Neural Network)
Stars: ✭ 425 (-13.79%)
Mutual labels:  neural-networks
Deepxde
Deep learning library for solving differential equations and more
Stars: ✭ 420 (-14.81%)
Mutual labels:  neural-networks

ofxDarknet

ofxDarknet is a openFrameworks wrapper for 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. http://pjreddie.com/darknet/

Features

YOLO: Real-Time Object Detection (http://pjreddie.com/darknet/yolo/)

Darknet comes with two pre-trained models for this task. Additionally each has a smaller (and faster) but therefore less accurate version:

MS COCO dataset (80 different classes)

	std::string cfgfile = ofToDataPath( "cfg/tiny-yolo.cfg" );
	std::string weightfile = ofToDataPath( "tiny-yolo.weights" );
	std::string nameslist = ofToDataPath( "cfg/names.list" );
	darknet.init( cfgfile, weightfile, nameslist );

Pascal VOC dataset (20 different classes)

	std::string cfgfile = ofToDataPath( "cfg/tiny-yolo-voc.cfg" );
	std::string weightfile = ofToDataPath( "tiny-yolo-voc.weights" );
	std::string nameslist = ofToDataPath( "cfg/voc.names" );
	darknet.init( cfgfile, weightfile, nameslist );

YOLO2 with 9000 classes

	std::string datacfg = ofToDataPath( "cfg/combine9k.data" );
	std::string cfgfile = ofToDataPath( "cfg/yolo9000.cfg" );
	std::string weightfile = ofToDataPath( "yolo9000.weights" );
	darknet.init( cfgfile, weightfile, datacfg );
	float thresh = 0.25;
	std::vector< detected_object > detections = darknet.yolo( image.getPixelsRef(), thresh );

	for( detected_object d : detections )
	{
		ofSetColor( d.color );
		glLineWidth( ofMap( d.probability, 0, 1, 0, 8 ) );
		ofNoFill();
		ofDrawRectangle( d.rect );
		ofDrawBitmapStringHighlight( d.label + ": " + ofToString(d.probability), d.rect.x, d.rect.y + 20 );
	}

YOLO2

Imagenet Classification (http://pjreddie.com/darknet/imagenet/)

In order to classify an image with more classes, this is the spot. This classifies an image according to the 1000-class ImageNet Challenge.

	std::string cfgfile = ofToDataPath( "cfg/darknet.cfg" );
	std::string weightfile = ofToDataPath( "darknet.weights" );
	std::string nameslist = ofToDataPath( "cfg/imagenet.shortnames.list" );
	darknet.init( cfgfile, weightfile, nameslist );

	classifications = darknet.classify( image.getPixelsRef() );
	int offset = 20;
	for( classification c : classifications )
	{
		std::stringstream ss;
		ss << c.label << " : " << ofToString( c.probability );
		ofDrawBitmapStringHighlight( ss.str(), 20, offset );
		offset += 20;
	}

Classification

Deep Dream (http://pjreddie.com/darknet/nightmare/)

vgg-conv.cfg & vgg-conv.weights

	std::string cfgfile = ofToDataPath( "cfg/vgg-conv.cfg" );
	std::string weightfile = ofToDataPath( "vgg-conv.weights" );
	darknet.init( cfgfile, weightfile );
	
	int max_layer = 13;
	int range = 3;
	int norm = 1;
	int rounds = 4;
	int iters = 20;
	int octaves = 4;
	float rate = 0.01;
	float thresh = 1.0;
	nightmare = darknet.nightmate( image.getPixelsRef(), max_layer, range, norm, rounds, iters, octaves, rate, thresh );

DeepDream

Recurrent Neural Network (http://pjreddie.com/darknet/rnns-in-darknet/)

Darknet pre-trained weights files:

ofxDarknet custom pre-trained weight files (each trained for 20h on NVidia TitanX):

  • Anonymous - Hypersphere Hypersphere, written by Anonymous with the help of the 4chan board /lit/ (of The Legacy of Totalitarianism in a Tundra fame) is an epic tale spanning over 700 pages. A postmodern collaborative writing effort containing Slavoj Žižek erotica, top secret Donald Trump emails, poetry, repair instructions for future cars, a history of bottles in the Ottoman empire; actually, it contains everything since it takes place in the Hypersphere, and the Hypersphere is a big place; really big in fact.
  • Books on art history & aesthetics
  • Books on digital culture
	std::string cfgfile = ofToDataPath( "cfg/rnn.cfg" );
	std::string weightfile = ofToDataPath( "shakespeare.weights" );
	darknet.init( cfgfile, weightfile );

	int character_count = 100;
	float temperature = 0.8;
	std::string seed_text = "openframeworks is ";
	std::string generated_text = darknet.rnn( character_count, seed_text, temperature );

RNN

You can train your own RNN models with darknet

	// no need to init
	darknet.train_rnn( ofToDataPath( "training_text.txt" ), "cfg/rnn.cfg" );

Go

Darknet has a policy network for Go. Read the original doc here.

In the example example-go is a 2-player game where darknet gives recommendations. To play, click on the square you wish to move a piece onto. More doc on this soon.

Go

Setup

Windows

Install the dependencies for building darknet on Windows 10:

There are some more necessary steps that don't work with the OF project generator:

  • Compile as Debug or Release in x64 mode
  • Within VS2015 Solution Explorer, rightclick on the generated project -> Build Dependencies -> Build Customizations -> Tick CUDA 8.0
  • Copy pthreadVC2.dll from ofxDarknet\libs\3rdparty\dll\x64 to your applications bin folder

OSX

First make sure to install CUDA 8.0 64bit (Driver & Toolkit). CUDA requires an NVIDIA graphics card and a reasonably recent Mac OS.

After that, projects should compile fine from the Project Generator. Make sure to download the necessary weights (links can be found here and include the required cfg files (found in the examples) in any app that opens them.

Building the library from source

If you want to make changes to the darknet lib, you can build it from source with cmake. cd into libs/darknet/cMake/ and then run:

cmake .
make

Note, you need to have CUDA and OpenCV installed on your system first.

Training your own models

YOLO

tcb

Credits

Reading

  • tutorial on training YoloV2 to detect custom objects
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].