README.md 2.52 KB
Newer Older
limm's avatar
limm committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# <div align="center"><strong>Detectron2</strong></div>
## 简介
Detectron2 是 Facebook AI Research 的下一代软件系统实现最先进的对象检测算法

## 安装
### 使用pip方式安装
- detectron2 whl包下载目录:[http://10.6.10.68:8000/customized/detectron2/dtk2310/](http://10.6.10.68:8000/customized/detectron2/dtk2310/). 目前只提供有python3.8, pytorch2.1版本的安装包 (内网whl包安装, 不保证链接一直有效,无安装包推荐源码编译)
  ```shell
  pip install detectron2* (下载的detectron2的whl包)
  ```

- 也可以在光合[光合开发者社区](https://developer.hpccube.com/tool/#sdk) AI 生态包中获取最新的 detectron2 Release 版本(需对应 DCU Toolkit 版本与 python 版本)
  ```bash
  python3 -m pip install detectron2-0.1.3-cp38-cp38-linux_x86_64.whl
  ```
### 使用源码编译方式安装

#### 编译环境准备
- 安装相关依赖
  ```shell
  pip install numpy
  pip install 'urllib3==1.26.14'
  pip install wheel
24
  pip install opencv-python
limm's avatar
limm committed
25
26
27
  ```
- 拉取 detectron2 代码
  ```
28
  git clone -b v0.6-fastpt http://developer.hpccube.com/codes/OpenDAS/detectron2.git
limm's avatar
limm committed
29
30
31
  ```


32
33
- 在首页 | 光合开发者社区下载 dtk25.04 解压在 /opt/ 路径下,并建立软连接,例如:
[开发者社区](https://developer.hpccube.com/tool/#sdk) DCU Toolkit 中下载 DTK-25.04 解压至 /opt/ 路径下,并建立软链接
limm's avatar
limm committed
34
  ```
35
  cd /opt && ln -s dtk-25.04 dtk
limm's avatar
limm committed
36
37
38
  ```

- 安装pytorch. fastpt whl包下载目录: [开发者社区](https://das.sourcefind.cn:55011/portal/#/home). 根据需求下载对应的版本,
39
  以torch whl包为例[http://10.16.4.1:8000/debug/pytorch/dtk25.04/](http://10.16.4.1:8000/debug/pytorch/dtk25.04/)只提供例子,具体需要根据环境安装不同的whl包 安装如下:
limm's avatar
limm committed
40
41
42
43
44
  ```shell
  pip install torch* (下载的torch的whl包)
  pip install fastpt* (下载的fastpt的whl包,fastpt包安装在torch包后面)
  ```
#### 源码编译
45

limm's avatar
limm committed
46
47
  ```shell
  export FORCE_CUDA=1
48
49
50
51
52
  source /usr/local/bin/fastpt -C
  ```

- 方案一 (优先推荐方案一)
  ```shell
limm's avatar
limm committed
53
54
  python -m pip install -e detectron2 或者 cd detectron2 && pip install -e .
  ```
55
- 方案二, 编译whl包
limm's avatar
limm committed
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
  ```
  cd detectron2
  python setup.py install --user bdist_wheel
  pip install dist/detectron2*
  ```
## 单侧
```shell
cd detectron2
python -m unittest discover -v -s ./tests
```
## Known Issue
```

```
## 参考资料
- [README_ORIGIN](README_ORIGIN.md)
- [https://github.com/facebookresearch/detectron2.git](https://github.com/facebookresearch/detectron2.git)