vislearn / dsacstar

DSAC* for Visual Camera Re-Localization (RGB or RGB-D)
BSD 3-Clause "New" or "Revised" License
235 stars 36 forks source link

Installing on Jetson TX2 NX #30

Open pzhine opened 3 weeks ago

pzhine commented 3 weeks ago

Hi, I'm trying to evaluate the inference on an NVIDIA Jetson TX2 NX. When I try to install miniconda (for aarch64) I get an error:

/home/fubintlab/miniconda3/miniconda.sh: line 470: 32664 Exit 141                extract_range $boundary1 $boundary2
     32665 Illegal instruction     (core dumped) | CONDA_QUIET="$BATCH" "$CONDA_EXEC" constructor --extract-tarball --prefix "$PREFIX"

So I installed all the dependencies using pip. However, for my architecture the requested opencv version (3.4.2) is not available. I was able to succesfully install opencv-python version 3.4.10.37 and set the library and header dirs in setup.py. When I run python setup.py install, the build fails with errors:

In file included from dsacstar_util.h:37:0,
                 from dsacstar.cpp:42:
dsacstar_util_rgbd.h: In function ‘void matMulDerivWrapper(cv::InputArray, cv::InputArray, cv::OutputArray, cv::OutputArray)’:
dsacstar_util_rgbd.h:221:2: error: ‘CvMat’ was not declared in this scope
  CvMat matA = A, matB = B, c_dABdA=_dABdA.getMat(), c_dABdB=_dABdB.getMat();
  ^~~~~
dsacstar_util_rgbd.h:222:21: error: ‘matA’ was not declared in this scope
  cvCalcMatMulDeriv(&matA, &matB, _dABdA.needed() ? &c_dABdA : 0, _dABdB.needed() ? &c_dABdB : 0);
                     ^~~~
dsacstar_util_rgbd.h:222:28: error: ‘matB’ was not declared in this scope
  cvCalcMatMulDeriv(&matA, &matB, _dABdA.needed() ? &c_dABdA : 0, _dABdB.needed() ? &c_dABdB : 0);
                            ^~~~
dsacstar_util_rgbd.h:222:53: error: ‘c_dABdA’ was not declared in this scope
  cvCalcMatMulDeriv(&matA, &matB, _dABdA.needed() ? &c_dABdA : 0, _dABdB.needed() ? &c_dABdB : 0);
                                                     ^~~~~~~
dsacstar_util_rgbd.h:222:53: note: suggested alternative: ‘_dABdA’
  cvCalcMatMulDeriv(&matA, &matB, _dABdA.needed() ? &c_dABdA : 0, _dABdB.needed() ? &c_dABdB : 0);
                                                     ^~~~~~~
                                                     _dABdA
dsacstar_util_rgbd.h:222:85: error: ‘c_dABdB’ was not declared in this scope
  cvCalcMatMulDeriv(&matA, &matB, _dABdA.needed() ? &c_dABdA : 0, _dABdB.needed() ? &c_dABdB : 0);
                                                                                     ^~~~~~~
dsacstar_util_rgbd.h:222:85: note: suggested alternative: ‘_dABdB’
  cvCalcMatMulDeriv(&matA, &matB, _dABdA.needed() ? &c_dABdA : 0, _dABdB.needed() ? &c_dABdB : 0);
                                                                                     ^~~~~~~
                                                                                     _dABdB
dsacstar_util_rgbd.h:222:2: error: ‘cvCalcMatMulDeriv’ was not declared in this scope
  cvCalcMatMulDeriv(&matA, &matB, _dABdA.needed() ? &c_dABdA : 0, _dABdB.needed() ? &c_dABdB : 0);
  ^~~~~~~~~~~~~~~~~

Any suggestions? Has anyone successfully installed dsacstar on a Jetson?

ebrach commented 1 week ago

Hi. I'm afraid I have no suggestions for your specific issue. However, did you consider to try ACE? It is another scene coordinate regression method, and more recent than DSAC*. The ACE code uses OpenCV 4.4.0.

In case you need capabilities of DSAC that ACE does not have (e.g. mapping with depth/3D model), you could try coupling the ACE C++ bindings (which it inherited from DSAC but were updated for OpenCV 4.4.0) with the DSAC* python scripts.

Best, Eric