mirror of
				https://github.com/PaddlePaddle/FastDeploy.git
				synced 2025-10-31 20:02:53 +08:00 
			
		
		
		
	
		
			
				
	
	
	
		
			1.5 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			1.5 KiB
		
	
	
	
	
	
	
	
English | 中文
自定义OpenCV版本
受限于不同平台限制,目前FastDeploy提供的预编译包在Linux平台内置的OpenCV无法读取视频,或调用imshow等操作。对于有这类需求的开发者,可根据本文档来自行编译FastDeploy。
FastDeploy目前支持通过-DOPENCV_DIRECTORY来指定环境中的OpenCV版本,以Ubuntu为例,我们可以按照如下方式编译安装。
CPU C++ SDK
1. 安装Opencv
sudo apt-get install libopencv-dev
2. 指定OpenCV编译FastDeploy
git clone https://github.com/PaddlePaddle/FastDeploy
cd FastDeploy
mkdir build && cd build
cmake .. -DENABLE_ORT_BACKEND=ON \
         -DENABLE_PADDLE_BACKEND=ON \
         -DENABLE_OPENVINO_BACKEND=ON \
         -DENABLE_VISION=ON \
         -DCMAKE_INSTALL_PREFIX=${PWD}/installed_fastdeploy \
         -DOPENCV_DIRECTORY=/usr/lib/x86_64-linux-gnu/cmake/opencv4
make -j8
make install
编译完成的C++ SDK即为当前目录下的installed_fastdeploy,使用这个新的SDK即可。
其它部署硬件上的编译方式同理,通过-DOPENCV_DIRECTORY指定环境中的OpenCV编译即可, 注意此处的路径/usr/lib/x86_64-linux-gnu/cmake/opencv4需根据你的实际环境路径来设定,此目录下包含OpenCVConfig-version.cmake、OpenCVConfig.cmake等文件。
