音视频人脸、目标识别,音视频推流学习笔记01

最新代码上传到gitee
git clone https://gitee.com/harry12345123/ffmpeg_arc_face-recognize.git

用户名:Harry12345123
密码:Aa123456

git clone https://gitee.com/harry12345123/FFMPEG_DNN_Project.git

用户名:Harry12345123
密码:Aa123456

然后新进群的朋友,可以先搭建一下开发环境(后面暂时使用rk的rv1126平台),具体教程可以参考我前天公众号的文章;基础差的朋友,周末会录视频教程把搭建环境讲解一下,因为有的安装编译时间比较久,所以这个不会在线录制,那样时间太长了,细节的东西参考前天写的文章就好,遇到问题,群里随时沟通,白天上班可能回复慢点,
晚上下班一定会回复!大家遇到问题一定要多交流哈

大家记得每次在拉项目的时候,注意要git pull更新

GITHUB上地址

DNN目标识别代码
git clone https://github.com/Harry12345123/ffmpeg_dnn_project.git

虹软人脸识别代码:
git clone https://github.com/Harry12345123/ffmpeg_arc_face-recognize.git

RV1126人脸检测代码:
git clone https://gitee.com/harry12345123/rv1126_face_project.git

RV1126人脸识别代码:
git clone https://gitee.com/harry12345123/rv1126_face_recognize.git

RV1126目标识别代码:
git clone https://gitee.com/harry12345123/rv1126_object_recognize.git

RV1126+FFMPEG推流代码:
git clone https://gitee.com/harry12345123/rv1126_ffmpeg_project.git

大家还有一点要注意的,就是那个交叉编译的库,一定要是商家提供的,不要网上随便找。否则很容易出问题

ISP部分:
大家注意,我上传代码里面的ISP部分大家可以自行删掉。因为我的1126板子是必须要有ISP模块才能够正常显示的。但这个ISP模块会不会影响到大家的板子,这点就不得而知了。所以我的建议是把ISP部分都删掉。

VI节点问题:
还有一个重要的地方就是设备节点,设备节点最好根据供应商的example进行修改,每个供应商提供的设备节点是不一样的。所以大家拿到example代码后,要看看如何修改设备节点。,后配合上传的代码进行运行。


开发环境dockerfile参考

# syntax=docker/dockerfile:1.2
#
# NOTE: To build this you will need a docker version > 18.06 with
#       experimental enabled and DOCKER_BUILDKIT=1
#
#       If you do not use buildkit you are not going to have a good time
#
#       For reference:
#           https://docs.docker.com/develop/develop-images/build_enhancements/

# enable python version of auto-load scripts in gdb
FROM python:3.8-bullseye as python_base

# config env remote source
RUN set -ex \
    # add multiple pip sources
    && pip3 config set global.index-url "https://mirrors.huaweicloud.com/repository/pypi/simple/" \
    && pip3 config set global.extra-index-url "https://pypi.tuna.tsinghua.edu.cn/simple/ https://pypi.ngc.nvidia.com https://mirrors.huaweicloud.com/repository/pypi/simple https://mirror.sjtu.edu.cn/pypi/web/simple" \
    && pip3 config set global.timeout 20 \
    && pip3 config set global.trusted-host "pypi.tuna.tsinghua.edu.cn pypi.ngc.nvidia.com mirrors.huaweicloud.com mirror.sjtu.edu.cn/pypi/web/simple" \
    # add new apt source
    && cp /etc/apt/sources.list /etc/apt/sources.list.bak \
    && sed -i "s|http://deb.debian.org/debian|http://mirror.sjtu.edu.cn/debian|g" /etc/apt/sources.list \
    && apt-get update && apt-get install -y apt-transport-https ca-certificates  \
    && ln -s /lib/x86_64-linux-gnu/libtinfo.so.6 /lib/x86_64-linux-gnu/libtinfo.so.5 \
    # dumb-init is used to optimize start the service, see https://github.com/Yelp/dumb-init
    && pip3 install dumb-init \
    && rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/* /tmp/* ~/.cache -rf

ENV LC_ALL C.UTF-8

ENV LANG C.UTF-8

FROM python_base as build_env

# set up an env for build
RUN set -ex \
    && pip3 install cmake \
    && apt-get update \
    && apt-get install -y --no-install-recommends build-essential git ccache libomp5 \
    && mkdir /opt/ccache && ccache --set-config=cache_dir=/opt/ccache \
    && rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/* /tmp/* \
    && rm ~/.cache -rf

FROM build_env as python_pack_pkg

ENV PIP_CACHE_DIR /opt/deploy/.pip_cache

COPY ./requirements.* /opt/deploy/requirements/


RUN --mount=type=cache,target=/opt/deploy/.pip_cache,id=pip_cache,sharing=shared \
    pip3 wheel --wheel-dir /opt/deploy/packages -r /opt/deploy/requirements/requirements.txt -r /opt/deploy/requirements/requirements.gpu.txt

RUN set -ex \
    # prevent download pkgs online again
    && sed -i '/extra-index-url/,+d' /opt/deploy/requirements/requirements.txt \
    && sed -i '/extra-index-url/,+1d' /opt/deploy/requirements/requirements.gpu.txt

FROM build_env as cpp_build_pkg

WORKDIR /opt/deploy

ADD cpp_module_updator.py /opt/deploy/
ADD ci_scripts/collect.sh /opt/deploy/ci_scripts/collect.sh
ADD drawing-recognition /opt/deploy/drawing-recognition

RUN --mount=type=cache,target=/opt/ccache,id=cc_cache,sharing=locked \
    python3 cpp_module_updator.py && ./ci_scripts/collect.sh cpp_modules/interface.* cpp_modules/

FROM python_base as python_env

COPY --from=python_pack_pkg /opt/deploy/requirements/* /opt/deploy/requirements/
COPY --from=python_pack_pkg /opt/deploy/packages/* /opt/deploy/packages/

CMD ["pip3", "install", "--no-index", "--find-links=/opt/deploy/packages" ,"-r" ,"/opt/deploy/requirements/requirements.txt" ,"-r", "/opt/deploy/requirements/requirements.gpu.txt"]

FROM python_base as dispatch

WORKDIR /opt/deploy

LABEL \
    link="" \
    maintainers=""

ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/opt/deploy/cpp_modules/

COPY ./ci_scripts/pre_start.sh /usr/local/bin/
COPY --from=python_pack_pkg /opt/deploy/requirements/* /opt/deploy/requirements/
COPY --from=python_pack_pkg /opt/deploy/packages/* /opt/deploy/packages/
COPY --from=cpp_build_pkg /opt/deploy/cpp_modules/* /opt/deploy/cpp_modules/

# runtime srcs
ADD *.py /opt/deploy/
ADD ./utility /opt/deploy/utility
ADD ./message_ex /opt/deploy/message_ex
ADD ./dwg_to_image /opt/deploy/dwg_to_image
ADD ./dispatch /opt/deploy/dispatch
ADD ./cpp_modules /opt/deploy/cpp_modules
ADD ./configs /opt/deploy/configs
ADD ./cacher /opt/deploy/cacher
ADD ./analysis /opt/deploy/analysis


ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]

# exec is a must, see https://en.wikipedia.org/wiki/Exec_(system_call)
CMD ["bash", "-c","pre_start.sh && exec python3 main.py"]

你可能感兴趣的:(1.C/C++编程,3.Linux系统使用,12.开发笔记,音视频,学习)