Skip to content

Commit

Permalink
[cherry pick] update install doc (#2691)
Browse files Browse the repository at this point in the history
* update install doc
  • Loading branch information
heavengate committed Apr 19, 2021
1 parent f4f9139 commit 3720165
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 67 deletions.
51 changes: 18 additions & 33 deletions docs/tutorials/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,7 @@ For general information about PaddleDetection, please see [README.md](https://gi

## Instruction

It is recommened to install PaddleDetection and begin your object detection journey via docker environment. Please follow the instruction below and if you want to use your local environment, you could skip step 1.


### 1. (Recommended) Prepare docker environment

For example, the environment is CUDA10.1 and CUDNN 7.6

```bash
# Firstly, pull the PaddlePaddle image
sudo docker pull paddlepaddle/paddle:latest-dev-cuda10.1-cudnn7-gcc82

# Switch to the working directory
cd /home/work

# Create a container called ppdet and
# mount the current directory which may contains the dataset
# to /paddle directory in the container
sudo nvidia-docker run --name ppdet -v $PWD:/paddle --privileged --shm-size=4G --network=host -it paddlepaddle/paddle:latest-dev-cuda10.1-cudnn7-gcc82 /bin/bash
```

You can see [DockerHub](https://hub.docker.com/r/paddlepaddle/paddle/tags/) to get the image that matches your machine.

```
# ctrl+P+Q to exit docker, to re-enter docker using the following command:
sudo docker exec -it ppdet /bin/bash
```

For more docker usage, please refer to the PaddlePaddle [document](https://www.paddlepaddle.org.cn/documentation/docs/en/install/docker/fromdocker_en.html).

### 2. Install PaddlePaddle
### 1. Install PaddlePaddle

```
# CUDA9.0
Expand Down Expand Up @@ -79,8 +50,24 @@ python -c "import paddle; print(paddle.__version__)"
1. If you want to use PaddleDetection on multi-GPU, please install NCCL at first.


### 3. Install PaddleDetection
### 2. Install PaddleDetection

PaddleDetection can be installed in the following two ways:

#### 2.1 Install via pip

**Note:** Installing via pip only supports Python3

```
# install paddledet via pip
pip install paddledet==2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
# Download and use the configuration files and code examples in the source code
git clone https://github.com/PaddlePaddle/PaddleDetection.git
cd PaddleDetection
```

#### 2.2 Compile and install from Source code

```
# Clone PaddleDetection repository
Expand Down Expand Up @@ -116,8 +103,6 @@ Ran 12 tests in 2.480s
OK (skipped=2)
```



## Inference demo

**Congratulation!** Now you have installed PaddleDetection successfully and try our inference demo:
Expand Down
49 changes: 19 additions & 30 deletions docs/tutorials/INSTALL_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,7 @@

## 安装说明

建议使用docker环境安装PaddleDetection并开启你的目标检测之旅。请按照如下步骤说明进行安装,如果您希望使用本机环境,可以跳过步骤1.

### 1. (推荐)准备docker环境

已CUDA10.1, CUDNN7.6为例

```bash
# 首先拉去PaddlePaddle镜像
sudo docker pull paddlepaddle/paddle:latest-dev-cuda10.1-cudnn7-gcc82

# 切换到工作目录
cd /home/work

# 创建ppdet容器
# 将存放数据的当前目录映射到容器中的/ppdet目录中
sudo nvidia-docker run --name ppdet -v $PWD:/paddle --privileged --shm-size=4G --network=host -it paddlepaddle/paddle:latest-dev-cuda10.1-cudnn7-gcc82 /bin/bash
```

可以在[DockerHub](https://hub.docker.com/r/paddlepaddle/paddle/tags/) 中找到匹配您机器环境的镜像

```
# ctrl+P+Q 退出容器, 使用如下命令重新进入docker环境:
sudo docker exec -it ppdet /bin/bash
```

其他更多docker用法,请参考PaddlePaddle[文档](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/docker/fromdocker.html)


### 安装PaddlePaddle
### 1. 安装PaddlePaddle

```
# CUDA9.0
Expand Down Expand Up @@ -75,7 +47,24 @@ python -c "import paddle; print(paddle.__version__)"
**注意**
1. 如果您希望在多卡环境下使用PaddleDetection,请首先安装NCCL

### 3. 安装PaddleDetection
### 2. 安装PaddleDetection

可通过如下两种方式安装PaddleDetection

#### 2.1 通过pip安装

**注意:** pip安装方式只支持Python3

```
# pip安装paddledet
pip install paddledet==2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
# 下载使用源码中的配置文件和代码示例
git clone https://github.com/PaddlePaddle/PaddleDetection.git
cd PaddleDetection
```

#### 2.2 源码编译安装

```
# 克隆PaddleDetection仓库
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ scipy
terminaltables
pycocotools
setuptools>=42.0.0

# extension OPs for rotation bbox
rbox_iou_ops
17 changes: 13 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import glob
import shutil
from setuptools import find_packages, setup
from paddle.utils import cpp_extension


def readme():
Expand Down Expand Up @@ -59,17 +60,25 @@ def package_model_zoo():
'ppdet.metrics',
'ppdet.modeling',
'ppdet.model_zoo',
'ppdet.py_op',
'ppdet.slim',
'ppdet.utils',
]

if __name__ == "__main__":
# install extension APIs for rotation bbox
from paddle.utils import cpp_extension
cpp_extension.setup(
name='rbox_iou_ops',
ext_modules=cpp_extension.CUDAExtension(sources=[
'ppdet/ext_op/rbox_iou_op.cc', 'ppdet/ext_op/rbox_iou_op.cu'
]))

setup(
name='ppdet',
name='paddledet',
packages=find_packages(exclude=("configs", "tools", "deploy")),
package_data={'ppdet.model_zoo': package_model_zoo()},
author='PaddlePaddle',
version='2.0-rc',
version='2.0',
install_requires=parse_requirements('./requirements.txt'),
description='Object detection and instance segmentation toolkit based on PaddlePaddle',
long_description=readme(),
Expand All @@ -88,4 +97,4 @@ def package_model_zoo():
'Programming Language :: Python :: 3.7', 'Topic :: Utilities'
],
license='Apache License 2.0',
ext_modules=[], )
ext_modules=[])

0 comments on commit 3720165

Please sign in to comment.