mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Merge pull request #12644 from dkurt:dnn_out_layers_names
This commit is contained in:
@@ -535,6 +535,11 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
|
||||
/** @brief Returns indexes of layers with unconnected outputs.
|
||||
*/
|
||||
CV_WRAP std::vector<int> getUnconnectedOutLayers() const;
|
||||
|
||||
/** @brief Returns names of layers with unconnected outputs.
|
||||
*/
|
||||
CV_WRAP std::vector<String> getUnconnectedOutLayersNames() const;
|
||||
|
||||
/** @brief Returns input and output shapes for all layers in loaded model;
|
||||
* preliminary inferencing isn't necessary.
|
||||
* @param netInputShapes shapes for all input blobs in net input layer.
|
||||
|
||||
@@ -2789,6 +2789,18 @@ std::vector<int> Net::getUnconnectedOutLayers() const
|
||||
return layersIds;
|
||||
}
|
||||
|
||||
std::vector<String> Net::getUnconnectedOutLayersNames() const
|
||||
{
|
||||
std::vector<int> ids = getUnconnectedOutLayers();
|
||||
const size_t n = ids.size();
|
||||
std::vector<String> names(n);
|
||||
for (size_t i = 0; i < n; ++i)
|
||||
{
|
||||
names[i] = impl->layers[ids[i]].name;
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
void Net::getLayersShapes(const ShapesVec& netInputShapes,
|
||||
std::vector<int>& layersIds,
|
||||
std::vector<ShapesVec>& inLayersShapes,
|
||||
|
||||
Reference in New Issue
Block a user