C++中使用OPENCV对深度学习的特征图进行可视化

#include 
#include 
#include 
#include 
#include 
#include "../../usw.h"

using namespace std;

/*
equal list

opencv_conv*relu = pycaffe_conv*

*/

int main(int argc, char *argv[])
{
    //// SHOULD BE 4.*.*
    cerr<<"WORKING IN OPENCV_VERSION "< outputname=net.getLayerNames();
    outputname.insert(outputname.begin(),"data");
    cv::dnn::MatShape netInputSize = {1,3,300,300};
    vector netlastSize;
    vector >layerSizes;
    for(size_t i=0;iinputLayerSize;
        vectoroutputLayerSize;
        net.getLayerShapes(netInputSize,i,inputLayerSize,outputLayerSize);
        cerr<<"layer <<"<> size [\n";
        for(size_t j=0;j > outputBlob;
    try{
        cerr<<"\nNet forward ";
        net.forward(outputBlob, outputname);
        cerr<<"done\n\n";
    }catch(exception e){
        cerr << e.what() << '\n';
    }

    string selectLayer="conv4";

    for(size_t i=0;i for %d\n",saveimg.rows,saveimg.cols,layerSizes[i][j][1]);
                    for(size_t wy=0; wy=layerSizes[i][j][1])break;
                            s[5]=0;
                            for(size_t py=0; py float
    fprintf(stderr, "type list :         ",
            CV_8UC1,CV_8UC3,CV_16FC1,CV_16FC3,CV_16SC1,CV_16SC3,CV_32FC1,CV_32SC1);
    return 0;
}

 需要先在运行目录下创建目录opencv_layers

转载于:https://www.cnblogs.com/aimhabo/p/10814980.html

你可能感兴趣的:(C++中使用OPENCV对深度学习的特征图进行可视化)