Pytorch LibTorch demo
- Download C++ LibTorch library at https://pytorch.org/get-started/locally/
- Download and build C++ library OpenCV at https://opencv.org/releases/
- Setup your libs path on CMakeList.txt
set(Torch_DIR ~/your/path/here/libtorch/share/cmake/Torch)
set(OpenCV_DIR ~/your/path/here/opencv-4.7.0/build)
For libtroch "Pre-cxx11 ABI" can cause compiler conflicts, instead use cxx11 ABI
- python3 tracing.py
- build the c++ program
- ./TorchDemo ../model.pt ../dog.png ../synset_words.txt