Skip to content

Compile manual v1.0.0

taotianran edited this page Feb 7, 2023 · 1 revision

For easy compilation, we provide docker images for different platforms, you can also compile on your local machine.

Go to install docker(optional): Docker Installation

Contents



For Android Libraries

🖥️ Compile locally

# clone code
git clone git@github.com:PaddlePaddle/FlyCV.git
git checkout <branch name or tag name>
  
# set the ndk path, the NDK_PATH needs to be set to the NDK path on your local machine
export ANDROID_NDK=${NDK_PATH}

# compile
cd FlyCV
./scripts/android/build.sh

🐳 Compile in docker container

docker pull flycv/x86_64:android
docker attach
source /etc/ndk/r17c.env
./scripts/android/build.sh

For Armlinux Libraries

🖥️ Compile locally

# clone code
git clone git@github.com:PaddlePaddle/FlyCV.git
git checkout <branch name or tag name>

# compile
cd FlyCV
./scripts/armlinux/build.sh

For Macos Libraries

🖥️ Compile locally

# clone code
git clone git@github.com:PaddlePaddle/FlyCV.git
git checkout <branch name or tag name>

# compile
# if your computer is x86 architecture, execute the following command
cd FlyCV
./scripts/macos/build_x86.sh
  
# if your computer is arm architecture, execute the following command
./scripts/macos/build_arm.sh

For Windows Libraries

🖥️ Compile locally

# clone code
git clone git@github.com:PaddlePaddle/FlyCV.git
git checkout <branch name or tag name>  

# compile
# generate solutions with the following command
./scripts/windows/build.sh
  
# open the solution to compile with Visual Studio

For Linux Libraries

🖥️ Compile locally

# clone code
git clone git@github.com:PaddlePaddle/FlyCV.git
git checkout <branch name or tag name>  
  
# compile
./scripts/linux/build.sh

Compile Options Support

Namespace Compile options

compile options default description
📃 FLYCV_NAMESPACE flycv you can change to any customized namespace to avoid library conflicts

Function compile options

compile options default description
🗂️ BUILD_FCV_CORE ON core functions cannot be turned off
🗂️ BUILD_FCV_IMG_TRANSFORM ON image transform functions
📃 WITH_FCV_COLOR_CONVERT ON supports frequently used color space conversion functions
📃 WITH_FCV_RESIZE ON image resize
📃 WITH_FCV_WARP_AFFINE ON image affine transformation
📃 WITH_FCV_WARP_PERSPECTIVE ON image perspective transformation
📃 WITH_FCV_ROTATION ON image rotation
📃 WITH_FCV_FLIP ON image flipped along the axes
📃 WITH_FCV_SUBTRACT ON image subtraction
📃 WITH_FCV_COPY_MAKE_BORDER ON image border padding
📃 WITH_FCV_CROP ON crop image
📃 WITH_FCV_REMAP ON image remap
📃 WITH_FCV_ADD_WEIGHTED ON fusion of two images
📃 WITH_FCV_EXTRACT_CHANNEL ON extract the data of the specified channel
🗂️ BUILD_FCV_IMG_CALCULATION ON calculate from image
📃 WITH_FCV_MATRIX_MUL ON matrix multiplication
📃 WITH_FCV_NORM ON calculate image norm
📃 WITH_FCV_MEAN ON calculate image mean
📃 WITH_FCV_MIN_AREA_RECT ON generate the min bounding rectangle
📃 WITH_FCV_MIN_MAX_LOC ON get the minimum and maximum coordinate points
📃 WITH_FCV_CONNECTED_COMPONENTS ON calculate the connected domain
📃 WITH_FCV_FIND_HOMOGRAPHY ON calculate the optimal single-map transformation
🗂️ BUILD_FCV_FUSION_API ON fusion of image processing
📃 WITH_FCV_BGR_TO_RGBA_WITH_MASK ON convert bgr to bgra with mask
📃 WITH_FCV_NORMALIZE_TO_SUBMEAN_TO_REORDER ON image normalize & submean & reorder
📃 WITH_FCV_SPLIT_TO_MEMCPY ON split image and copy to the specific memory
📃 WITH_FCV_Y420SP_TO_RESIZE_TO_BGR ON convert yuv to bgr with resize
📃 WITH_FCV_BGRA_TO_RESIZE_TO_BGR ON convert bgra to bgr with resize
🗂️ BUILD_FCV_MATH_OPERATOR ON base math operators
📃 WITH_FCV_VECTOR_OPERATOR ON vector operators
🗂️ BUILD_FCV_MEDIA_IO ON media io
📃 WITH_FCV_IMGCODECS ON image codesc
📃 WITH_LIB_JPEG_TURBO ON support jpg codesc
📃 WITH_LIB_PNG ON support png codesc
🗂️ BUILD_FCV_IMG_DRAW ON drawing on image
📃 WITH_FCV_FILL_POLY ON polygon drawing and filling
📃 WITH_FCV_POLY_LINES ON polygon drawing
📃 WITH_FCV_CIRCLE ON circle drawing
📃 WITH_FCV_LINE ON line drawing

CPU compile options

compile options default description
🚀 ENABLE_SSE ON enable SSE instruction set optimization on x86 architecture
🚀 ENABLE_AVX ON enable AVX instruction set optimization on x86 architecture
🚀 ANDROID_ARM_NEON ON enable neon instruction set optimization on arm architecture
🚀 ENABLE_NEON ON enable neon instruction set optimization on arm architecture
🚀 ENABLE_SVE2 OFF enable SVE2 instruction set optimization on arm architecture

Other compile options

compile options default description
🔖 BUILD_TEST ON enable unit test
🔖 BUILD_BENCHMARK ON enable performance test
🔖 BUILD_SAMPLES ON enable samples