Skip to content

A Support Vector Machine classifier that uses Histograms of Oriented Gradients as descriptors.

Notifications You must be signed in to change notification settings

yaremenko8/HOG_SVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HOG_SVM

This is just a simple implementation of a classifier that uses Histogram of Oriented Gradients descriptors. Just wanted to code this myself to get the hang of it.
Labeled training samples that were used for testing can be found here.


hog.py

Contains the descriptor extraction function extract_hog(img), where img is either a path string or an image data array.

svm_train.py

Contains the training function train(gamma_, C_, pool), where gamma_ and C_ are the according SVC parameters and pool is a multiprocessing pool object. The function extracts descriptors of the given dataset: samples_from_class and tests_from_class samples per existing label for training and testing accordingly. Provided image files should be stored in the directory specified by path variable. The directory should also include a comma-seperated values file gt.csv of "file, label" rows sorted in ascending order by label. After extracting descriptors and training an SVC, the function computes and displays the accuracy score achieved by the resulting machine over the testing set. The function then provides the means to save the machine in a separate file.

fit_and_classify.py

Contains the fit_and_classify(machine_file, samples) function, where machine_file is the path to the SVC-machine file used for evaluation and samples is the data set to be evaluated.

gamma_c_grid.txt

Contains the output of a sequence that evaluated train(gamma_, C_, pool) over a logarithmic grid of C and gamma parameters with samples_from_class = 195 and tests_from_class = 25.

About

A Support Vector Machine classifier that uses Histograms of Oriented Gradients as descriptors.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages