All Projects → LiuXiaolong19920720 → Simple_net

LiuXiaolong19920720 / Simple_net

Licence: mit
A simple deep neural network implemented in C++,based with OpenCV Mat matrix class

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Simple net

Opticalflow visualization
Python optical flow visualization following Baker et al. (ICCV 2007) as used by the MPI-Sintel challenge
Stars: ✭ 183 (-9.41%)
Mutual labels:  opencv
Node Digital Watermarking
A digital watermark is a kind of marker covertly embedded in a noise-tolerant signal such as an audio, video or image data. It is typically used to identify ownership of the copyright of such signal. "Watermarking" is the process of hiding digital information in a carrier signal; the hidden information should, but does not need to, contain a relation to the carrier signal. Digital watermarks may be used to verify the authenticity or integrity of the carrier signal or to show the identity of its owners. It is prominently used for tracing copyright infringements and for banknote authentication.
Stars: ✭ 193 (-4.46%)
Mutual labels:  opencv
End To End For Chinese Plate Recognition
基于u-net,cv2以及cnn的中文车牌定位,矫正和端到端识别软件,其中unet和cv2用于车牌定位和矫正,cnn进行车牌识别,unet和cnn都是基于tensorflow的keras实现
Stars: ✭ 197 (-2.48%)
Mutual labels:  opencv
Omrchecker
Grade exams fast and accurately using a scanner 🖨 or your phone 🤳.
Stars: ✭ 189 (-6.44%)
Mutual labels:  opencv
Facerecognition
Webcam face recognition using tensorflow and opencv
Stars: ✭ 192 (-4.95%)
Mutual labels:  opencv
Php Opencv
php wrapper for opencv
Stars: ✭ 194 (-3.96%)
Mutual labels:  opencv
Webcamera
Camera controls for the Web
Stars: ✭ 182 (-9.9%)
Mutual labels:  opencv
Human Pose Estimation Opencv
Perform Human Pose Estimation in OpenCV Using OpenPose MobileNet
Stars: ✭ 201 (-0.5%)
Mutual labels:  opencv
Pytorch Cpp
PyTorch C++ inference with LibTorch
Stars: ✭ 194 (-3.96%)
Mutual labels:  opencv
Acurustrack
A multi-object tracking component. Works in the conditions where identification and classical object trackers don't (e.g. shaky/unstable camera footage, occlusions, motion blur, covered faces, etc.). Works on any object despite their nature.
Stars: ✭ 196 (-2.97%)
Mutual labels:  opencv
Live Video Magnification
An OpenCV/Qt based realtime application for Eulerian Video Magnification / Motion Magnification. Works with multiple videos and cameras at the same time and let's you export the magnified videos.
Stars: ✭ 187 (-7.43%)
Mutual labels:  opencv
Opencv Practical Exercise
OpenCV practical exercise
Stars: ✭ 191 (-5.45%)
Mutual labels:  opencv
Perfectshow
Android virtual makeup app, apply cosmetics on human face.
Stars: ✭ 194 (-3.96%)
Mutual labels:  opencv
Opencv Course
Learn OpenCV in 4 Hours - Code used in my Python and OpenCV course on freeCodeCamp.
Stars: ✭ 185 (-8.42%)
Mutual labels:  opencv
Marvel
Marvel - Face Recognition With Android & OpenCV
Stars: ✭ 199 (-1.49%)
Mutual labels:  opencv
Opencv Python Tutorial
📖 OpenCV-Python image processing tutorial for beginners
Stars: ✭ 2,425 (+1100.5%)
Mutual labels:  opencv
Person Detection And Tracking
A tensorflow implementation with SSD model for person detection and Kalman Filtering combined for tracking
Stars: ✭ 193 (-4.46%)
Mutual labels:  opencv
Seam Carving
Seam Carving for Content Aware Image Resizing
Stars: ✭ 202 (+0%)
Mutual labels:  opencv
Traffic Signal Violation Detection System
A Computer Vision based Traffic Signal Violation Detection System from video footage using YOLOv3 & Tkinter. (GUI Included)
Stars: ✭ 200 (-0.99%)
Mutual labels:  opencv
Facerec Python
个人毕业设计 - 基于树莓派、OpenCV及Python语言的人脸识别
Stars: ✭ 195 (-3.47%)
Mutual labels:  opencv

Simple Net

Simple net is a simple deep neural network implemented in C++,based with OpenCV Mat matrix class


Examples

You can initialize a neural network just like bellow:

	//Set neuron number of every layer
	vector<int> layer_neuron_num = { 784,100,10 };

	// Initialise Net and weights
	Net net;
	net.initNet(layer_neuron_num);
	net.initWeights(0, 0., 0.01);
	net.initBias(Scalar(0.5));

It is very easy to train:

#include"../include/Net.h"
//<opencv2\opencv.hpp>

using namespace std;
using namespace cv;
using namespace liu;

int main(int argc, char *argv[])
{
	//Set neuron number of every layer
	vector<int> layer_neuron_num = { 784,100,10 };

	// Initialise Net and weights
	Net net;
	net.initNet(layer_neuron_num);
	net.initWeights(0, 0., 0.01);
	net.initBias(Scalar(0.5));

	//Get test samples and test samples 
	Mat input, label, test_input, test_label;
	int sample_number = 800;
	get_input_label("data/input_label_1000.xml", input, label, sample_number);
	get_input_label("data/input_label_1000.xml", test_input, test_label, 200, 800);

	//Set loss threshold,learning rate and activation function
	float loss_threshold = 0.5;
	net.learning_rate = 0.3;
	net.output_interval = 2;
	net.activation_function = "sigmoid";

	//Train,and draw the loss curve(cause the last parameter is ture) and test the trained net
	net.train(input, label, loss_threshold, true);
	net.test(test_input, test_label);

	//Save the model
	net.save("models/model_sigmoid_800_200.xml");

	getchar();
	return 0;
}

It is easier to load a trained net and use:

#include"../include/Net.h"
//<opencv2\opencv.hpp>

using namespace std;
using namespace cv;
using namespace liu;

int main(int argc, char *argv[])
{
	//Get test samples and the label is 0--1
	Mat test_input, test_label;
	int sample_number = 200;
	int start_position = 800;
	get_input_label("data/input_label_1000.xml", test_input, test_label, sample_number, start_position);

	//Load the trained net and test.
	Net net;
	net.load("models/model_sigmoid_800_200.xml");
	net.test(test_input, test_label);

	getchar();
	return 0;
}
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].