tyui592 / PytorchToCpp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++ Code to Load a TorchScript Model

This is c++ implementation to load a torchscript object detector.

The detector should take a tensor (1 x Channel(rgb) x Height x Width) as input and output tuple of 3 tensors (boudning box, class id, confidence score)

Usage

Build

$ mkdir build
$ cd build
build$ cmake -DCMAKE_PREFIX_PATH=<libtorch_path> ..
build$ cmake --build . --config Release

Run

build$ ./main -m <model_path> -i <image_path>

References

TODO

  • Make docker file
  • Video Detection

About


Languages

Language:C++ 98.6%Language:CMake 1.4%