---
title: helmet_detection_bbk
canonical_url: "https://www.modelscope.cn/models/BiBiKo/helmet_detection_bbk"
md_url: "https://www.modelscope.cn/models/BiBiKo/helmet_detection_bbk.md"
repository: BiBiKo/helmet_detection_bbk
chinese_name: "安全帽检测"
last_updated: 2023-05-04
license: "Apache License 2.0"
pipeline_tag: image-object-detection
tasks:
  - image-object-detection
model_type:
  - YOLOX
library_name:
  - pytorch
frameworks:
  - pytorch
language:
  - cn
domain:
  - cv
downloads: 182
stars: 2
tags:
  - "安全帽检测"
  - "实时快速"
---

# helmet_detection_bbk

> helmet_detection_bbk - BiBiKo 在 ModelScope 开源的模型。安全帽检测

BiBiKo/helmet_detection_bbk 是 ModelScope 魔搭社区上的image-object-detection模型，采用 Apache License 2.0 许可。

- **Repository**: BiBiKo/helmet_detection_bbk
- **License**: Apache License 2.0
- **Tasks**: image-object-detection
- **Tags**: 安全帽检测, 实时快速
- **Downloads**: 182
- **Stars**: 2
- **Last updated**: 2023-05-04

Source: https://www.modelscope.cn/models/BiBiKo/helmet_detection_bbk

---

# 安全帽实时检测模型

安全帽实时检测为目标检测的子任务，本模型为高性能安全帽实时检测模型，提供快速、精确的目标检测能力。

See the world fast and accurately!




## 模型描述

YOLOX为YOLO检测系列的最近增强版本。在实时通用检测模型中，YOLO系列模型获得显著的进步，大大地推动了社区的发展。YOLOX在原有YOLO系列的基础上，结合无锚点（anchor-free）设计，自动优化GT分配（SimOTA）策略，分类回归头解耦（Decoupling Head）等一系列前沿视觉检测技术，显著地提高了检测模型的准确度与泛化能力，将当前的目标检测水平推到了一个新的高度。本模型为YOLOX的小规模模型，基于公开数据集COCO训练，支持80类通用目标检测。
该模型基于YOLOX，在指定数据集上finetune得到安全帽实时检测模型，具有工程应用价值。

## 期望模型使用方式以及适用范围

- 日常安全帽检测场景目标定位与识别。
- 日常安全帽场景目标粗略计数。
- 作为其他日常场景算法的前置算法，如人体关键点检测，行为识别等。

### 如何使用

在ModelScope框架上，可以通过ModelScope的pipeline进行调用。

Now, you can play the model with a few line codes!

#### 代码范例
<!--- 本session里的python代码段，将被ModelScope模型页面解析为快速开始范例--->
```python
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
from modelscope.outputs import OutputKeys

realtime_detector = pipeline(Tasks.image_object_detection, model='BiBiKo/helmet_detection_bbk', model_revision ='v1.0.0'))
result = realtime_detector('demo.jpg')
# 打印 bbox
print(result[OutputKeys.BOXES])
```

#### Clone with HTTP
```bash
 git clone https://www.modelscope.cn/BiBiKo/helmet_detection_bbk.git
```

### 模型局限性以及可能的偏差
  - 对于较小的安全帽的检测在某些困难场景会存在效果差的情况，建议根据场景对检出小目标进行分数过滤。
  - 目前模型仅限于pipeline调用，尚未支持finetune和evaluation。
  - 复杂专用场景性能会产生显著下降，如复杂视角、超低光照以及严重遮挡等。
  - 当前版本在Python 3.7环境测试通过，其他环境下可用性待测试。

## 训练数据介绍

本模型基于魔塔提供的安全帽检测数据集的目标检测部分数据及标注进行训练。模型名称为'head_detection_for_train_tutorial'。

## 模型训练流程

模型在线训练暂不支持。部分关键训练细节如下：
- 使用 SGD 优化算法，cos LR scheduler，warmup策略。
- 训练迭代为 25个 epoch。
- Mosaic，颜色增强等策略被应用到训练预处理中。

## 输入预处理

- 输入图像根据长边resize到640后，padding 为640x640的矩形进行推理。
- 图像归一化。

## 数据评估及结果
|Model |size |mAP<sup>val<br>0.5:0.95 |mAP<sup>test<br>0.5:0.95 | Speed V100<br>(ms) | Params<br>(M) |FLOPs<br>(G)|
| ------        |:---: | :---:    | :---:       |:---:     |:---:  | :---: |
|[YOLOX](https://arxiv.org/pdf/2107.08430.pdf)    |640  |63.5 |63.5      |9.8      |9.0 | 26.8 |


## 引用

如您的相关著作、作品使用了该模型，请引用以下信息：

```
@article{yolox2021,
  title={{YOLOX}: Exceeding YOLO Series in 2021},
  author={Ge, Zheng and Liu, Songtao and Wang, Feng and Li, Zeming and Sun, Jian},
  journal={arXiv preprint arXiv:2107.08430},
  year={2021}
}
```
