抽烟行为识别预警系统基于AI视觉智能分析技术,抽烟行为识别预警系统通过监测现场人员抽烟行为自动存档进行报警提示同步回传后台提醒值班人员及时处理。抽烟行为识别预警系统对现场人员吸烟行为进行7*24小时不间断识别监测,当发现有人抽烟时主动抓拍存档并同步触发报警。抽烟行为识别预警系统通过AI技术手段筑牢安全生产防线,强化安全防范措施,可消除事故隐患,助力安全生产智能化升级。

YOLOv7由YOLOv4和YOLOR的同一作者于2022年7月发表在ArXiv。当时,在5 FPS到160 FPS的范围内,它的速度和准确度超过了所有已知的物体检测器。与YOLOv4一样,它只使用MS COCO数据集进行训练,没有预训练的骨干。YOLOv7提出了一些架构上的变化和一系列的免费包,在不影响推理速度的情况下提高了准确率,只影响了训练时间。

首先对输入的图片 resize 为 640x640 大小,输入到 backbone 网络中,然后经 head 层网络输出三层不同 size 大小的 **feature map**,经过 Rep 和 conv输出预测结果,这里以 coco 为例子,输出为 80 个类别,然后每个输出(x ,y, w, h, o) 即坐标位置和前后背景,3 是指的 anchor 数量,因此每一层的输出为 (80+5)x3 = 255再乘上 feature map 的大小就是最终的输出了。

抽烟行为识别预警系统 YOLOv7_算法

随着社会的发展和人们生活水平的快速提高,大家对于抽烟行为越来越重视。因为抽烟不仅危害健康,还极易引起火灾。据不完全统计,抽烟不慎引起的火灾在各种火灾原因中居第3位。特别是在工地或者工厂等这种场景,火灾非常容易引起人身及财产损失。我国由抽烟引起的火灾1994年达4000多起。在大量的火灾中,一支香烟通常燃烧时间在10分钟左右,所以说吸烟是一个很重要的致灾原因。

class Detect(nn.Module):
    stride = None  # strides computed during build
    onnx_dynamic = False  # ONNX export parameter

    def __init__(self, nc=80, anchors=(), ch=(), inplace=True):  # detection layer
        super().__init__()
        self.nc = nc  # number of classes
        self.no = nc + 5  # number of outputs per anchor
        self.nl = len(anchors)  # number of detection layers
        self.na = len(anchors[0]) // 2  # number of anchors
        self.grid = [torch.zeros(1)] * self.nl  # init grid
        self.anchor_grid = [torch.zeros(1)] * self.nl  # init anchor grid
        self.register_buffer('anchors', torch.tensor(anchors).float().view(self.nl, -1, 2))  # shape(nl,na,2)
        self.m = nn.ModuleList(nn.Conv2d(x, self.no * self.na, 1) for x in ch)  # output conv
        self.inplace = inplace  # use in-place ops (e.g. slice assignment)

    def forward(self, x):
        z = []  # inference output
        for i in range(self.nl):
            x[i] = self.m[i](x[i])  # conv
            bs, _, ny, nx = x[i].shape  # x(bs,255,20,20) to x(bs,3,20,20,85)
            x[i] = x[i].view(bs, self.na, self.no, ny, nx).permute(0, 1, 3, 4, 2).contiguous()

            if not self.training:  # inference
                if self.onnx_dynamic or self.grid[i].shape[2:4] != x[i].shape[2:4]:
                    self.grid[i], self.anchor_grid[i] = self._make_grid(nx, ny, i)

                y = x[i].sigmoid()
                if self.inplace:
                    y[..., 0:2] = (y[..., 0:2] * 2 - 0.5 + self.grid[i]) * self.stride[i]  # xy
                    y[..., 2:4] = (y[..., 2:4] * 2) ** 2 * self.anchor_grid[i]  # wh
                else:  # for YOLOv5 on AWS Inferentia https://github.com/ultralytics/yolov5/pull/2953
                    xy = (y[..., 0:2] * 2 - 0.5 + self.grid[i]) * self.stride[i]  # xy
                    wh = (y[..., 2:4] * 2) ** 2 * self.anchor_grid[i]  # wh
                    y = torch.cat((xy, wh, y[..., 4:]), -1)
                z.append(y.view(bs, -1, self.no))

        return x if self.training else (torch.cat(z, 1), x)

    def _make_grid(self, nx=20, ny=20, i=0):
        d = self.anchors[i].device
        if check_version(torch.__version__, '1.10.0'):  # torch>=1.10.0 meshgrid workaround for torch>=0.7 compatibility
            yv, xv = torch.meshgrid([torch.arange(ny).to(d), torch.arange(nx).to(d)], indexing='ij')
        else:
            yv, xv = torch.meshgrid([torch.arange(ny).to(d), torch.arange(nx).to(d)])
        grid = torch.stack((xv, yv), 2).expand((1, self.na, ny, nx, 2)).float()
        anchor_grid = (self.anchors[i].clone() * self.stride[i]) \
            .view((1, self.na, 1, 1, 2)).expand((1, self.na, ny, nx, 2)).float()
        return grid, anchor_grid

抽烟行为识别预警系统基于AI智能视频分析,抽烟行为识别预警系统对现场监控画面区域内人员抽烟进行全天候不间断自动识别,抽烟行为识别预警系统发现人员抽烟行为时,不需人为干预自动抓拍存档进行告警提醒。抽烟行为识别预警系统以最快的方式进行预警,将后台值班人员员从盯屏幕的任务中解脱出来。抽烟行为识别预警系统通过AI技术手段构建智能监控体系,变被动“监督”为主动“监控预警”,有效弥补传统方法的缺陷,将安全生产做到信息化管理。