forked from pdollar/toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modifications for BAdaCost multi-view detection.
- Loading branch information
Showing
41 changed files
with
3,266 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
http://vision.ucsd.edu/~pdollar/toolbox/doc/ | ||
# Multi-class object detection with BAdaCost. | ||
|
||
This repo has a modified version of [Piotr Dollar toolbox](http://vision.ucsd.edu/~pdollar/toolbox/doc/) (Matlab and C++ code) to replicate the experiments we made for our Cost-Sensitive Multiclass algorithm paper. If you use this code for your own researh, **you must reference our journal paper**: | ||
|
||
**BAdaCost: Multi-class Boosting with Costs.** | ||
Antonio Fernández-Baldera, José M. Buenaposada, and Luis Baumela. | ||
Pattern Recognition, Elsevier. In press, 2018. | ||
[DOI:10.1016/j.patcog.2018.02.022](https://doi.org/10.1016/j.patcog.2018.02.022) | ||
|
||
|
||
# Replicate paper experiments or simply use our trained classifiers. | ||
|
||
Our modifications to P.Dollar toolbox have only been tested on GNU/Linux Matlab. To replicate paper experiments you have to: | ||
|
||
* Clone this repo | ||
* Execute toolboxCompile | ||
* Clone the [multi-view car detection scripts repo](https://github.com/jmbuena/toolbox.badacost.kitti.public) and follow instructions there. | ||
* Clone the [multi-view face detection scripts repo](https://github.com/jmbuena/toolbox.badacost.faces.public) and follow instructions there. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
function predicted = badacostApply(X, classfr) | ||
% Apply learned badacost weak learners ensemble | ||
% | ||
% USAGE | ||
% hs = badacostApply( X, model, [maxDepth], [minWeight], [nThreads] ) | ||
% | ||
% INPUTS | ||
% X - [FXN] N num vectors to classfy, F num feature vectors | ||
% model - learned boosted tree classifier | ||
% | ||
% OUTPUTS | ||
% predicted - [Nx1] predicted output labels | ||
% | ||
% EXAMPLE | ||
% | ||
% See also badacostTrain | ||
% | ||
% Author: Antonio Baldera, modified by Jose M. Buenaposada | ||
|
||
n = size(X,2); | ||
margin_vec = zeros(classfr.num_classes, n); | ||
|
||
for i=1:length(classfr.WEAK_LEARNERS) | ||
% z is a row vector with the labels | ||
z = classfr.classify_weak_learner(classfr.WEAK_LEARNERS{i}, X); | ||
|
||
for j=1:n | ||
margin_vec(:,j) = margin_vec(:,j) + (classfr.WEIGHTS(i).*classfr.Y(:, z(j))); | ||
end | ||
end; | ||
|
||
% WARNING: Change to accomodate with theory (2016/11) | ||
%[~, predicted] = min(classfr.Cprime' * margin_vec); | ||
[~, predicted] = min(classfr.Cprime * margin_vec); | ||
predicted = predicted(:); | ||
|
||
end |
Oops, something went wrong.