快速构建基于Paddle Serving部署的Paddle Detection目标检测Docker镜像

news/2024/7/10 2:09:57 标签: paddle, 目标检测, docker

快速构建基于Paddle Serving部署的Paddle Detection目标检测Docker镜像

  • 项目介绍
  • 需要重点关注的几个文件
      • 构建cpu版本的docker
      • 构建gpu版本的docker(cuda11.2+cudnn8)

阅读提示:
(1)Paddle的Serving项目中,在tools文件下,已提供了丰富的Dockerfile,可供参考,有点让人眼花缭乱。
(2)需要熟悉serving部署,port通过内部的config.yml来指定,此处Dockerfile内可不指定port。
(3)本文只介绍4个重要的文件,操作细节懂的都懂,不再赘述。

项目介绍

本项目采用Paddle Detection框架开发目标检测服务,采用Paddle Serving提供Web服务,采用Docker方式打包服务,方便部署。
本项目目录如下:
Alt

需要重点关注的几个文件

docker_10">构建cpu版本的docker

指令:docker build -t aep-aiplus-ppyoloe-multiclass:cpu-1.0.0 -f ./Dockerfile-cpu .

  • Dockerfile-cpu文件
FROM python:3.8.16
COPY . /aep-aiplus-ppyoloe-multiclass
WORKDIR /aep-aiplus-ppyoloe-multiclass
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
    && sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
    && apt-get clean \
    && apt update \
    && apt-get install -y libgl1-mesa-dev \
    && pip config set global.index-url https://mirror.baidu.com/pypi/simple \
    && pip install --upgrade setuptools \
    && pip install --upgrade pip \
    && pip install -r requirements.txt
CMD ["python", "web_service.py"]
  • requirements.txt文件
paddlepaddle==2.2.2
paddle-serving-client==0.9.0
paddle-serving-app==0.9.0
paddle-serving-server==0.9.0

dockercuda112cudnn8_39">构建gpu版本的docker(cuda11.2+cudnn8)

指令:docker build -t aep-aiplus-ppyoloe-multiclass:cu1102-1.0.0 -f ./Dockerfile-cuda1102-cudnn8 .

  • Dockerfile-cuda1102-cudnn8文件
FROM registry.baidubce.com/paddlepaddle/paddle:2.2.2-gpu-cuda11.2-cudnn8
COPY . /aep-aiplus-ppyoloe-multiclass
WORKDIR /aep-aiplus-ppyoloe-multiclass
RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
RUN sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
RUN apt-get clean
RUN rm /etc/apt/sources.list.d/cuda.list
RUN rm /etc/apt/sources.list.d/nvidia-ml.list
RUN apt update
RUN apt-get install -y libgl1-mesa-dev
RUN pip3 config set global.index-url https://mirror.baidu.com/pypi/simple
RUN pip3 install --upgrade pip
RUN pip3 install -r requirements-gpu.txt
CMD ["python", "web_service.py"]
  • requirements-gpu.txt文件
paddle-serving-client==0.9.0
paddle-serving-app==0.9.0
paddle-serving-server-gpu==0.9.0.post112

http://www.niftyadmin.cn/n/5012123.html

相关文章

用 Python 微调 ChatGPT (GPT-3.5 Turbo)

用 Python 微调 ChatGPT (GPT-3.5 Turbo) 备受期待的 GPT-3.5 Turbo 微调功能现已推出,并且为今年秋季即将发布的 GPT-4 微调功能奠定了基础。 这不仅仅是一次简单的更新——它是一个游戏规则改变者,为开发人员提供了完美定制人工智能模型的关键解决方案…

目标检测YOLO实战应用案例100讲-基于YOLOv5自适应损失权重的生活垃圾目标检测模型

目录 前言 2 YOLOv5模型及其相关理论基础 2.1 交并比损失 2.1.1 IoU损失 2.1.2 GIoU损失

解决 vue 项目开发越久 node_modules包越大的问题

vue 每次编译都会将编译后的文件缓存在 node_modules /.cache 里面,因此需要在 vue.config.js 配置取消缓存 compression-webpack-plugin 禁止缓存 const CompressionPlugin require("compression-webpack-plugin");module.exports {plugins: [new Com…

【JavaScript】JS语法入门到实战

文章目录 一、初识JavaScript1. 什么是JavaScript?2. JavaScript 和 HTML 和 CSS 之间的关系3. JavaScript的运行过程4. JavaScript的组成 二、JavaScript的书写形式三、变量1. 输入输出2. 变量的使用3. 数据类型 四、运算符五、分支和循环语句1. 分支语句2. 循环语…

232 - Crossword Answers (UVA)

这道题因为我把puzzle打成了Puzzle&#xff0c;卡了我很久…………真的太无语了。 题目链接如下&#xff1a; Online Judge 我的代码如下&#xff1a; #include <cstdio> #include <cctype> #include <set> const int maxx 10;int r, c, kase, cnt, tem…

Voxel R-CNN:基于体素的高性能 3D 目标检测

论文地址&#xff1a;https://arxiv.org/abs/2012.15712 论文代码&#xff1a;https://github.com/djiajunustc/Voxel-R-CNN 论文背景 基于点的方法具有较高的检测精度&#xff0c;但基于点的方法通常效率较低&#xff0c;因为对于点集抽象来说&#xff0c;使用点表示来搜索最…

Python Django框架中文教程:学习简单、灵活、高效的Web应用程序框架

概述: Python Django是一种流行的Web应用程序框架&#xff0c;被广泛应用于开发高效、可扩展的网站和Web应用程序。Django以其简单、灵活和高效而受到开发者们的青睐。它提供了强大的工具和功能&#xff0c;使开发过程更加容易和高效。 Django的主要目标是帮助开发者快速构建…

Spring for Apache Kafka概述和简单入门

一、概述 Spring for Apache Kafka 的高级概述以及底层概念和可运行的示例代码。 二、准备工作 注意&#xff1a;进行工作开始之前至少要有一个 Apache Kafka 环境 2.1、依赖 使用 Spring Boot <dependency><groupId>org.springframework.kafka</groupId>…