Loading inference_base.cpp +4 −0 Original line number Original line Diff line number Diff line Loading @@ -46,9 +46,12 @@ int InferenceBase::Init(string videoStream) if (ReadClassLabels() != 0) if (ReadClassLabels() != 0) { { LOG(ERROR) << "ReadClassLabels returned non-zero\n"; return -1; return -1; } } LOG(INFO) << "CUDA INIT DONE\n"; /* /* if (ReadGraph() != 0) if (ReadGraph() != 0) { { Loading @@ -72,6 +75,7 @@ int InferenceBase::Init(string videoStream) */ */ isInitialized = true; isInitialized = true; return 0; return 0; } } Loading inference_base.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -42,6 +42,8 @@ class InferenceBase , thresholdIOU(threshIOU) , thresholdIOU(threshIOU) , isInitialized(false) , isInitialized(false) , labelsMap() , labelsMap() , width(1280) , height(720) , debug(dbg) , debug(dbg) {} {} virtual ~InferenceBase() {} virtual ~InferenceBase() {} Loading inference_tf.cpp +6 −0 Original line number Original line Diff line number Diff line Loading @@ -25,9 +25,13 @@ int InferenceTensorflow::Init(string videoStream) { { if (InferenceBase::Init(videoStream) != 0) if (InferenceBase::Init(videoStream) != 0) { { LOG(INFO) << "Init(videostream) exit non-zero (aka huge fail)"; return -1; return -1; } } LOG(INFO) << "Init(videostream): PASS\n"; LOG(INFO) << "The session must exist at this point, see loadGraph() in inference_base.cpp"; // configure callable options // configure callable options opts.add_feed(inputLayer); opts.add_feed(inputLayer); for (auto const &value : outputLayer) for (auto const &value : outputLayer) Loading @@ -45,6 +49,8 @@ int InferenceTensorflow::Init(string videoStream) LOG(ERROR) << "Failed to make callable"; LOG(ERROR) << "Failed to make callable"; } } LOG(INFO) << "Shape of the GPU tensor: (1, " << height << ", " << width << ", 3)\n"; // allocate tensor on the GPU // allocate tensor on the GPU tensorflow::TensorShape shape = tensorflow::TensorShape({1, height, width, 3}); tensorflow::TensorShape shape = tensorflow::TensorShape({1, height, width, 3}); Loading Loading
inference_base.cpp +4 −0 Original line number Original line Diff line number Diff line Loading @@ -46,9 +46,12 @@ int InferenceBase::Init(string videoStream) if (ReadClassLabels() != 0) if (ReadClassLabels() != 0) { { LOG(ERROR) << "ReadClassLabels returned non-zero\n"; return -1; return -1; } } LOG(INFO) << "CUDA INIT DONE\n"; /* /* if (ReadGraph() != 0) if (ReadGraph() != 0) { { Loading @@ -72,6 +75,7 @@ int InferenceBase::Init(string videoStream) */ */ isInitialized = true; isInitialized = true; return 0; return 0; } } Loading
inference_base.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -42,6 +42,8 @@ class InferenceBase , thresholdIOU(threshIOU) , thresholdIOU(threshIOU) , isInitialized(false) , isInitialized(false) , labelsMap() , labelsMap() , width(1280) , height(720) , debug(dbg) , debug(dbg) {} {} virtual ~InferenceBase() {} virtual ~InferenceBase() {} Loading
inference_tf.cpp +6 −0 Original line number Original line Diff line number Diff line Loading @@ -25,9 +25,13 @@ int InferenceTensorflow::Init(string videoStream) { { if (InferenceBase::Init(videoStream) != 0) if (InferenceBase::Init(videoStream) != 0) { { LOG(INFO) << "Init(videostream) exit non-zero (aka huge fail)"; return -1; return -1; } } LOG(INFO) << "Init(videostream): PASS\n"; LOG(INFO) << "The session must exist at this point, see loadGraph() in inference_base.cpp"; // configure callable options // configure callable options opts.add_feed(inputLayer); opts.add_feed(inputLayer); for (auto const &value : outputLayer) for (auto const &value : outputLayer) Loading @@ -45,6 +49,8 @@ int InferenceTensorflow::Init(string videoStream) LOG(ERROR) << "Failed to make callable"; LOG(ERROR) << "Failed to make callable"; } } LOG(INFO) << "Shape of the GPU tensor: (1, " << height << ", " << width << ", 3)\n"; // allocate tensor on the GPU // allocate tensor on the GPU tensorflow::TensorShape shape = tensorflow::TensorShape({1, height, width, 3}); tensorflow::TensorShape shape = tensorflow::TensorShape({1, height, width, 3}); Loading