deepstream6.1 python环境安装

1.下载docker镜像

在官方网址可以选择合适的版本:
https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_docker_containers.html#a-docker-container-for-dgpu

docker pull nvcr.io/nvidia/deepstream:6.1-triton

2.启动容器

参数根据自己机器配置进行设置

docker run --gpus=all --shm-size=12g --ulimit memlock=-1 --ulimit stack=67108864 -it --name ds6 nvcr.io/nvidia/deepstream:6.1-triton

3.安装库

apt-get update
apt install python3-gi python3-dev python3-gst-1.0 python-gi-dev git python-dev \
    python3 python3-pip python3.8-dev cmake g++ build-essential libglib2.0-dev \
    libglib2.0-dev-bin python-gi-dev libtool m4 autoconf automake

4.克隆python示例项目及子项目

cd /opt/nvidia/deepstream/deepstream/sources
export GIT_SSL_NO_VERIFY=true 
git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps.git
cd deepstream_python_apps
git submodule update --init

如果克隆慢,手动用gitee镜像下载

cd /opt/nvidia/deepstream/deepstream/sources
export GIT_SSL_NO_VERIFY=true 
git clone https://gitee.com/qst1998/deepstream_python_apps.git
cd deepstream_python_apps/3rdparty
rm -rf *
git clone https://gitee.com/qst1998/gst-python.git
cd gst-python
git checkout 1a8f48a
git clone https://gitee.com/qst1998/pybind11.git
cd ../pybind11
git checkout 3b1dbeb

5. 安装gst-python

cd ../gst-python
./autogen.sh
make
make install

6. 编译安装python-binding

cd ../../bindings/
mkdir build
cd build
cmake ..  -DPYTHON_MAJOR_VERSION=3 -DPYTHON_MINOR_VERSION=8
make
pip3 install ./pyds-1.1.2-py3-none*.whl

参考:

https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/tree/master/bindings

你可能感兴趣的:(Deepstream,深度学习,python,gstreamer,docker,nvidia)