Coder Social home page Coder Social logo

baucheng / hog-pedestrian-detector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from josemarcosrf/hog-pedestrian-detector

0.0 0.0 0.0 1004 KB

MATLAB implementation of a basic HOG + SVM pedestrian detector.

License: GNU General Public License v3.0

Python 3.91% PHP 6.11% MATLAB 77.75% CSS 1.47% HTML 0.72% Smarty 10.04%

hog-pedestrian-detector's Introduction

HOG-Pedestrian-Detector

CRAN FOSSA Status stars forks

This repository contains the code for a MATLAB implementation of a basic HOG + SVM pedestrian detector form my Computer Science Master thesis

Disclaimer

If you are going to use this code, please read the LICENCE and keep in mind that I PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND.

I partially adapted this code-base to newer versions of MATLAB but is very likely you find discrepancies in how some MATLAB functions work. I am in general happy to help understanding the project if you ask nicely but since the implementation of the project is now several years old and MATLAB has evolved, some functions might behave differently and I won't be updating the project continuously nor answering about how to update the code to newer MATLAB versions.

Requirements

  • MATLAB >= R2017b
  • libsvm >= 3.22

Installation

Please refer to MATLAB and libsvm documentation to install.

Data

Run

The project was developed on a Windows machine and now being resurrected on a Linux one, so you should be good in any platform as long as you can run MATLAB.

Setting the environment

  1. Add the libs directory and all sub-directories to MATLABs path. Either through the command window or through the GUI.

  2. Make sure libsvm is visible to MATLAB. If you are not sure if your installation of libsvm went alright, you can check with:

which -all svmtrain

Which should show something like:

~/HOG-Pedestrian-Detector/libs/libsvm-3.22/matlab/svmtrain.mexa64
/usr/local/MATLAB/R2017b/toolbox/stats/stats/svmtrain.m                 % Shadowed

There are several entry points to the project, but here the two main ones are shown:

Train

Assuming there's a models directory where trained models will be saved and that the positive and negative images can be found in dataset/Test/pos and dataset/Test/neg respectively. Train an SVM model named test

model = train_svm("test", ["./models", "dataset/Train/pos" "dataset/Train/neg"]);

Eval

To evaluate the just trained model:

test_svm(model.test, ["dataset/Test/pos" "dataset/Test/neg"]);

Note test_svm expects model.<model-given-name-to-train-function>...

PCA versions of train / test

[model, Ureduce] = train_svm_PCA("test_pca", ["./models", "dataset/Train/pos" "dataset/Train/neg"]);
test_svm_PCA(model.test_pca, Ureduce, ["dataset/Test/pos", "dataset/Test/neg"]);

Known issues & contributions

Old MATLAB version used to concatenate strings by enclosing them between squared brackets but doesn't look like valid any longer. In that case you should use the strcat function. For example when constructing paths, so:

path = ['folder', 'filename', '.extension']  % this is wrong!
path = strcat('folder', 'filename', '.extension')  % this is right!

If you enjoyed this repository and find things that are not working any longer, you are very welcome to open a PR with fixes and I'll happily introduce them.

License

FOSSA Status

hog-pedestrian-detector's People

Contributors

josemarcosrf avatar fossabot 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.