Skip to content

Commit 3720165

Browse files
authored
[cherry pick] update install doc (#2691)
* update install doc
1 parent f4f9139 commit 3720165

File tree

4 files changed

+53
-67
lines changed

4 files changed

+53
-67
lines changed

docs/tutorials/INSTALL.md

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,36 +19,7 @@ For general information about PaddleDetection, please see [README.md](https://gi
1919

2020
## Instruction
2121

22-
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.
23-
24-
25-
### 1. (Recommended) Prepare docker environment
26-
27-
For example, the environment is CUDA10.1 and CUDNN 7.6
28-
29-
```bash
30-
# Firstly, pull the PaddlePaddle image
31-
sudo docker pull paddlepaddle/paddle:latest-dev-cuda10.1-cudnn7-gcc82
32-
33-
# Switch to the working directory
34-
cd /home/work
35-
36-
# Create a container called ppdet and
37-
# mount the current directory which may contains the dataset
38-
# to /paddle directory in the container
39-
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
40-
```
41-
42-
You can see [DockerHub](https://hub.docker.com/r/paddlepaddle/paddle/tags/) to get the image that matches your machine.
43-
44-
```
45-
# ctrl+P+Q to exit docker, to re-enter docker using the following command:
46-
sudo docker exec -it ppdet /bin/bash
47-
```
48-
49-
For more docker usage, please refer to the PaddlePaddle [document](https://www.paddlepaddle.org.cn/documentation/docs/en/install/docker/fromdocker_en.html).
50-
51-
### 2. Install PaddlePaddle
22+
### 1. Install PaddlePaddle
5223

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

8152

82-
### 3. Install PaddleDetection
53+
### 2. Install PaddleDetection
54+
55+
PaddleDetection can be installed in the following two ways:
56+
57+
#### 2.1 Install via pip
58+
59+
**Note:** Installing via pip only supports Python3
60+
61+
```
62+
# install paddledet via pip
63+
pip install paddledet==2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
64+
65+
# Download and use the configuration files and code examples in the source code
66+
git clone https://github.com/PaddlePaddle/PaddleDetection.git
67+
cd PaddleDetection
68+
```
8369

70+
#### 2.2 Compile and install from Source code
8471

8572
```
8673
# Clone PaddleDetection repository
@@ -116,8 +103,6 @@ Ran 12 tests in 2.480s
116103
OK (skipped=2)
117104
```
118105

119-
120-
121106
## Inference demo
122107

123108
**Congratulation!** Now you have installed PaddleDetection successfully and try our inference demo:

docs/tutorials/INSTALL_cn.md

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,7 @@
1919

2020
## 安装说明
2121

22-
建议使用docker环境安装PaddleDetection并开启你的目标检测之旅。请按照如下步骤说明进行安装,如果您希望使用本机环境,可以跳过步骤1.
23-
24-
### 1. (推荐)准备docker环境
25-
26-
已CUDA10.1, CUDNN7.6为例
27-
28-
```bash
29-
# 首先拉去PaddlePaddle镜像
30-
sudo docker pull paddlepaddle/paddle:latest-dev-cuda10.1-cudnn7-gcc82
31-
32-
# 切换到工作目录
33-
cd /home/work
34-
35-
# 创建ppdet容器
36-
# 将存放数据的当前目录映射到容器中的/ppdet目录中
37-
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
38-
```
39-
40-
可以在[DockerHub](https://hub.docker.com/r/paddlepaddle/paddle/tags/) 中找到匹配您机器环境的镜像
41-
42-
```
43-
# ctrl+P+Q 退出容器, 使用如下命令重新进入docker环境:
44-
sudo docker exec -it ppdet /bin/bash
45-
```
46-
47-
其他更多docker用法,请参考PaddlePaddle[文档](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/docker/fromdocker.html)
48-
49-
50-
### 安装PaddlePaddle
22+
### 1. 安装PaddlePaddle
5123

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

78-
### 3. 安装PaddleDetection
50+
### 2. 安装PaddleDetection
51+
52+
可通过如下两种方式安装PaddleDetection
53+
54+
#### 2.1 通过pip安装
55+
56+
**注意:** pip安装方式只支持Python3
57+
58+
```
59+
# pip安装paddledet
60+
pip install paddledet==2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
61+
62+
# 下载使用源码中的配置文件和代码示例
63+
git clone https://github.com/PaddlePaddle/PaddleDetection.git
64+
cd PaddleDetection
65+
```
66+
67+
#### 2.2 源码编译安装
7968

8069
```
8170
# 克隆PaddleDetection仓库

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ scipy
88
terminaltables
99
pycocotools
1010
setuptools>=42.0.0
11+
12+
# extension OPs for rotation bbox
13+
rbox_iou_ops

setup.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import glob
1818
import shutil
1919
from setuptools import find_packages, setup
20+
from paddle.utils import cpp_extension
2021

2122

2223
def readme():
@@ -59,17 +60,25 @@ def package_model_zoo():
5960
'ppdet.metrics',
6061
'ppdet.modeling',
6162
'ppdet.model_zoo',
62-
'ppdet.py_op',
63+
'ppdet.slim',
6364
'ppdet.utils',
6465
]
6566

6667
if __name__ == "__main__":
68+
# install extension APIs for rotation bbox
69+
from paddle.utils import cpp_extension
70+
cpp_extension.setup(
71+
name='rbox_iou_ops',
72+
ext_modules=cpp_extension.CUDAExtension(sources=[
73+
'ppdet/ext_op/rbox_iou_op.cc', 'ppdet/ext_op/rbox_iou_op.cu'
74+
]))
75+
6776
setup(
68-
name='ppdet',
77+
name='paddledet',
6978
packages=find_packages(exclude=("configs", "tools", "deploy")),
7079
package_data={'ppdet.model_zoo': package_model_zoo()},
7180
author='PaddlePaddle',
72-
version='2.0-rc',
81+
version='2.0',
7382
install_requires=parse_requirements('./requirements.txt'),
7483
description='Object detection and instance segmentation toolkit based on PaddlePaddle',
7584
long_description=readme(),
@@ -88,4 +97,4 @@ def package_model_zoo():
8897
'Programming Language :: Python :: 3.7', 'Topic :: Utilities'
8998
],
9099
license='Apache License 2.0',
91-
ext_modules=[], )
100+
ext_modules=[])

0 commit comments

Comments
 (0)