未验证 提交 a0348fdb 编写于 作者: W wangxinxin08 提交者: GitHub

[Dygraph]add pedestrian and vehicle models (#2225)

* add pedestrian and vehicle models

* add pedestrian and vehicle json

* modify pedestrian and vehicle configs

* modify docs and links, test=dygraph
上级 38c30bb3
......@@ -146,7 +146,11 @@ PaddleDetection模块化地实现了多种主流目标检测算法,提供了
## 模型库
- [模型库](docs/MODEL_ZOO_cn.md)
- 通用目标检测:
- [模型库](docs/MODEL_ZOO_cn.md)
- 垂类领域:
- [行人检测](configs/pedestrian/README.md)
- [车辆检测](configs/vehicle/README.md)
## 许可证书
......
English | [简体中文](README_cn.md)
# PaddleDetection applied for specific scenarios
We provide some models implemented by PaddlePaddle to detect objects in specific scenarios, users can download the models and use them in these scenarios.
| Task | Algorithm | Box AP | Download | Configs |
|:---------------------|:---------:|:------:| :-------------------------------------------------------------------------------------: |:------:|
| Pedestrian Detection | YOLOv3 | 51.8 | [model](https://paddledet.bj.bcebos.com/models/pedestrian_yolov3_darknet.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/master/dygraph/configs/pedestrian/pedestrian_yolov3_darknet.yml) |
## Pedestrian Detection
The main applications of pedetestrian detection include intelligent monitoring. In this scenary, photos of pedetestrians are taken by surveillance cameras in public areas, then pedestrian detection are conducted on these photos.
### 1. Network
The network for detecting vehicles is YOLOv3, the backbone of which is Dacknet53.
### 2. Configuration for training
PaddleDetection provides users with a configuration file [yolov3_darknet53_270e_coco.yml](https://github.com/PaddlePaddle/PaddleDetection/blob/master/dygraph/configs/yolov3/yolov3_darknet53_270e_coco.yml) to train YOLOv3 on the COCO dataset, compared with this file, we modify some parameters as followed to conduct the training for pedestrian detection:
* num_classes: 1
* dataset_dir: dataset/pedestrian
### 3. Accuracy
The accuracy of the model trained and evaluted on our private data is shown as followed:
AP at IoU=.50:.05:.95 is 0.518.
AP at IoU=.50 is 0.792.
### 4. Inference
Users can employ the model to conduct the inference:
```
export CUDA_VISIBLE_DEVICES=0
python -u tools/infer.py -c configs/pedestrian/pedestrian_yolov3_darknet.yml \
-o weights=https://paddledet.bj.bcebos.com/models/pedestrian_yolov3_darknet.pdparams \
--infer_dir configs/pedestrian/demo \
--draw_threshold 0.3 \
--output_dir configs/pedestrian/demo/output
```
Some inference results are visualized below:
![](https://github.com/PaddlePaddle/PaddleDetection/tree/master/docs/images/PedestrianDetection_001.png)
![](https://github.com/PaddlePaddle/PaddleDetection/tree/master/docs/images/PedestrianDetection_004.png)
[English](README.md) | 简体中文
# 特色垂类检测模型
我们提供了针对不同场景的基于PaddlePaddle的检测模型,用户可以下载模型进行使用。
| 任务 | 算法 | 精度(Box AP) | 下载 | 配置文件 |
|:---------------------|:---------:|:------:| :---------------------------------------------------------------------------------: | :------:|
| 行人检测 | YOLOv3 | 51.8 | [下载链接](https://paddledet.bj.bcebos.com/models/pedestrian_yolov3_darknet.pdparams) | [配置文件](https://github.com/PaddlePaddle/PaddleDetection/tree/master/dygraph/configs/pedestrian/pedestrian_yolov3_darknet.yml) |
## 行人检测(Pedestrian Detection)
行人检测的主要应用有智能监控。在监控场景中,大多是从公共区域的监控摄像头视角拍摄行人,获取图像后再进行行人检测。
### 1. 模型结构
Backbone为Dacknet53的YOLOv3。
### 2. 训练参数配置
PaddleDetection提供了使用COCO数据集对YOLOv3进行训练的参数配置文件[yolov3_darknet53_270e_coco.yml](https://github.com/PaddlePaddle/PaddleDetection/blob/master/dygraph/configs/yolov3/yolov3_darknet53_270e_coco.yml),与之相比,在进行行人检测的模型训练时,我们对以下参数进行了修改:
* num_classes: 1
* dataset_dir: dataset/pedestrian
### 2. 精度指标
模型在我们针对监控场景的内部数据上精度指标为:
IOU=.5时的AP为 0.792。
IOU=.5-.95时的AP为 0.518。
### 3. 预测
用户可以使用我们训练好的模型进行行人检测:
```
export CUDA_VISIBLE_DEVICES=0
python -u tools/infer.py -c configs/pedestrian/pedestrian_yolov3_darknet.yml \
-o weights=https://paddledet.bj.bcebos.com/models/pedestrian_yolov3_darknet.pdparams \
--infer_dir configs/pedestrian/demo \
--draw_threshold 0.3 \
--output_dir configs/pedestrian/demo/output
```
预测结果示例:
![](../../../docs/images/PedestrianDetection_001.png)
![](../../../docs/images/PedestrianDetection_004.png)
{
"images": [],
"annotations": [],
"categories": [
{
"supercategory": "component",
"id": 1,
"name": "pedestrian"
}
]
}
_BASE_: [
'../datasets/coco_detection.yml',
'../runtime.yml',
'../yolov3/_base_/optimizer_270e.yml',
'../yolov3/_base_/yolov3_darknet53.yml',
'../yolov3/_base_/yolov3_reader.yml',
]
snapshot_epoch: 5
weights: https://paddledet.bj.bcebos.com/models/pedestrian_yolov3_darknet.pdparams
num_classes: 1
TrainDataset:
!COCODataSet
dataset_dir: dataset/pedestrian
anno_path: annotations/instances_train2017.json
image_dir: train2017
data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']
EvalDataset:
!COCODataSet
dataset_dir: dataset/pedestrian
anno_path: annotations/instances_val2017.json
image_dir: val2017
TestDataset:
!ImageFolder
anno_path: configs/pedestrian/pedestrian.json
English | [简体中文](CONTRIB_cn.md)
# PaddleDetection applied for specific scenarios
We provide some models implemented by PaddlePaddle to detect objects in specific scenarios, users can download the models and use them in these scenarios.
| Task | Algorithm | Box AP | Download | Configs |
|:---------------------|:---------:|:------:| :-------------------------------------------------------------------------------------: |:------:|
| Vehicle Detection | YOLOv3 | 54.5 | [model](https://paddledet.bj.bcebos.com/models/vehicle_yolov3_darknet.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/master/dygraph/configs/vehicle/vehicle_yolov3_darknet.yml) |
## Vehicle Detection
One of major applications of vehichle detection is traffic monitoring. In this scenary, vehicles to be detected are mostly captured by the cameras mounted on top of traffic light columns.
### 1. Network
The network for detecting vehicles is YOLOv3, the backbone of which is Dacknet53.
### 2. Configuration for training
PaddleDetection provides users with a configuration file [yolov3_darknet53_270e_coco.yml](https://github.com/PaddlePaddle/PaddleDetection/blob/master/dygraph/configs/yolov3/yolov3_darknet53_270e_coco.yml) to train YOLOv3 on the COCO dataset, compared with this file, we modify some parameters as followed to conduct the training for vehicle detection:
* num_classes: 6
* anchors: [[8, 9], [10, 23], [19, 15], [23, 33], [40, 25], [54, 50], [101, 80], [139, 145], [253, 224]]
* nms/nms_top_k: 400
* nms/score_threshold: 0.005
* dataset_dir: dataset/vehicle
### 3. Accuracy
The accuracy of the model trained and evaluated on our private data is shown as followed:
AP at IoU=.50:.05:.95 is 0.545.
AP at IoU=.50 is 0.764.
### 4. Inference
Users can employ the model to conduct the inference:
```
export CUDA_VISIBLE_DEVICES=0
python -u tools/infer.py -c configs/vehicle/vehicle_yolov3_darknet.yml \
-o weights=https://paddledet.bj.bcebos.com/models/vehicle_yolov3_darknet.pdparams \
--infer_dir configs/vehicle/demo \
--draw_threshold 0.2 \
--output_dir configs/vehicle/demo/output
```
Some inference results are visualized below:
![](https://github.com/PaddlePaddle/PaddleDetection/tree/master/docs/images/VehicleDetection_001.jpeg)
![](https://github.com/PaddlePaddle/PaddleDetection/tree/master/docs/images/VehicleDetection_005.png)
[English](CONTRIB.md) | 简体中文
# 特色垂类检测模型
我们提供了针对不同场景的基于PaddlePaddle的检测模型,用户可以下载模型进行使用。
| 任务 | 算法 | 精度(Box AP) | 下载 | 配置文件 |
|:---------------------|:---------:|:------:| :---------------------------------------------------------------------------------: | :------:|
| 车辆检测 | YOLOv3 | 54.5 | [下载链接](https://paddledet.bj.bcebos.com/models/vehicle_yolov3_darknet.pdparams) | [配置文件](https://github.com/PaddlePaddle/PaddleDetection/tree/master/dygraph/configs/vehicle/vehicle_yolov3_darknet.yml) |
## 车辆检测(Vehicle Detection)
车辆检测的主要应用之一是交通监控。在这样的监控场景中,待检测的车辆多为道路红绿灯柱上的摄像头拍摄所得。
### 1. 模型结构
Backbone为Dacknet53的YOLOv3。
### 2. 训练参数配置
PaddleDetection提供了使用COCO数据集对YOLOv3进行训练的参数配置文件[yolov3_darknet53_270e_coco.yml](https://github.com/PaddlePaddle/PaddleDetection/blob/master/dygraph/configs/yolov3/yolov3_darknet53_270e_coco.yml),与之相比,在进行车辆检测的模型训练时,我们对以下参数进行了修改:
* num_classes: 6
* anchors: [[8, 9], [10, 23], [19, 15], [23, 33], [40, 25], [54, 50], [101, 80], [139, 145], [253, 224]]
* nms/nms_top_k: 400
* nms/score_threshold: 0.005
* dataset_dir: dataset/vehicle
### 3. 精度指标
模型在我们内部数据上的精度指标为:
IOU=.50:.05:.95时的AP为 0.545。
IOU=.5时的AP为 0.764。
### 4. 预测
用户可以使用我们训练好的模型进行车辆检测:
```
export CUDA_VISIBLE_DEVICES=0
python -u tools/infer.py -c configs/vehicle/vehicle_yolov3_darknet.yml \
-o weights=https://paddledet.bj.bcebos.com/models/vehicle_yolov3_darknet.pdparams \
--infer_dir configs/vehicle/demo \
--draw_threshold 0.2 \
--output_dir configs/vehicle/demo/output
```
预测结果示例:
![](https://github.com/PaddlePaddle/PaddleDetection/tree/master/docs/images/VehicleDetection_001.jpeg)
![](https://github.com/PaddlePaddle/PaddleDetection/tree/master/docs/images/VehicleDetection_005.png)
{
"images": [],
"annotations": [],
"categories": [
{
"supercategory": "component",
"id": 1,
"name": "car"
},
{
"supercategory": "component",
"id": 2,
"name": "truck"
},
{
"supercategory": "component",
"id": 3,
"name": "bus"
},
{
"supercategory": "component",
"id": 4,
"name": "motorbike"
},
{
"supercategory": "component",
"id": 5,
"name": "tricycle"
},
{
"supercategory": "component",
"id": 6,
"name": "carplate"
}
]
}
_BASE_: [
'../datasets/coco_detection.yml',
'../runtime.yml',
'../yolov3/_base_/optimizer_270e.yml',
'../yolov3/_base_/yolov3_darknet53.yml',
'../yolov3/_base_/yolov3_reader.yml',
]
snapshot_epoch: 5
weights: https://paddledet.bj.bcebos.com/models/vehicle_yolov3_darknet.pdparams
YOLOv3Head:
anchors: [[8, 9], [10, 23], [19, 15],
[23, 33], [40, 25], [54, 50],
[101, 80], [139, 145], [253, 224]]
BBoxPostProcess:
nms:
name: MultiClassNMS
keep_top_k: 100
score_threshold: 0.005
nms_threshold: 0.45
nms_top_k: 400
normalized: false
num_classes: 6
TrainDataset:
!COCODataSet
dataset_dir: dataset/vehicle
anno_path: annotations/instances_train2017.json
image_dir: train2017
data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']
EvalDataset:
!COCODataSet
dataset_dir: dataset/vehicle
anno_path: annotations/instances_val2017.json
image_dir: val2017
TestDataset:
!ImageFolder
anno_path: configs/vehicle/vehicle.json
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册