Windows下运行Discriminatively Trained Deformable Part Models代码 Version 4

Windows下运行Discriminatively Trained Deformable Part Models代码 Version 4

 Felzenszwalb的Discriminatively Trained Deformable Part Models  URL:http://www.cs.brown.edu/~pff/latent/

这是目前最好的object detection method,不过代码只可以在unix/linux/mac上运行,但只要稍作修改就可以在windows上运行:

1,dt.cc 添加一句:#define int32_t  int


2,features.cc &  resize.cc中添加:

     #define bzero(a, b) memset(a, 0, b) 
     int round(float a) { float tmp = a - (int)a; if( tmp >= 0.5 ) return (int)a + 1; else return (int)a; }


3,resize.cc中:  alphainfo ofs[len]; 这句改成:alphainfo *ofs = new alphainfo[len];  当然在同一作用域后面加上:delete []ofs


4,compile.m中:结尾加上mex -O fconv.cc

% use one of the following depending on your setup
% 0 is fastest, 3 is slowest 


% 0) multithreaded convolution using SSE
%mex -O fconvsse.cc -o fconv


% 1) multithreaded convolution using blas
%    WARNING: the blas version does not work with matlab >= 2010b 
%    and Intel CPUs
% mex -O fconvblasMT.cc -lmwblas -o fconv


% 2) mulththreaded convolution without blas
% mex -O fconvMT.cc -o fconv


% 3) convolution using blas
% mex -O fconvblas.cc -lmwblas -o fconv


% 4) basic convolution, very compatible
% mex -O fconv.cc -o fconv


mex -O fconv.cc


其他几个fconv用了其他平台的multiThread在windows上跑步起来

 

改了上边的几个地方后,运行跑demo.m看效果:




Windows下运行Discriminatively Trained Deformable Part Models代码 Version 4_第1张图片


Windows下运行Discriminatively Trained Deformable Part Models代码 Version 4_第2张图片


更详细壳参考:Windows下运行DPM(voc-release4.01)目标检测MATLAB 

                        http://blog.csdn.net/masibuaa/article/details/17577195

若没能成功,更多bug可以参考各博主谈论http://blog.csdn.net/pozen/article/details/7023742


更多,请关注http://blog.csdn.net/tiandijun/,欢迎交流!


你可能感兴趣的:(Windows下运行Discriminatively Trained Deformable Part Models代码 Version 4)