Skip to content

Latest commit

 

History

History

cpp

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Usage

Compile MNN library

Linx/Mac

git clone https://github.com/alibaba/MNN.git
# copy header file
cp -r MNN/include .
cp -r MNN/tools/cv/include .
cd MNN
mkdir build
cmake -DMNN_BUILD_OPENCV=ON -DMNN_IMGCODECS=ON ..
make -j8
cd ..
cp MNN/build/libMNN.so MNN/build/express/libMNN_Express.so MNN/build/tools/cv/libMNNOpenCV.so ./libs

Windows

# Visual Studio xxxx Developer Command Prompt
powershell
git clone https://github.com/alibaba/MNN.git
# copy header file
cp -r MNN/include .
cp -r MNN/tools/cv/include .
cd MNN
mkdir build
cmake -G "Ninja" -DMNN_BUILD_OPENCV=ON -DMNN_IMGCODECS=ON ..
ninja
cd ..
cp MNN.dll MNN.lib ./libs

Build and Run

Linux/Mac

mkdir build && cd build
cmake ..
make -j4
./sam_demo embed.mnn segment.mnn ../../resource/truck.jpg
# edge model need add `1`
./sam_demo edge_embed.mnn edge_segment.mnn ../../resource/truck.jpg 1

Windows

# Visual Studio xxxx Developer Command Prompt
powershell
mkdir build && cd build
cmake -G "Ninja" ..
ninja
./sam_demo embed.mnn segment.mnn ../../resource/truck.jpg
# edge model need add `1`
./sam_demo edge_embed.mnn edge_segment.mnn ../../resource/truck.jpg 1