dahoc / trainhog Goto Github PK
View Code? Open in Web Editor NEWExample program showing how to train your custom HOG detector using openCV
Example program showing how to train your custom HOG detector using openCV
I have been trying to use your code to train an hog from the images from INIRIA database as you have suggested. For the training set i resized the images to 64x128 as it was required and these images were used to train the svm. i have used about 500 positive images and 700 negative images to train. But it is not identifying humans clearly. The output can be seen in the attachments. I request you to help me figure out what the problem might be. The code is exactly the same as it is in your github folder
I am struggling the last days trying to find way to train svm with my own data. My issue is how to change properly svm kernel. I found in your code svmlight.h with svm parameters. When I am trying to change
learn_parm->kernel_type from LInear to RBF I am getting errors (core dumped).
trainHOG add support for openCV internal "CvSVM" SVM, if it is possible to train CvSVM with the required training mode and options
The first value (Index 0) of the vector being generated in function getSingleDetectingVector()
being always 0 due to the way SVMlight handles indices, as well as the last value (Index 3780) being overwritten by -b. An indexshift does not fix this issue because the positions/indices of the detecting vector components do matter for HOG.
If anyone intersted there is an example of using linear svm + hog descriptor in opencv, but opencv uses libsvm and using liblinear will be faster.
Can you provide code for libsvm interface?
http://opencv.willowgarage.com/wiki/trainHOG
If you are planning in training with LIBSVM instead of SVMlight, pass me a note so I can provide you with some code.
Hello,
i really appreciate your training program. I want to use the generated classifier with my custom python detector. How can i import the file?
For example the import of the DefaultPeopleDetector looks as follows:
# initialize the HOG descriptor/person detector
hog = cv2.HOGDescriptor()
hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector())
What do i have to change to import the custom file?
Best regards
For those who is trying to compile under Windows using MinGW (I have Windows 10 64bit):
make compile.bat file in trainHOG folder and put next:
@echo off
set opencv_incdir=C:/OpenCV/OpenCV32/build/include
set svmlight_srcdir=C:/Projects/tests/svm_light
pkg-config opencv --cflags --libs >tmp.txt
set /p pkg-info= <tmp.txt
del tmp.txt
rem echo %pkg-info%
g++ main.cpp -c -g -MMD -MP -I %opencv_incdir% -I %svmlight_srcdir%
gcc %svmlight_srcdir%/svm_learn.c -c -g
gcc %svmlight_srcdir%/svm_hideo.c -c -g
gcc %svmlight_srcdir%/svm_common.c -c -g
g++ -o trainhog.exe main.o svm_learn.o svm_hideo.o svm_common.o -Wall %pkg-info%
Change opencv_incdir, svmlight_srcdir to your correct pathes
What should I do when my images are 64x64 instead of 64x128? Is changing this line hog.winSize = Size(64, 128); to hog.winSize = Size(64, 64); enough?
How can i use this (which focuses on person detection) to train SVM for objects of my own interest? Is it enough to populate the pos and neg directories with objects of my interest and change the window size (hog.winSize = Size(64, 128))?
I see this -> https://github.com/DaHoC/trainHOG/wiki/trainHOG-Tutorial#the-boring-legal-stuff
What license is the code here under?
hi, i have run all the linux shell commands but don't know what to do next to see the output. kindly help
http://softgladiator.com/computer-vision/how-to-train-your-own-hog-detector/#comment-21
Hi,
I am working on a project of car detection and my advisor and I chose the hog + svm method to do this task. In order to do that, I have downloaded your code from here
and tried to implement on VS12 but It is giving some errors at ambiguous symbols and others.
Here is a look at the errors that I am getting from it
โ โ
I really appreciate if you could help at this task.
Sincerely,
How do I test the classifier once it has been compiled as per the steps mentioned in the tutorial?
SVMLight::SVMLightImpl::getInstance()->getSingleDetectingVector(descriptorVector, descriptorVectorIndices);
main.cpp:354: error: 'descriptorVector' declared as reference but not initialized
why descriptor vector is not initialized?
I managed to compile this software with a nice set of positive and negative images, but when I run it, it opens the video file, runs it through at around x2 speed, which is fine, but there's no detection to speak of.
Does this code include some "Draw circles around the detected faces" code or do I have to implement that separately?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.