zoukankan      html  css  js  c++  java
  • dpm-release3.1在windows下的配置

    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可以执行了

  • 相关阅读:
    第十一周总结
    代码大全第二版-阅读笔记03
    第十周总结
    第十四周总结
    第十三周总结
    图书管理系统
    《软件需求模式》阅读笔记(三)
    第十二周总结
    语义分析
    第十一周总结
  • 原文地址:https://www.cnblogs.com/zjutzz/p/5559505.html
Copyright © 2011-2022 走看看