Documentation: https://pdollar.github.io/toolbox/
pdollar / toolbox Goto Github PK
View Code? Open in Web Editor NEWPiotr's Image & Video Matlab Toolbox
Piotr's Image & Video Matlab Toolbox
Documentation: https://pdollar.github.io/toolbox/
Dear Piotr Dollar,
Hi,..I am a new comer and new in term of study about piotr toolbox. this is the first step to support my research. I already running the toolbox with human detection (pedestrian). Just for train and test using InriaPerson database. its okay. But I got failed when I used the object to detect some apples, running with acfDemoInria.m. Please help me to know which part of the toolbox must be changes or improves.
I tried to change a part of file nms.m in matlab but cannot exatly detect.
thank you for your enlightenment.
regards,
Nancy
Hi! This toolbox looks cool.
I'd like to know more about it.
Unfortunately, the link in the README.md file is broken:
http://vision.ucsd.edu/~pdollar/toolbox/doc/
Where can I get the info about this toolbox?
Hello,
I want to change the detection threshold of ACF Detector in order to generate object proposals.
How can I do it?
Thanks.
how to calcatue the value lamda ? the value is hard to choose,and have you test the DPM method?
the value const lamda value is fit for all scenes?
looking fordward to your reply!
toolboxCompile fails for certain files. It cannot successfully compile due to this error:
Building with 'Xcode Clang++'.
-> COMPILE FAILURE: 'gradientMex.cpp' /Users//Library/Application Support/MathWorks/MATLAB Add-Ons/Collections/pdollar_toolbox/pdollar-toolbox-e873326/channels/private/gradientMex.cpp:329:20: error: no matching function for call to 'mxSetDimensions_730'
mxSetData(M,*I); mxSetDimensions(M,dims,3); return M;
^~~~~~~~~~~~~~~
/Applications/MATLAB_R2019a.app/extern/include/matrix.h:248:25: note: expanded from macro 'mxSetDimensions'
#define mxSetDimensions mxSetDimensions_730
^~~~~~~~~~~~~~~~~~~
/Applications/MATLAB_R2019a.app/extern/include/matrix.h:1234:1: note: candidate function not viable: no known conversion from 'const int [3]' to 'const mwSize *' (aka 'const unsigned long *') for 2nd argument
mxSetDimensions(mxArray *pa, const mwSize *pdims, mwSize ndims);
^
/Applications/MATLAB_R2019a.app/extern/include/matrix.h:248:25: note: expanded from macro 'mxSetDimensions'
#define mxSetDimensions mxSetDimensions_730
^
/Users//Library/Application Support/MathWorks/MATLAB Add-Ons/Collections/pdollar_toolbox/pdollar-toolbox-e873326/channels/private/gradientMex.cpp:339:50: error: assigning to 'const int *' from incompatible type 'const mwSize *' (aka 'const unsigned long *')
nDims = mxGetNumberOfDimensions(pr[0]); dims = mxGetDimensions(pr[0]);
^~~~~~~~~~~~~~~~~~~~~~
/Applications/MATLAB_R2019a.app/extern/include/matrix.h:244:25: note: expanded from macro 'mxGetDimensions'
#define mxGetDimensions mxGetDimensions_730
Hi :)
please help me to use acfTest function. i didnt find an example to understand how inputs should be.
i dont know the structure of ground truth directory...
Hi,
In acfTrain.m the classifier for the previous stage is rewritten by the classifier for the current stage.
detector.clf = adaBoostTrain(X0,X1,detector.opts.pBoost)
Are there any variables that are updated through the stages ? Or simply something that I'm missing ?
Thanks
hello
I have downloaded the toolbox and installed using toolboxCompile.m in
C:\Users\Adnan\Downloads\piotr_toolbox\toolbox\external
But when i run the Edge Box code from
C:\Users\Adnan\Downloads\edges-master\edges-master
It gives me an error of files which are in the toolbox.
Is it not installed? I have followed the same instructions
Hi every body...
i have trained a model for license plate detection using a set of frontal images
where the plates are in acceptable conditions.
But now i want to test the model on plates with various types of skewness and rotation and sizes. taken with cameras form with different views and different zoom levels.
My idea was to transform my own current data to produce images similar to my test data. but it does not work for images with different zooms.
The problem is that the detected bounding boxes are small for many of the plates.
I am using ACFDetector toolbox version 3.50 on Matlab R2016a Windows 8.1;
objects are plates (cars in road , ground truth is of the size of plates and with padding car and road is in it too)
feature selection : Luv color, Gradient magnitude, Gradiant Histogram. (in one model I use Hog too)
thank you so much....
Hi, Piotr, I found that:
you run this script, the code will crash at the gradientMex.mexw64 LDu+000029.
May some big image will crash!!!!!!!!! because this problem.
I= imread('peppers.png');
sz1=[4083 6146];
I = imresize(I,sz1);
I=rgbConvert(I,'luv');
I1=I;
[M,O]=gradientMag(I1,0,5,0.0050,0);
H=gradientHist(M,O,2,6,1,0,0.2,0);
Trying to use this library with this circulant tracker code (http://www.robots.ox.ac.uk/~joao/circulant/) but anytime I try to run 'run_tracker' I get an error that says 'Undefined function 'gradientMex' for input arguments of type 'single'.' Can anyone help me?
I'm running MATLABR2017a on a mac running Sierra.
Thanks
When I perform the test, how do I modify the parameters to reach 16.9% of MR, or do I need to modify some parameter training before testing?
When I want to redo the Pedestrian Detection experiment with the ACF detector,I got failed in the "vbb" and "dbInfo" functions in the demo script. I can not find the functions. Please help me to solve the issues. Thanks.
Hi, in C code, people are using xml to load trained model. The original model is trained in Matlab. How is it converted to xml?
Thanks a lot.
what is the write format about create seq video file by seqIo.m ?
the comment did not described clearly about how to obtain a seq video with kind of code format example.
i need to make my own data to test the code, really need help.
Hi,
When I run edgesEvalImg.m, there's an error that we cannot use {} to index.
So how to debug it?
Thanks for your patience and reply.
Error using imPadMex
Requested 137438953888x512x7598263500303858035 (17179869184.0GB) array exceeds maximum array size
preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become
unresponsive. See array size limit or preference panel for more information.
Error in imPad (line 39)
J = imPadMex( I, pad, type );
Error in edgesDetect (line 52)
I = imPad(I,p,'symmetric');
Error in edgesDemo (line 25)
tic, E=edgesDetect(I,model); toc
Piotr,
I have downloaded your very useful toolbox and after successfully applying the detector I examined the code, thinking of porting it to fully c++.
After adding some new-lines to gradHist() in CalcGradient.cpp, so I can read and hopefully also understand the code, I realized the following is used with a potential bug:
GH(H,ma,mb) H1=H; STRu(*H1,ADD(LDu(*H1),MUL(ma,mb)));
where STRu stores 4 values, although only 2 are really needed. one may argue no harm is done since the upper 2 values are not altered. However, it may occur that the code will try to update at the very end of the allocated memory, and thus will experience an exception when the two excessive values are out of the allowed address range, if the memory chunk is not committed.
I suggests using:
GH(H,ma,mb) H1_64=(__m64*)(H); H1=H; STRlow(*H1_64,ADD(LDu(*H1),MUL(ma,mb)));
with:
RETf STRlow( __m64 &x, const __m128 y ) { _mm_storel_pi(&x,y); return y; }
Best Regards,
Shmulik
Hi Piotr,
I trained an ACF face detector:
https://drive.google.com/file/d/0Bz-0GvSNbG8BLTFGOWNBcGJwX3M/view?usp=sharing
but it crashed at feature computation when the image is too big, here is an example image:
The error I got from matlab is:
*** glibc detected *** /usr/lib/matlab-8.3/bin/glnxa64/MATLAB: munmap_chunk(): invalid pointer: 0x00007f027b2483ca ***
When I down-sampled the big image, it worked fine. So I guess there is something wrong with memory allocation. Do you have any clue about this problem? Your help would be greatly appreciated!
Best regards,
Shanshan
The following command doesn't work.
addpath(genpath('path/to/toolbox/')); savepath;
toolboxCompile;
Are there alternative ways of making the toolbox work or installing it?
Hello,
In the article from 4Nov 2014, Local Decorrelation for Improved Pedestrian Detection, the LDCF should be implemented.
As the acfdetect doc said, there should have a flag for using LDCF.
Where can I set the flag for using LDCFinstead of ACF in piotr toolbox ?
Thanks.
The comments say that the output of adaBoostApply hs is a log ratio (.5_log(p/(1-p)), so I can derive the probability as p = exp(2_hs)/(1+exp(2*hs))
But when I calculate p in this way, the output is kind of weird, so I doubt whether it is correct?
If using python, is there a corresponding version?
I'm using your Computer Vision Matlab Toolbox v1.03 for 'Cuboids code'. In the line 60 of the file '\toolbox\images\nonmaxsupr.m' , you use a function 'rnlfilt_max'. But I can not fine the definition in your toolbox. I wonder if is there anything wrong?
Hi,
We just noticed that in line 195 of file toolbox/channels/chnsPyramid.m :
d0 should be d1, it seems a copy-paste mistake.
Name conflict with the original.
Matlab's pdist2 supports returning matched indices as well. [D, I] = pdist2(...)
edit: If anyone ends up renaming/removing that file from the toolbox, recompute matlab toolbox cache to avoid the "previously accessible file is inaccessible" error:
>> rehash toolboxcache
toolbox/channels/private/gradientMex.cpp
Line 86 in 93685c8
I am getting the error:
`
Error using cat
Dimensions of matrices being concatenated are not consistent.
Error in acfTrain>sampleWins (line 259)
Error in acfTrain (line 136)
Error in TrainAPI (line 29)
Dimension of matrices being concatenated are not consistent.
`
I thought at first that perhaps I was not properly specifying the dimensions of the model but after fixing that, I'm still getting this error. I could still be doing something though.
I've found the ACF detection module in this toolbox to be incredibly useful for fast object detection on mobile platforms. Thanks! I've posted an initial (i.e., alpha) stand alone C++ library (no Matlab required) to run ACF object detection models trained with this toolbox here.
https://github.com/elucideye/acf
This may be useful for other toolbox users needing to run outside of Matlab. I'm assuming this port is better suited to a separate repo, but I'd be happy to push any of this upstream in the future. It has worked well for the configurations I've needed, but I'm sure there are some valid ACF parameter combinations that may require additional work. The API will likely be modified over the next month or so, but it should be functional enough.
*.mat
models using a fork of cvmatioLUV
+ NORM(MAG(GRAD))
+ HOG(012345)
).TODO:
Hi :)
i have a dataset of 100,000 images and wanna train an acf object detector model.
when i used the trainACFObjectDetector() function, the memory usage of my pc, worked 100% and finally i got out of memory error. it works by just 100 images, no more ...
The RAM size of my pc is 64G.
please help me
resample output has wild big value in some case, due to use uninitialized variable in imresamplemex.cpp:
for(; y<hn; y++) { B0[ybs[y]] += C[yas[y]] * ywts[y];
should initialize B0 before use:
for(int i = 0; i < hb; i++) B0[i] = 0;
thanks for your work.
but I am quite confused why your toolbox output just single *det.txt
as detection result for Caltech dataset and your evaluation code in Code3 needs much set*/v*.txt
to draw ROCs ?
I find such conflict very hard to solve. Is there any details I have missed? Is there exist specific line of code to be set to solve it ?
Is there someone use this tool in octave ?
hi, piotr
I want to detect pedestrain with the traditional haar features. Could you tell me is there something about haar-like feature extraction in this toolbox. thanks!
Best regards,
xiao yu
Here looks like a bug in header file: wrappers.hpp
If you disable "MATLAB_MEX_FILE", when building imResamplexxx.cpp, which requires the header file "wrappers.hpp", there is an error:
wrappers.hpp:12:24: error: ‘wrCalloc’ declared as an ‘inline’ variable
inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); }
^
wrappers.hpp:12:24: error: ‘size_t’ was not declared in this scope
wrappers.hpp:12:36: error: ‘size_t’ was not declared in this scope
inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); }
^
wrappers.hpp:12:48: error: expression list treated as compound expression in initializer [-fpermissive]
inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); }
^
wrappers.hpp:12:50: error: expected ‘,’ or ‘;’ before ‘{’ token
inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); }
^
wrappers.hpp:13:24: error: ‘wrMalloc’ declared as an ‘inline’ variable
inline void* wrMalloc( size_t size ) { return malloc(size); }
^
wrappers.hpp:13:24: error: ‘size_t’ was not declared in this scope
wrappers.hpp:13:38: error: expected ‘,’ or ‘;’ before ‘{’ token
inline void* wrMalloc( size_t size ) { return malloc(size); }
^
wrappers.hpp: In function ‘void wrFree(void*)’:
wrappers.hpp:14:44: error: ‘free’ was not declared in this scope
inline void wrFree( void * ptr ) { free(ptr); }
^
wrappers.hpp: At global scope:
wrappers.hpp:17:17: error: ‘size_t’ was not declared in this scope
void* alMalloc( size_t size, int alignment ) {
^
wrappers.hpp:17:30: error: expected primary-expression before ‘int’
void* alMalloc( size_t size, int alignment ) {
^
wrappers.hpp:17:44: error: expression list treated as compound expression in initializer [-fpermissive]
void* alMalloc( size_t size, int alignment ) {
^
wrappers.hpp:17:46: error: expected ‘,’ or ‘;’ before ‘{’ token
void* alMalloc( size_t size, int alignment ) {
This error can be fixed by adding the two header files:
#include <stdio.h>
#include <stdlib.h>
Please help review and confirm.
Thanks,
Shuai Hua
Thank you for sharing this great toolbox. There is something wrong when I try to use the tool box in my end.
I'm running the code on my Mac system. However, when I try to run seqIo.m with command
out = seqIo('/MY/PATH/TO/SEQ/FILENAME.seq','reader')
It ends up with error
Undefined function or variable 'int2str2'.
Error in seqReaderPlugin>readHeader (line 219)
fps = fread(fid,1,'float64'); codec=['imageFormat' int2str2(tmp(6),3)];Error in seqReaderPlugin>open (line 96)
if(isempty(info)), info=readHeader(fid); elseError in seqReaderPlugin (line 47)
[infos{h},fids(h),tNms{h}]=open(fName,info); return;Error in seqIo>reader (line 113)
r=@seqReaderPlugin; s=r('open',int32(-1),fName);Error in seqIo (line 64)
case {'reader','r'}, out = reader( fName, varargin{:} );Error in untitled (line 1)
out = seqIo('/MY/PATH/TO/SEQ/FILENAME.seq','reader')
Is this a bug or I didn't correctly installed the code?
Any help would be appreciated.
Hi,Dollar
I have modified the chnsCompute1 function in acftrain.m into
function chns = chnsCompute1( Is, opts ) if(isempty(Is)), chns=[]; return; end fprintf('Extracting features... '); start=clock; fs=opts.filters; pChns=opts.pPyramid.pChns; smooth=opts.pPyramid.smooth; dsTar=opts.modelDsPad/pChns.shrink; ds=size(Is); ds(1:end-1)=1; Is=squeeze(mat2cell2(Is,ds)); n=length(Is); chns=cell(1,n); parfor i=1:n C=chnsCompute(Is{i},pChns); C=convTri(cat(3,C.data{:}),smooth); if(~isempty(fs)), C=repmat(C,[1 1 39]); for j=1:size(C,3),C(:,:,j)=conv2(C(:,:,j),fs{floor((j+9)/10)},'same'); end; end shr=1; ds=size(C); cr=ds(1:2)-dsTar/shr; s=floor(cr/2)+1; e=ceil(cr/2); C=C(s(1):end-e(1),s(2):end-e(2),:); chns{i}=C; end; chns=cat(4,chns{:}); fprintf('done (time=%.0fs).\n',etime(clock,start)); end
The "fs"is a cell including 39 filter matrixs,then I run the acfdemocal.m,the parallel pool is shut down suddenly,and the matlab show:
error : acfTrain_CB>sampleWins (line 267)
parfor j=1:batch, ij=i+j;
The client lost connection to worker 3. This might be due to network problems, or the interactive communicating job might have errored.
Do you know how I can solve the problem?
look forward to your reply!
i'm having this error:
Error using convConst
A must be a 4x4 or bigger 2D or 3D float array.
while debugging the code i found out that I=160903 after calling rgbConvertMex become 160901277669775489321 and this is why Convcost show me this error.
how can i fix this error please
Hi,
as of MATLAB 2013b savefig was introduced as a built-in function. Now when adding the toolbox to the path, the function defined in
toolbox/external/other/savefig.m
shadows the MATLAB builtin function defined in
matlab/8.2/x86_64/toolbox/matlab/graphics/savefig.p
such that the standard MATLAB command
saveas(handle, 'filename', 'fig')
tries to access the toolbox command instead of the 'new' built-in backend function for saving figures.
Since the function signatures differ, this results in the following error
Error using savefig (line 128)
No file name specified.
Error in saveasfig (line 7)
savefig(h, name);
Error in saveas (line 141)
feval( ['saveas' format], h, name )
Error in evaluate_template_stage_1_debug (line 389)
saveas(myPlot, 'filename', 'fig');
I think this is a compatibility issue, since everything works as expected on 2013a.
A temporary workaround for me is now to rename the savefig
function in the toolbox to get rid of the shadowing, because as far as I know I am not using it from other toolbox functions. However, this would inevitably break some other functions in the toolbox, that depend on savefig
.
Maybe renaming it in the toolbox and fixing the internal function calls is a permanent solution to that problem.
Cheers,
Phil
Error using forestInds
Mismatch between data types.
Error in adaBoostApply_otf_trans (line 43)
ids = forestInds(X,model.thrs(:,i),model.fids(:,i),model.child(:,i),nt);
I dont know what is happening and how to solve this.
Do you have any solution? Thanks!
Hello,
There is a potential bug in adaBoostTrain.
Certain parameter settings for the acfTrain function sometime result in error behavior in training, where the err is increasing until NaN, and the loss stops reducing under e-05. Below is an example of the output:
Training AdaBoost: nWeak=6000 nFtrs=2890 pos=531304 neg=500000
i= 16 alpha=1.000 err=0.436 loss=6.11e-01
.
.
.
i= 672 alpha=1.000 err=0.454 loss=2.20e-02
.
.
.
i=1792 alpha=1.000 err=0.477 loss=2.24e-04
i=1808 alpha=1.000 err=0.478 loss=2.17e-04
.
.
.
i=3136 alpha=1.000 err=0.493 loss=8.19e-05
i=3152 alpha=1.000 err=0.493 loss=8.15e-05
i=3168 alpha=1.000 err=0.494 loss=8.12e-05
i=3184 alpha=1.000 err=0.495 loss=8.08e-05
i=3200 alpha=1.000 err=0.494 loss=8.05e-05
.
.
.
i=5456 alpha=1.000 err=0.499 loss=6.70e-05
i=5472 alpha=1.000 err=0.499 loss=6.70e-05
i=5488 alpha=1.000 err=0.499 loss=6.69e-05
i=5504 alpha=1.000 err=0.499 loss=6.69e-05
i=5520 alpha=1.000 err=0.499 loss=6.69e-05
i=5536 alpha=1.000 err=NaN loss=6.69e-05
Parameters in acfTrain do not really impact this behavior, besides the model size. It seems like this occurs at certain sizes, but does not occur at others. Changing other parameters (random seed, etc.) still results in the same behavior.
Any ideas?
Thanks!
in resample():
if(ybd[0]>4) for(; y<hn; y++) { B0[ybs[y]] += C[yas[y]] * ywts[y]; }
This function yields unpredictable result if the output buffer(B) is not initialized (to zero);
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.