Do inference for semantic segmentation with trained caffe models.
-
Put the caffemodel and deploy file in the models folder. Then the deploy file is named deploy.prototxt, and the caffemodel file is named segment.caffemodel. Alternatively, you can also change the relevant parameters in the src/caffe_cpp_demo.cpp to the corresponding path:
string modelFile = the path of your deploy file;string trainedFile = the path of your caffemodel file; -
Put the images in the data folder. Or, you can change the parameter in the src/caffe_cpp_demo.cpp to the corresponding path:
string image_path = the path of your images; -
Change INCLUDE_DIRECTORIES and LINK_DIRECTORIES for cuda, opencv, caffe, boost, gflags, and glog in CMakeLists.txt.
-
Change working directory to current directory.
-
cd build -
cmake .. -
make -
sudo ./segDemoCPP