Commit ba2b83b0 authored by chenych's avatar chenych
Browse files

modified some infos

parent 5af5f770
...@@ -23,13 +23,12 @@ DETR将目标检测看作一种set prediction问题,并提出了一个十分 ...@@ -23,13 +23,12 @@ DETR将目标检测看作一种set prediction问题,并提出了一个十分
### Docker(方法一) ### Docker(方法一)
``` ```
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.13.1-centos7.6-dtk-23.04-py38-latest docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.13.1-centos7.6-dtk-23.04.1-py38-latest
docker run -it -v /path/your_code_data/:/path/ your_code_data/ --shm-size=32G --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name docker_name imageID bash docker run -it -v /path/your_code_data/:/path/ your_code_data/ --shm-size=32G --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name docker_name imageID bash
cd /your_code_path/detr_pytorch cd /your_code_path/detr_pytorch
pip install -r requirements.txt pip install -r requirements.txt
pip install git+https://github.com/cocodataset/panopticapi.git
``` ```
### Dockerfile(方法二) ### Dockerfile(方法二)
...@@ -43,7 +42,6 @@ docker run -it -v /path/your_code_data/:/path/your_code_data/ --shm-size=32G --p ...@@ -43,7 +42,6 @@ docker run -it -v /path/your_code_data/:/path/your_code_data/ --shm-size=32G --p
cd /your_code_path/detr_pytorch cd /your_code_path/detr_pytorch
pip install -r requirements.txt pip install -r requirements.txt
pip install git+https://github.com/cocodataset/panopticapi.git
``` ```
### Anaconda(方法三) ### Anaconda(方法三)
...@@ -51,7 +49,7 @@ pip install git+https://github.com/cocodataset/panopticapi.git ...@@ -51,7 +49,7 @@ pip install git+https://github.com/cocodataset/panopticapi.git
1、关于本项目DCU显卡所需的特殊深度学习库可从光合开发者社区下载安装: https://developer.hpccube.com/tool/ 1、关于本项目DCU显卡所需的特殊深度学习库可从光合开发者社区下载安装: https://developer.hpccube.com/tool/
``` ```
DTK软件栈:dtk23.04 DTK软件栈:dtk23.04.1
python:python3.8 python:python3.8
torch:1.13.1 torch:1.13.1
torchvision:0.14.1 torchvision:0.14.1
...@@ -59,11 +57,10 @@ torchvision:0.14.1 ...@@ -59,11 +57,10 @@ torchvision:0.14.1
Tips:以上dtk软件栈、python、torch等DCU相关工具版本需要严格一一对应 Tips:以上dtk软件栈、python、torch等DCU相关工具版本需要严格一一对应
2、其他非特殊库直接按照下面步骤进行安装 2、其他非特殊库直接按照requirements.txt安装
``` ```
pip install -r requirements.txt pip install -r requirements.txt
pip install git+https://github.com/cocodataset/panopticapi.git
``` ```
## 数据集 ## 数据集
...@@ -81,13 +78,14 @@ COCO2017 ...@@ -81,13 +78,14 @@ COCO2017
数据集的目录结构如下: 数据集的目录结构如下:
``` ```
├── images ├── COCO2017
│ ├── train2017 │ ├── images
│ ├── val2017 │ ├── train2017
│ └── test2017 │ ├── val2017
├── annotations │ └── test2017
│ ├── instances_train2017.json │ ├── annotations
│ └── instances_val2017.json │ ├── instances_train2017.json
│ └── instances_val2017.json
``` ```
训练/验证集数据准备: 训练/验证集数据准备:
...@@ -96,22 +94,32 @@ COCO2017 ...@@ -96,22 +94,32 @@ COCO2017
## 训练 ## 训练
### 单机单卡 ### 单机单卡/单机多卡
修改train.sh中HIP_VISIBLE_DEVICES数据,实现单卡或者多卡训练
``` ```
bash train.sh bash train.sh
``` ```
### 单机多卡 ## 推理
验证前需提前准备好预训练模型,并将coco_path设置为当前环境中推理数据的对应地址,数据应为COCO数据格式
如果想要查看预测效果(预测结果输出到图片上),请执行
``` ```
bash train_multi.sh python test.py --pre_trained_model <checkpoint path> --coco_path <coco path>
``` ```
## 推理 其余对应参数与训练模型参数需一致,详情请参考代码里面的参数配置
#### 单卡推理
``` ```
sh xxx.sh 或python xxx.py bash val.sh
``` ```
## result ## result
...@@ -121,8 +129,8 @@ sh xxx.sh 或python xxx.py ...@@ -121,8 +129,8 @@ sh xxx.sh 或python xxx.py
### 精度 ### 精度
在COCO2017的测试集上进行单卡测试,结果如下表所示
根据测试结果情况填写表格:
| xxx | xxx | xxx | xxx | xxx | | xxx | xxx | xxx | xxx | xxx |
| :------: | :------: | :------: | :------: |:------: | | :------: | :------: | :------: | :------: |:------: |
| xxx | xxx | xxx | xxx | xxx | | xxx | xxx | xxx | xxx | xxx |
...@@ -134,10 +142,10 @@ sh xxx.sh 或python xxx.py ...@@ -134,10 +142,10 @@ sh xxx.sh 或python xxx.py
目标检测 目标检测
### 热点应用行业 ### 热点应用行业
教育,交通,公安 网安,交通,政府
## 源码仓库及问题反馈 ## 源码仓库及问题反馈
http://developer.hpccube.com/codes/modelzoo/detr_pytorch.git http://developer.hpccube.com/codes/modelzoo/detr_pytorch.git
## 参考资料 ## 参考资料
https://github.com/facebookresearch/detr.git https://github.com/facebookresearch/detr.git
\ No newline at end of file
...@@ -149,8 +149,8 @@ def build(image_set, args): ...@@ -149,8 +149,8 @@ def build(image_set, args):
assert root.exists(), f'provided COCO path {root} does not exist' assert root.exists(), f'provided COCO path {root} does not exist'
mode = 'instances' mode = 'instances'
PATHS = { PATHS = {
"train": (root / "images/train2017", root / "annotations" / "annotations" / f'{mode}_train2017.json'), "train": (root / "images/train2017", root / "annotations" / f'{mode}_train2017.json'),
"val": (root / "images/val2017", root / "annotations" / "annotations" / f'{mode}_val2017.json'), "val": (root / "images/val2017", root / "annotations" / f'{mode}_val2017.json'),
} }
img_folder, ann_file = PATHS[image_set] img_folder, ann_file = PATHS[image_set]
......
FROM image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.13.1-centos7.6-dtk-23.04-py38-latest FROM image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.13.1-centos7.6-dtk-23.04.1-py38-latest
RUN source /opt/dtk/env.sh RUN source /opt/dtk/env.sh
COPY requirements.txt requirements.txt COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt RUN pip3 install -r requirements.txt
# 模型唯一标识 # 模型唯一标识
modelCode=466 modelCode=xxx
# 模型名称 # 模型名称
modelName=detr_pytorch modelName=detr_pytorch
# 模型描述 # 模型描述
modelDescription=DETR modelDescription=DETR
# 应用场景 # 应用场景
appScenario=推理,训练,目标检测,教育,交通,公安 appScenario=推理,训练,目标检测,网安,交通,政府
# 框架类型 # 框架类型
frameType=PyTorch frameType=PyTorch
...@@ -6,3 +6,4 @@ torchvision>=0.6.0 ...@@ -6,3 +6,4 @@ torchvision>=0.6.0
scipy scipy
onnx onnx
onnxruntime onnxruntime
git+https://github.com/cocodataset/panopticapi.git
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment