在windows下運行Felzenszwalb的Discriminatively Trained Deformable Part Models matlab代碼

來源:互聯網
上載者:User

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

據說是目前最好的object detection method。我自己試了一下,效果真的不錯。不過代碼只可以在unix/linux/mac上運行。

(Pascal voc 近兩屆obj detection冠軍的方法都是基於此架構的,但是別人的研究是不公開的,順便表示一下不滿)

但是呢,只要稍作修改就可以在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
% 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 -o fconv
mex -O fconv.cc

其他幾個fconv用了其他平台的multiThread在windows上跑不起!

 

改了上邊的幾個地方後,就可以運行了。跑demo.m看效果吧,,,

       

 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.