I am trying to convert detectron 2 inference in C++, CPU and VS 2019 with this code : detectron2/tools/deploy at main · facebookresearch/detectron2 · GitHub. Cmake successfully find OpenCV 4 and libtorch but I haven’t found on Internet the libtorchvision, where it is please ?
thank you
best regards
PS : I found Libtorch here : Start Locally | PyTorch
@Sylvain_Ard Were you able to figure this out?
You will have to build the touch vision c++. Please refer - Building Torchvision C++ API from source
Below is a sample of commands I used in Windows using anaconda.
- Clone pybind11 and install to C:\pybind11
git clone https://github.com/pybind/pybind11.git
cd pybind11
mkdir build
cd build
cmake -DPYBIND11_TEST=OFF -DCMAKE_INSTALL_PREFIX="C:\Users\pybind11" ..
- Clone torchvision
git clone https://github.com/pytorch/vision.git
- Cmake the project.
cd vision
mkdir build
cd build
## Enable CUDA.
cmake -DWITH_CUDA=on -DUSE_PYTHON=on -DCMAKE_PREFIX_PATH="C:\libtorch-win-shared-with-deps-1.10.2+cu113\libtorch;C:\Users\pybind11" -DCMAKE_BUILD_TYPE=Release ..
-
Create torchvison dll file : cd C:\Users\user\vision\build and open torchvision.sln using Visual Studio. Build the ‘tourchvision’ project to create DLL file. DLL file ‘torchvision.dll’ is created in '.\Release' folder.
-
Install C++ files : cd C:\Users\user\vision\build and install torchvision c++ using ‘cmake -P cmake_install.cmake’. C++ files will be created in C:\Program Files (x86)\torchvision.