mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 13:47:32 +08:00
Merge pull request #12864 from dkurt:dnn_ie_get_batch_size
This commit is contained in:
commit
6d9e66eca1
@ -331,8 +331,18 @@ InferenceEngine::StatusCode InfEngineBackendNet::setBatchSize(size_t size, Infer
|
||||
|
||||
size_t InfEngineBackendNet::getBatchSize() const noexcept
|
||||
{
|
||||
CV_Error(Error::StsNotImplemented, "");
|
||||
return 0;
|
||||
size_t batchSize = 0;
|
||||
for (const auto& inp : inputs)
|
||||
{
|
||||
CV_Assert(inp.second);
|
||||
std::vector<size_t> dims = inp.second->getDims();
|
||||
CV_Assert(!dims.empty());
|
||||
if (batchSize != 0)
|
||||
CV_Assert(batchSize == dims.back());
|
||||
else
|
||||
batchSize = dims.back();
|
||||
}
|
||||
return batchSize;
|
||||
}
|
||||
|
||||
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2018R2)
|
||||
|
Loading…
Reference in New Issue
Block a user