人员着装识别系统 CNN

人员着装识别系统基于AI视频监控视觉分析技术,人员着装识别系统通过现场安装的摄像头识别和预警工厂人员及工地人员是否按要求穿戴着装,以确保安全生产和作业环境。人员着装识别系统利用先进的图像分析和识别技术,在工厂和工地的关键区域安装监控设备,实时监测人员的着装情况,并进行相关预警。

在CNN出现之前,对于图像的处理一直都是一个很大的问题,一方面因为图像处理的数据量太大,比如一张512 x 512的灰度图,它的输入参数就已经达到了252144个,更别说1024x1024x3之类的彩色图,这也导致了它的处理成本十分昂贵且效率极低。另一方面,图像在数字化的过程中很难保证原有的特征,这也导致了图像处理的准确率不高。

而CNN网络能够很好的解决以上两个问题。对于第一个问题,CNN网络它能够很好的将复杂的问题简单化,将大量的参数降维成少量的参数再做处理。也就是说,在大部分的场景下,我们使用降维不会影响结果。比如在日常生活中,我们用一张1024x1024x3表示鸟的彩色图和一张100x100x3表示鸟的彩色图,我们基本上都能够用肉眼辨别出这是一只鸟而不是一只狗。这也是卷积神经网络在图像分类里的一个重要应用。

人员着装识别系统的工作流程如下:在工厂和工地的关键区域安装监控设备,如摄像头等,对人员进行实时监控。人员着装识别系统通过先进的图像分析技术,系统能够检索、提取和分析视频中的人员着装信息。人员着装识别系统基于设定的着装规范,识别和对比人员的着装状态,判断是否符合要求。一旦人员着装识别系统检测到不符合着装规范的情况,将立即生成预警信息并报警,通知相关人员采取必要的纠正措施。

    def _build_detector(self):
        """Interpret the net output and get the predicted boxes"""
        # the width and height of orignal image
        self.width = tf.placeholder(tf.float32, name="img_w")
        self.height = tf.placeholder(tf.float32, name="img_h")
        # get class prob, confidence, boxes from net output
        idx1 = self.S * self.S * self.C
        idx2 = idx1 + self.S * self.S * self.B
        # class prediction
        class_probs = tf.reshape(self.predicts[0, :idx1], [self.S, self.S, self.C])
        # confidence
        confs = tf.reshape(self.predicts[0, idx1:idx2], [self.S, self.S, self.B])
        # boxes -> (x, y, w, h)
        boxes = tf.reshape(self.predicts[0, idx2:], [self.S, self.S, self.B, 4])

        # convert the x, y to the coordinates relative to the top left point of the image
        # the predictions of w, h are the square root
        # multiply the width and height of image
        boxes = tf.stack([(boxes[:, :, :, 0] + tf.constant(self.x_offset, dtype=tf.float32)) / self.S * self.width,
                          (boxes[:, :, :, 1] + tf.constant(self.y_offset, dtype=tf.float32)) / self.S * self.height,
                          tf.square(boxes[:, :, :, 2]) * self.width,
                          tf.square(boxes[:, :, :, 3]) * self.height], axis=3)

        # class-specific confidence scores [S, S, B, C]
        scores = tf.expand_dims(confs, -1) * tf.expand_dims(class_probs, 2)

        scores = tf.reshape(scores, [-1, self.C])  # [S*S*B, C]
        boxes = tf.reshape(boxes, [-1, 4])  # [S*S*B, 4]

        # find each box class, only select the max score
        box_classes = tf.argmax(scores, axis=1)
        box_class_scores = tf.reduce_max(scores, axis=1)

        # filter the boxes by the score threshold
        filter_mask = box_class_scores >= self.threshold
        scores = tf.boolean_mask(box_class_scores, filter_mask)
        boxes = tf.boolean_mask(boxes, filter_mask)
        box_classes = tf.boolean_mask(box_classes, filter_mask)

        # non max suppression (do not distinguish different classes)
        # ref: https://tensorflow.google.cn/api_docs/python/tf/image/non_max_suppression
        # box (x, y, w, h) -> box (x1, y1, x2, y2)
        _boxes = tf.stack([boxes[:, 0] - 0.5 * boxes[:, 2], boxes[:, 1] - 0.5 * boxes[:, 3],
                           boxes[:, 0] + 0.5 * boxes[:, 2], boxes[:, 1] + 0.5 * boxes[:, 3]], axis=1)
        nms_indices = tf.image.non_max_suppression(_boxes, scores,
                                                   self.max_output_size, self.iou_threshold)
        self.scores = tf.gather(scores, nms_indices)
        self.boxes = tf.gather(boxes, nms_indices)
        self.box_classes = tf.gather(box_classes, nms_indices)

人员着装识别系统的优势体现在:人员着装识别系统能够实时监测人员的着装情况,及时发现不合格的着装状态。人员着装识别系统通过图像分析技术,系统可以准确地识别人员的着装状态,并判断是否符合要求。一旦人员着装识别系统检测到不符合要求的着装情况,会立即生成预警信息,并及时通知相关人员采取纠正措施。通过人员着装识别系统的应用,能够提高安全意识,减少事故发生的概率,确保工作环境的安全与有序。

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值