|
|
|
@ -3486,11 +3486,16 @@ void Net::connect(String _outPin, String _inPin) |
|
|
|
|
Mat Net::forward(const String& outputName) |
|
|
|
|
{ |
|
|
|
|
CV_TRACE_FUNCTION(); |
|
|
|
|
CV_Assert(!empty()); |
|
|
|
|
|
|
|
|
|
String layerName = outputName; |
|
|
|
|
|
|
|
|
|
if (layerName.empty()) |
|
|
|
|
layerName = getLayerNames().back(); |
|
|
|
|
{ |
|
|
|
|
std::vector<String> layerNames = getLayerNames(); |
|
|
|
|
CV_Assert(!layerNames.empty()); |
|
|
|
|
layerName = layerNames.back(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::vector<LayerPin> pins(1, impl->getPinByAlias(layerName)); |
|
|
|
|
impl->setUpNet(pins); |
|
|
|
@ -3502,11 +3507,17 @@ Mat Net::forward(const String& outputName) |
|
|
|
|
AsyncArray Net::forwardAsync(const String& outputName) |
|
|
|
|
{ |
|
|
|
|
CV_TRACE_FUNCTION(); |
|
|
|
|
CV_Assert(!empty()); |
|
|
|
|
|
|
|
|
|
#ifdef CV_CXX11 |
|
|
|
|
String layerName = outputName; |
|
|
|
|
|
|
|
|
|
if (layerName.empty()) |
|
|
|
|
layerName = getLayerNames().back(); |
|
|
|
|
{ |
|
|
|
|
std::vector<String> layerNames = getLayerNames(); |
|
|
|
|
CV_Assert(!layerNames.empty()); |
|
|
|
|
layerName = layerNames.back(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::vector<LayerPin> pins(1, impl->getPinByAlias(layerName)); |
|
|
|
|
impl->setUpNet(pins); |
|
|
|
@ -3527,11 +3538,16 @@ AsyncArray Net::forwardAsync(const String& outputName) |
|
|
|
|
void Net::forward(OutputArrayOfArrays outputBlobs, const String& outputName) |
|
|
|
|
{ |
|
|
|
|
CV_TRACE_FUNCTION(); |
|
|
|
|
CV_Assert(!empty()); |
|
|
|
|
|
|
|
|
|
String layerName = outputName; |
|
|
|
|
|
|
|
|
|
if (layerName.empty()) |
|
|
|
|
layerName = getLayerNames().back(); |
|
|
|
|
{ |
|
|
|
|
std::vector<String> layerNames = getLayerNames(); |
|
|
|
|
CV_Assert(!layerNames.empty()); |
|
|
|
|
layerName = layerNames.back(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::vector<LayerPin> pins(1, impl->getPinByAlias(layerName)); |
|
|
|
|
impl->setUpNet(pins); |
|
|
|
@ -4118,6 +4134,8 @@ std::vector<Ptr<Layer> > Net::getLayerInputs(LayerId layerId) |
|
|
|
|
|
|
|
|
|
std::vector<String> Net::getLayerNames() const |
|
|
|
|
{ |
|
|
|
|
CV_TRACE_FUNCTION(); |
|
|
|
|
|
|
|
|
|
std::vector<String> res; |
|
|
|
|
res.reserve(impl->layers.size()); |
|
|
|
|
|
|
|
|
|