Skip to content

Commit c866dc3

Browse files
author
Pashchenkov Maxim
committed
Reverted change for gaze estimation, added logs for gesture recognition, added check for s-t model
1 parent f020b9a commit c866dc3

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

demos/common/cpp/models/src/style_transfer_model.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ void StyleTransferModel::prepareInputsOutputs(InferenceEngine::CNNNetwork& cnnNe
4040
SizeVector& inSizeVector = inputShapes.begin()->second;
4141
if (inSizeVector.size() != 4 || inSizeVector[0] != 1 || inSizeVector[1] != 3)
4242
throw std::runtime_error("3-channel 4-dimensional model's input is expected");
43-
InputInfo& inputInfo = *cnnNetwork.getInputsInfo().begin()->second;
43+
auto inputsDataMap = cnnNetwork.getInputsInfo();
44+
if (inputsDataMap.empty()) {
45+
throw std::runtime_error("Network input data node information is empty");
46+
}
47+
InputInfo& inputInfo = *inputsDataMap.begin()->second;
48+
4449
inputInfo.setPrecision(Precision::FP32);
4550

4651
// --------------------------- Prepare output blobs -----------------------------------------------------

demos/gaze_estimation_demo/cpp/src/landmarks_estimator.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ std::vector<cv::Point2i> LandmarksEstimator::heatMapPostprocess(cv::Rect faceBou
9898

9999
std::vector<cv::Mat> LandmarksEstimator::split(std::vector<float>& data, const std::vector<unsigned long>& shape) {
100100
std::vector<cv::Mat> flattenData(shape[1]);
101-
float* output = data.data();
101+
float* output = new float[data.size()];
102+
for (size_t i = 0; i < data.size(); i++) {
103+
output[i] = data[i];
104+
}
102105
for (size_t i = 0; i < flattenData.size(); i++) {
103106
flattenData[i] = cv::Mat(shape[2], shape[3], CV_32FC1, output + i * shape[2] * shape[3]);
104107
}

demos/gesture_recognition_demo/cpp_gapi/main.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,19 @@ int main(int argc, char *argv[]) {
101101
FLAGS_m_d, // path to model
102102
fileNameNoExt(FLAGS_m_d) + ".bin", // path to weights
103103
FLAGS_d_d // device to use
104-
}.cfgOutputLayers({"boxes"}); // This clarification here because
105-
// of GAPI take the last layer from .xml
106-
// and last layer sould be the outpul layer
104+
}.cfgOutputLayers({"boxes"}); // This clarification here because of
105+
// GAPI take the first layer name from OutputsInfo
106+
// for one output G_API_NET API
107+
slog::info << "The Person Detection ASL model " << FLAGS_m_d << " is loaded to " << FLAGS_d_d << " device." << slog::endl;
107108

108109
auto action_recognition = cv::gapi::ie::Params<nets::ActionRecognition> {
109110
FLAGS_m_a, // path to model
110111
fileNameNoExt(FLAGS_m_a) + ".bin", // path to weights
111112
FLAGS_d_a // device to use
112-
}.cfgOutputLayers({"output"}); // The same
113+
}.cfgOutputLayers({"output"}); // This clarification here because of
114+
// GAPI take the first layer name from OutputsInfo
115+
// for one output G_API_NET API
116+
slog::info << "The Action Recognition model " << FLAGS_m_a << " is loaded to " << FLAGS_d_a << " device." << slog::endl;
113117

114118
/** Custom kernels **/
115119
auto kernels = custom::kernels();

0 commit comments

Comments
 (0)