dpm-release3.1在windows下的配置

时间:2024-01-16 14:09:08

dpm-release3.1在windows下的配置

dpm是做目标检测objecjt detection的经典方法。dpm系列代码默认是在linux和mac下运行测试过的,windows下默认是不能正常运行的。这里尝试修改了一些配置发现可以在windows下运行的。

简单说明

dpm-release3.1下载地址:http://cs.brown.edu/~pff/latent-release3/voc-release3.1.tgz

对应论文:

[2] P. Felzenszwalb, R. Girshick, D. McAllester, D. Ramanan

Object Detection with Discriminatively Trained Part Based Models

To appear in the IEEE Transactions on Pattern Analysis and Machine Intelligence

论文下载:http://cs.brown.edu/~pff/papers/lsvm-pami.pdf

我在win10下配置的。

具体配置

先确保安装了c编译器,比如vs2010或者vs2013,然后在matlab中配置它:

mex -setup
%选择你安装的c编译器

然后把dpm-release3.1代码解压,从matlab中切换到它所在目录。

dt.cc添加

 #define int32_t int

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; }

resize.cc中30多行,将

alphainfo ofs[len];

改成

struct alphainfo *ofs = (struct alphainfo *)malloc(sizeof(struct alphainfo)*len);

fconv.cc中process()函数增加一个返回值:

return NULL;

compile.m中修改为:

mex -O resize.cc
mex -O dt.cc
mex -O features.cc % use one of the following depending on your setup
% 1 is fastest, 3 is slowest % 1) multithreaded convolution using blas
% mex -O fconvblas.cc -lmwblas -o fconv
% 2) mulththreaded convolution without blas
% mex -O fconvMT.cc -o fconv
% 3) basic convolution, very compatible
mex -O fconv.cc -output fconv

好了,现在运行compile.m可以执行了