Problem creating DetectNet object

Hi!

I am doing object recognition on my Jetson TX2 and want to try DetectNet. I have problems creating an instance of the net.

This command parse the parameters to the class:

detectNet* net = detectNet::Create(prototxt_path, model_path, mean_pixel, threshold, DETECTNET_DEFAULT_INPUT, DETECTNET_DEFAULT_COVERAGE, DETECTNET_DEFAULT_BBOX, maxBatchSize);

But gives this error when compiling:
undefined reference to `detectNet

Can you help me?

I have followed the instructions for installing the Jetson Inference libraries:

Kind regards,
Otto

Hi,

It looks like there is something incorrect in you implementation.
Do you include and build the detectNet class correctly?
https://github.com/dusty-nv/jetson-inference/blob/master/detectNet.h
https://github.com/dusty-nv/jetson-inference/blob/master/detectNet.cpp

Thanks.

Hi AastaLLL

I think I did it correctly.

  1. I downloaded the repository from here https://github.com/dusty-nv/jetson-inference.
  2. Then i build it using cmake.

The header files was placed in folder /build/aarch64/

  1. To test if the libraries was working I created a test file where I imported /build/aarch64/detectNet.h and created an instance and passed variables (.prototxt and more) to the constructor. Se below.

But. I got an error: undefined reference to detectNet

Do you see any mistakes?

Thanks,
Otto

#include
#include
#include “/home/nvidia/Desktop/neuralnetworks/objectDetection/detectNet/build/aarch64/include/detectNet.h”

using namespace std;

int main(){
const char * prototxt_path = “/home/nvidia/Desktop/neuralnetworks/objectDetection/caffenet_deploy.prototxt”;
const char * model_path = “/home/nvidia/Desktop/neuralnetworks/objectDetection/caffe_model.caffemodel”;
const char * mean_binary = “/home/nvidia/Desktop/neuralnetworks/objectDetection/mean.binaryproto”;
float threshold = 0.5f;
const char * input = “data”;
const char * coverage = “blob”;
const char * bboxes = “bboxes”;
const uint32_t maxBatchSize = 2;

detectNet* net = detectNet::Create(prototxt_path, model_path, mean_binary, threshold, DETECTNET_DEFAULT_INPUT, DETECTNET_DEFAULT_COVERAGE, DETECTNET_DEFAULT_BBOX, maxBatchSize);
cout << "works" << endl;

}

Hi,

You need to link the libjetson_inference.so.
Here is an simple example for your reference:

source

#include "detectNet.h"

int main( int argc, char** argv )
{
    detectNet* net = detectNet::Create(argc, argv);
    return 0;
}

build

nvcc -std=c++11 topic_1038283.cpp -I[jetson_inferece]/build/aarch64/include/ -L[jetson_inferece]/build/aarch64/lib/ -ljetson-inference -o test

run

LD_LIBRARY_PATH=[jetson_inferece]/build/aarch64/lib/:$LD_LIBRARY_PATH  
./test

Thanks

Ah yes, thanks!
:)