Skip to content

I use mobilenetv2 to export a model with 5 classes, then use libtorch to load and run it.

License

Notifications You must be signed in to change notification settings

zacario-li/libtorch_cpp_mobilenetv2_5classes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

requirments

download libtorch (https://download.pytorch.org/libtorch/cu102/libtorch-cxx11-abi-shared-with-deps-1.7.1.zip)
unzip libtorch, then put them under c++ dir
install cuda10.2
install cudnn7
if you use 'Pre-cxx11 ABI', do the actions below: opencv build with -D_GLIBCXX_USE_CXX11_ABI=0 (important)

How to use

mkdir build
cd build
cmake ..
make

run

./example-app ../mv2.pt test1.jpg test2.jpg

we will see the result

inputs:1
start...
id:0 conf:0.96528
id:4 conf:0.996588

About

I use mobilenetv2 to export a model with 5 classes, then use libtorch to load and run it.

Resources

License

Stars

Watchers

Forks

Packages

No packages published