Operating System / Platform => Windows 7/10 64 Bit
Compiler => Visual Studio 2015
Languege C++
I have 2 trained tiny yolo models.
One trained on 3 channel (RGB) data and one trained on one channel (GRAY LEVEL) data.
The difference is in the channels parameter in the cfg file.
When I prepare the blob I need to know how many channels to give (blobFromImage).
I want to get that info from the loaded network.
I thought I can get it gy getLayershapes() am I right?
If yet then the first input parameter (cv::dnn::MatShape netInputShape) How do I get it?
thanks.
Closed for the following reason
the question is answered, right answer was accepted by
Shay Weissman
close date 2019-07-22 02:28:01.369736
Comments
I want to get that info from the loaded network.
you can't. the layersizes are still variable, and only have something meaningful in it after you call net.setInput(). and that's where the cat bites its tail.
you probably have 2 different .cfg files for your models, maybe you can infer the channel size from the resp. filenames ?
you can't. the layersizes are still variable, and only have something meaningful in it after you call
net.setInput()
. and that's where the cat bites its tail.you probably have 2 different .cfg files for your models, maybe you can infer the channel size from the resp. filenames ?
Maybe you can try to get the first convolution layer and determine input channels number by it's weights.