Use pre-trained cnn to classify 6-channel-mats
Hey there,
I have a pre trained cnn, which was trained on 6 channel inputs (created out of two bgr images of same size).
vector<Mat> inputs;
vector<Mat> temp;
Mat blob;
cv::split(image_1, inputs);
cv::split(image_2, temp);
inputs.insert(inputs.end(), temp.begin(), temp.end());
dnn::blobFromImages(inputs, blob, 1.0/255.0, m_patchSize, 0, true, false);
net.setInput(blob);
Mat out = net.forward();
The program crashes in line blobFromImages. What am I doing wrong? Is it possible to classify Mats with more than 3 channels?
what does "6-channel Mat's" really mean here ? do you have a link to a repo / paper ? a prototxt ?
blobFromImages
is meant to produce a "batch" of several images, not "channels" ( is that what you wanted ???)I don't have a link or something, because I trained the model myself with keras/tensorflow for python. What I want to do: classify two images / consecutive frames (Don't ask me why). I trained the model by mixing these two images into one 6 channel matrix.
but you'll have code to train it, right ? please also have a look here , you can't use the keras output directly, but you'll have to process it in a similar way (freezing the graph, applying transforms, weeding out unneeded consts, etc.
here's unfortunately, where the real work starts.