oylz / DS

cpp deep_sort: C++ implementation of Simple Online Realtime Tracking with a Deep Association Metric
https://github.com/nwojke/deep_sort
GNU General Public License v3.0
250 stars 78 forks source link

How to use Deep features? #4

Closed nvnnghia closed 6 years ago

nvnnghia commented 6 years ago

Thanks for sharing the code. I am currently trying to use Deep features instead of FHOG features. can you give some suggestion how to do that? Thank you very much.

oylz commented 6 years ago

compile with macro "UDL". see: https://github.com/oylz/DS/blob/master/NT.cpp#L4 https://github.com/oylz/DS/blob/master/NT.cpp#L44 https://github.com/oylz/DS/blob/master/NT.cpp#L103 https://github.com/oylz/DS/blob/master/NT.cpp#L119

nvnnghia commented 6 years ago

Hi, Thank you very much for response. I tried to compile with macro "UDL", i.e, I uncomment #define UDL (https://github.com/oylz/DS/blob/master/NT.cpp#L3). But I get this error: /tmp/ccIa7taA.o: In function NT::Init()': NT.cpp:(.text+0x9d9): undefined reference toFeatureGetter::self' NT.cpp:(.text+0x9f9): undefined reference to `FeatureGetter::self' NT.cpp:(.text+0xa10): undefined reference to FeatureGetter::Init()' NT.cpp:(.text+0xaed): undefined reference toFeatureGetter::self' NT.cpp:(.text+0xb07): undefined reference to `FeatureGetter::self' NT.cpp:(.text+0xb27): undefined reference to FeatureGetter::self_' NT.cpp:(.text+0xb31): undefined reference toFeatureGetter::self' NT.cpp:(.text+0xb49): undefined reference to `FeatureGetter::self' /tmp/ccIa7taA.o:NT.cpp:(.text+0xb50): more undefined references to FeatureGetter::self_' follow /tmp/ccIa7taA.o: In functionExtractFeature(cv::Mat const&, std::vector<cv::Rect, std::allocator<cv::Rect > > const&, std::vector<Eigen::Matrix<float, 1, 128, 1, 1, 128>, std::allocator<Eigen::Matrix<float, 1, 128, 1, 1, 128> > >&)': NT.cpp:(.text+0x2739): undefined reference to FeatureGetter::Get(cv::Mat const&, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > > const&, std::vector<Eigen::Matrix<float, 1, 128, 1, 1, 128>, std::allocator<Eigen::Matrix<float, 1, 128, 1, 1, 128> > >&)' NT.cpp:(.text+0x287e): undefined reference toFeatureGetter::self' NT.cpp:(.text+0x2894): undefined reference to `FeatureGetter::self' NT.cpp:(.text+0x28b4): undefined reference to FeatureGetter::self_' NT.cpp:(.text+0x28be): undefined reference toFeatureGetter::self' NT.cpp:(.text+0x28de): undefined reference to `FeatureGetter::self' /tmp/ccIa7taA.o:NT.cpp:(.text+0x28e5): more undefined references to `FeatureGetter::self_' follow collect2: error: ld returned 1 exit status

I do not know what I did wrong. Please help, Thank you

oylz commented 6 years ago

FeatureGetter(https://github.com/oylz/DS/tree/master/deepsort/FeatureGetter) is a single library. you may first to build it, and then link it in DS.

nvnnghia commented 6 years ago

Thank you very much. I'll try

nvnnghia commented 6 years ago

Hi, I've finished to build FeatureGetter, the problem is that there is no tt1.pb file, therefore, the program can not run. Can you please share the tt1.pb file or how can I get that file. Thank you very much.

ReadBinaryProto failed: Not found: ./data/tt1.pb; No such file or directory

oylz commented 6 years ago

@nvnnghia I have add it now.(https://github.com/oylz/DS/tree/master/data)

nvnnghia commented 6 years ago

Update: I have sucessfully used Deep features. Thank you very much!

Thank you very much. I still can not use Deep features. When I compile without macro "UDL" the program work perfectly. If I using macro "UDL" the program can not use imread or imshow. Compile sucessfully, but when I run the program I met this error: OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /home/nghia/opencv/modules/imgproc/src/color.cpp, line 10638 terminate called after throwing an instance of 'cv::Exception' what(): /home/nghia/opencv/modules/imgproc/src/color.cpp:10638: error: (-215) scn == 3 || scn == 4 in function cvtColor

./script.sh: line 1: 23439 Aborted (core dumped) .

I figured out that the problem is from imread. The imread work uncorrectly in this case. It can not read any image. I do not know why this can happen.

nvnnghia commented 6 years ago

oylz commented 6 years ago

Have you compile opencv with gtk2? If your are in Ubuntu, you can install it by then command apt install libgtk2.0-dev, and then build&install opencv agian.

nvnnghia commented 6 years ago

Everything is good now. thank you very much