A method, apparatus, device and medium for detecting non-regulated dress of a person

By establishing a first model for identifying people in prescribed attire and a second model for identifying people, combined with sample image expansion and detection frame processing, the problem of low efficiency in detecting people in non-prescribed attire in the existing technology is solved, and fast and accurate non-prescribed attire detection is achieved, ensuring safety.

CN116704417BActive Publication Date: 2025-10-10INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310715931.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-16
Publication Date
2025-10-10
Estimated Expiration
2043-06-16

AI Technical Summary

Technical Problem

In the prior art, the detection of people wearing non-regulatory clothing relies on a large number of images, which results in an inability to quickly detect and ensure the safety of people wearing non-regulatory clothing.

Method used

By establishing a first model for identifying people in prescribed attire, people wearing prescribed attire are identified, and then a second model for identifying people is used to detect objects other than the target person in the image. Combined with sample image expansion and detection frame processing, the detection efficiency and accuracy are improved.

Benefits of technology

The amount of sample data collected is reduced, the training efficiency of the personnel prescribed clothing model is improved, and fast and accurate detection of non-prescribed clothing is achieved, ensuring the safety of personnel wearing non-prescribed clothing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116704417B_ABST
    Figure CN116704417B_ABST
Patent Text Reader

Abstract

The application discloses a kind of personnel non-regulation dress detection method, device, equipment and medium, it is related to detection field.The method comprises the following steps: obtaining the image collected by image sensor;Image is input into the first model for identifying personnel regulation dress established in advance;The target personnel according to regulation dress is output by the first model;Except target personnel, the object in the image is identified by the model for identifying personnel and the identification result is obtained;In the case where the identification result is personnel, it is determined that personnel is not regulation dress.Obviously, in the method, personnel non-regulation dress is determined by the first model and the second model;Secondly, the first model used is a model for identifying personnel regulation dress, and since the number of personnel regulation dress is less than the number of personnel non-regulation dress, the data volume of the collected samples can be greatly reduced when establishing the model for personnel regulation dress, and the efficiency of personnel non-regulation dress detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of detection, in particular to a method, device, equipment and medium for detecting non-regulated dressing of personnel. BACKGROUND

[0002] In real production, personnel dressing according to regulations has strong demand in many scenarios, such as scientific laboratories, electronic product production workshops, etc. which require dressing anti-static clothes, gas stations, construction sites, etc. which require dressing work clothes.

[0003] At present, most personnel dressing detection is based on image structured algorithm recognition. In the process of using the model to detect personnel dressing, the number of images is highly dependent, which leads to the inability to quickly detect non-regulated dressing of personnel, and further cannot guarantee the safety of non-regulated dressing personnel.

[0004] Therefore, it is a technical problem in the art to provide a method for quickly detecting non-regulated dressing of personnel. SUMMARY

[0005] The purpose of the present application is to provide a method, device, equipment and medium for detecting non-regulated dressing of personnel, to improve the efficiency of detecting non-regulated dressing personnel.

[0006] To solve the above technical problems, the present application provides a method for detecting non-regulated dressing of personnel, comprising:

[0007] Obtaining an image collected by an image sensor;

[0008] Inputting the image into a first model established in advance; wherein the first model is a model for identifying personnel regulated dressing;

[0009] Outputting a target personnel dressed according to regulations by the first model;

[0010] Identifying and obtaining an identification result of objects other than the target personnel in the image by a second model; wherein the second model is a model for identifying personnel;

[0011] In the case that the identification result is personnel, determining that the personnel is non-regulated dressing.

[0012] In one aspect, the first model is established by:

[0013] In the case that the number of regulated dressing is N, collecting regulated dressing images as initial sample images; wherein the number of initial sample images is greater than 0 and less than N;

[0014] Increasing the number of initial sample images and obtaining new sample images;

[0015] The new sample image is input into the first model for training to establish the first model.

[0016] In one aspect, increasing the number of the initial sample images includes:

[0017] Segmenting each of the initial sample images to determine different clothing parts;

[0018] Adjusting and combining each clothing part according to preset clothing attributes, and obtaining a combined clothing image; wherein the preset clothing attributes include at least clothing color;

[0019] The combined clothing images are added to the initial sample images to increase the number of the sample images.

[0020] On the one hand, after adding the combined clothing image to the initial sample image, the method further includes:

[0021] Perform at least one of the following operations on each of the combined clothing images and the initial sample image:

[0022] Erase operation, rotation operation, mirror operation.

[0023] On the one hand, before identifying objects other than the target person in the image using the second model and obtaining a recognition result, the method further includes:

[0024] Obtaining a detection frame corresponding to the target person in the image and coordinates corresponding to the detection frame;

[0025] Cropping the image according to the coordinates corresponding to the detection frame, and obtaining the cropped image;

[0026] Correspondingly, identifying objects other than the target person in the image using a second model and obtaining a recognition result includes:

[0027] Identifying objects other than the target person in the cropped image using the second model and obtaining the recognition result;

[0028] And / or, before identifying objects other than the target person in the image using the second model and obtaining a recognition result, the method further includes:

[0029] Obtaining a detection frame corresponding to the target person in the image and coordinates corresponding to the detection frame;

[0030] Filling the detection frame with a preset color according to the coordinates corresponding to the detection frame;

[0031] Get the filled image;

[0032] Correspondingly, identifying objects other than the target person in the image using a second model and obtaining a recognition result includes:

[0033] Objects other than the target person in the filled image are identified using the second model and the identification result is obtained.

[0034] In one aspect, inputting the image into a pre-established first model comprises:

[0035] Inputting the current frame image into the first pre-established model;

[0036] Correspondingly, identifying objects other than the target person in the image using a second model and obtaining a recognition result includes:

[0037] Identify objects other than the target person in the current frame image using the second model and obtain the recognition result;

[0038] After identifying objects other than the target person in the image using the second model and obtaining a recognition result, the method further includes:

[0039] The next frame of the current frame is obtained as a new current frame, and the process returns to the step of inputting the current frame image into the pre-established first model.

[0040] On the one hand, after determining that the person is not wearing prescribed attire, the method further includes:

[0041] Outputting information for reminding the personnel to wear prescribed attire.

[0042] On the one hand, the information output for prompting the personnel to wear prescribed attire includes:

[0043] After determining that the person is not wearing the prescribed attire, information for reminding the person that the person is not wearing the prescribed attire is output within a preset time.

[0044] In order to solve the above technical problems, the present invention further provides a device for detecting a person wearing non-prescribed clothing, comprising:

[0045] An acquisition module, used to acquire images collected by an image sensor;

[0046] An input module, configured to input the image into a pre-established first model; wherein the first model is a model for recognizing a person's prescribed attire;

[0047] An output module, configured to output a target person dressed as required by the first model;

[0048] an identification and acquisition module, configured to identify objects other than the target person in the image using a second model and obtain an identification result; wherein the second model is a model for identifying people;

[0049] The determination module is used to determine that the person is not wearing prescribed clothing when the recognition result is a person.

[0050] In order to solve the above technical problems, the present invention further provides a device for detecting a person wearing non-standard clothing, comprising:

[0051] Memory for storing computer programs;

[0052] A processor is used to implement the steps of the above-mentioned method for detecting personnel wearing non-prescribed clothing when executing the computer program.

[0053] In order to solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for detecting non-prescribed clothing of personnel are implemented.

[0054] The present invention provides a method for detecting a person wearing non-prescribed attire, comprising: acquiring an image captured by an image sensor; inputting the image into a pre-established first model; wherein the first model is a model for identifying a person wearing prescribed attire; outputting a target person wearing prescribed attire through the first model; identifying objects other than the target person in the image through a second model and obtaining an identification result; wherein the second model is a model for identifying a person; and determining that the person is wearing non-prescribed attire if the identification result is a person.

[0055] The beneficial effects of the present invention are that, firstly, non-prescribed attire of a person is determined by a model for identifying prescribed attire of a person and a model for identifying a person; secondly, the first model adopted is a model for identifying prescribed attire of a person. Since the number of prescribed attire of a person is less than the number of non-prescribed attire of a person, the amount of data of the collected samples can be greatly reduced when establishing the prescribed attire model of a person, thereby improving the training efficiency of the prescribed attire model of a person, thereby using the model and the model for identifying a person to more quickly determine whether a person is wearing non-prescribed attire, thereby improving the efficiency of detecting non-prescribed attire of a person. In addition, in the method for detecting people wearing non-regulatory clothing provided by the present invention, by collecting less than N initial sample images of prescribed clothing and expanding the number of initial sample images, the collection and annotation work of training sample image data is greatly reduced, and the detection efficiency of people wearing non-regulatory clothing is greatly improved; by combining operations such as color changing, erasing, rotation, and mirroring, the number of sample images is greatly increased, and the accuracy of detecting people wearing non-regulatory clothing is improved; after the target person is detected by the first model, the detection frame where the target person is located in the image is cropped or filled, and then the cropped or filled image is used by the second model for person recognition. It can avoid the target person identified by the first model, that is, the person in prescribed clothing, from being identified by the second model again, so that the second model will not identify the target person in prescribed clothing, effectively distinguish between people in prescribed clothing and people who are not in prescribed clothing, and detect people who are not in prescribed clothing. In the process of model serial reasoning, the detection target coordinate frame is used to replace the transmission of a large number of pictures, and the pictures of the dressed people are cropped according to the transmitted coordinate frame, which reduces the copying of a large number of pictures and improves the reasoning speed. After detecting that a person is not in prescribed clothing, the person in non-prescribed clothing is prompted, which can ensure the safety of people in non-prescribed clothing as much as possible.

[0056] In addition, the present invention also provides a device for detecting non-prescribed clothing for a person, a device for detecting non-prescribed clothing for a person, and a computer-readable storage medium, which have the same or corresponding technical features as the above-mentioned method for detecting non-prescribed clothing for a person, and have the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0058] Figure 1 This is a flow chart of a method for detecting non-standard clothing for a person provided by an embodiment of the present invention;

[0059] Figure 2The structural diagram of the personnel non-regulation dress detection device provided for an embodiment of the present application is shown in the figure;

[0060] Figure 3 The structural diagram of the personnel non-regulation dress detection device provided for another embodiment of the present application is shown in the figure;

[0061] Figure 4 The flow chart of a training method for identifying a personnel regulation dress model provided for an embodiment of the present application is shown in the figure;

[0062] Figure 5 The flow chart of a personnel non-regulation dress rapid detection method provided for an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0063] The technical solutions in the embodiments of the present application will be clearly and completely described in connection with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, any other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0064] The core of the present application is to provide a personnel non-regulation dress detection method, device, equipment and medium, for improving the efficiency of non-regulation dress personnel detection.

[0065] In real production, personnel dress according to regulations has strong demand in many scenarios, such as scientific laboratories, electronic product production workshops, etc. requiring to dress anti-static clothes, gas stations, construction sites, etc. requiring to dress work clothes. At present, most personnel dress detection is based on image structured algorithm recognition. In the process of using the model to detect personnel dress, the number of images is highly dependent, which leads to the inability to quickly detect personnel non-regulation dress, and thus cannot guarantee the safety of non-regulation dress personnel. Therefore, the present application provides a personnel non-regulation dress detection method, which identifies personnel dress according to the model for identifying personnel dress, and then detects the objects in the image except for the dress according to the model for identifying personnel. After identifying the personnel, it is determined that the personnel is non-regulation dress personnel. Since the number of personnel dress according to regulations is less than the number of personnel non-regulation dress, the data amount of the collected samples can be greatly reduced when establishing the model of personnel dress according to regulations, and the training efficiency of the personnel dress according to regulations model is improved, so that the model and the model for identifying personnel can quickly determine whether the personnel is non-regulation dress, and improve the efficiency of personnel non-regulation dress detection.

[0066] In order to enable those skilled in the art to better understand the present application, the present application will be further described in detail below in connection with the drawings and specific embodiments. Figure 1The present invention is a flowchart of a method for detecting non-standard clothing provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:

[0067] S10: Acquire an image captured by an image sensor;

[0068] S11: Inputting the image into a pre-established first model; wherein the first model is a model for recognizing a person's prescribed attire;

[0069] S12: Outputting the target person dressed as per regulations through the first model;

[0070] S13: Identify objects other than the target person in the image using a second model and obtain a recognition result; wherein the second model is a model for identifying people;

[0071] S14: When the identification result is a person, it is determined that the person is not wearing prescribed attire.

[0072] In order to detect people wearing non-standard clothing, first, it is necessary to capture images using an image sensor. There is no limitation on the location of the image sensor when capturing images, the frequency of image capture, the size of the captured images, etc., which are determined according to actual conditions. For example, during rush hour, the image sensor captures images in real time during rush hour; during non-rush hour, the image sensor can capture images at certain time intervals. The images captured by the image sensor can be images that do not contain people, images that contain people and non-people, or images that only contain people. In implementation, in order to reduce computing resources, images containing people (only containing people or images containing people and non-people) captured by the image sensor can be obtained, the images containing people can be input into the first model and the second model, and then people wearing non-standard clothing can be detected.

[0073] After acquiring an image captured by the image sensor, in an embodiment of the present invention, the image is first input into a first model for identifying personnel in prescribed attire. The first model is not limited, as long as the model is trained to identify personnel in prescribed attire, such as the YOLOv5 model. The prescribed attire for personnel is specifically determined based on the actual scenario, and the prescribed attire for personnel may be different in different scenarios. For example, in an electronic product production workshop, anti-static clothing is required, and anti-static clothing includes yellow suits and white suits. Then, personnel wearing yellow, white, and mixed-color clothing (white and yellow) are all in prescribed attire. Except for personnel wearing yellow, white, and mixed-color clothing, personnel wearing clothing of other colors are all in non-prescribed attire. In practice, there are many people wearing clothing of other colors (i.e., the number of prescribed clothing is less than the number of non-prescribed clothing). Therefore, if a model for identifying personnel in non-prescribed attire is directly used to perform non-prescribed attire detection, a large amount of sample data of non-prescribed attire is required when establishing a model for identifying personnel in non-prescribed attire. Therefore, in the embodiment of the present invention, a model for identifying the prescribed attire is used to identify people wearing the prescribed attire.

[0074] After using the first model for identifying people in prescribed attire, people wearing the prescribed attire are identified. In this embodiment, the people wearing the prescribed attire output by the first model are referred to as target people. Because it is necessary to detect people in the image who are not wearing the prescribed attire, after the first model outputs the people wearing the prescribed attire, in this embodiment, a second model for identifying people is used to detect objects in the image other than the target people. When a person is identified, it is determined that the person is not wearing the prescribed attire. If the person is not identified, it is determined that no people wearing the prescribed attire exist in the current image. There are no restrictions on the second model, as long as it can perform person identification. For example, the second model can also be a YOLOv5 model. It should be noted that after the image captured by the image sensor is input into the first model, the target person may not exist, that is, no people wearing the prescribed attire exist. In this case, the image captured by the image sensor is still input into the second model for person identification. When the person is identified, the identified person is considered to be a person wearing the prescribed attire.

[0075] The method for detecting non-regulated dressing of a person provided by the embodiment of the present application comprises: acquiring an image collected by an image sensor; inputting the image into a first model established in advance; wherein the first model is a model for identifying regulated dressing of a person; outputting a target person in regulated dressing through the first model; identifying objects other than the target person in the image through a second model and acquiring an identification result; wherein the second model is a model for identifying a person; and determining non-regulated dressing of the person in the case of the identification result being a person. It can be seen that, in the method, firstly, non-regulated dressing of the person is determined through the model for identifying regulated dressing of a person and the model for identifying a person; secondly, the first model used is the model for identifying regulated dressing of a person, and since the number of regulated dressing of a person is less than the number of non-regulated dressing of a person, the data amount of the collected sample can be greatly reduced when the model for identifying regulated dressing of a person is established, and the training efficiency of the model for identifying regulated dressing of a person is improved, so that the model and the model for identifying a person can be used to quickly determine whether the person is in non-regulated dressing, and the efficiency of detecting non-regulated dressing of a person is improved.

[0076] The above is an embodiment in which the first model for identifying regulated dressing of a person is used to identify regulated dressing of a person. In the implementation, in order to reduce the number of sample images collected when the first model is established, the establishment of the first model comprises:

[0077] In the case of the number of regulated dressing being N, collecting regulated dressing images as initial sample images; wherein the number of initial sample images is greater than 0 and less than N;

[0078] Increasing the number of initial sample images and acquiring new sample images;

[0079] Inputting the new sample images into the first model for training to establish the first model.

[0080] Taking regulated dressing as a suit (the suit including a head cover, a shirt and trousers) as an example, it is assumed that the regulated dressing is yellow-dressed personnel, white-dressed personnel and mixed-color-dressed personnel (such as a yellow head cover, a white shirt and yellow trousers). If in practice, if the first model is trained by collecting images under each kind of regulated dressing, more images need to be collected, and since there are different color combinations, the initial sample images may be missed, which leads to a decrease in the efficiency of training the first model and a decrease in the efficiency and accuracy of using the first model to identify regulated dressing of a person. Therefore, in the embodiment, fewer initial sample images are collected, the initial sample images are expanded, and the number of sample images is increased, so that the number of collected initial sample images can be reduced.

[0081] There is no limitation on the method for increasing the number of initial sample images, as long as the initial sample images can be expanded. It should be noted that the number of initial sample images can only be expanded based on the prescribed attire. The embodiments of the present invention provide two methods for increasing the number of initial sample images.

[0082] Method 1: Increasing the number of initial sample images includes:

[0083] Segment each initial sample image to determine different clothing parts;

[0084] Adjusting and combining each clothing part according to preset clothing attributes, and obtaining a combined clothing image; wherein the preset clothing attributes include at least clothing color;

[0085] The combined clothing images are added to the initial sample images to increase the number of sample images.

[0086] Mask-based region-based convolutional neural networks (RCNN) are used for image segmentation to segment the head, upper body clothing, and lower body clothing. If only yellow clothing is collected, the yellow clothing is segmented into a yellow hood, a yellow top, and yellow pants. Then, according to the color of the specified clothing (such as a yellow suit or a white suit), the yellow clothing is combined and changed in color, such as replacing the yellow hood with a white hood, the yellow top with a white top, and the yellow pants with white pants. Then, the clothing of each part is combined separately, such as a yellow hood, a white top, and yellow pants. This expands the yellow clothing that was previously collected, and obtains multiple sample images while collecting a small number of sample images.

[0087] In practice, clothing may be obscured. In order to still be able to detect obscured situations, this embodiment provides a second method to increase the number of sample images used to train the first model.

[0088] Method 2: After adding the combined clothing image to the initial sample image, it also includes:

[0089] Perform at least one of the following operations on each combined clothing image and initial sample image:

[0090] Erase operation, rotation operation, mirror operation.

[0091] For example, the sleeves of the yellow shirt may be erased, and operations such as rotation and mirroring may be performed on the yellow shirt, thereby further increasing the number of initial sample images.

[0092] In the method provided by the embodiment, a small amount of sample data is collected, and the sample data is expanded, so that the number of sample images that need to be collected can be greatly reduced.

[0093] After the target person is output by the first model, in order to detect the person in non-prescribed dress in the image, before the object in the image except the target person is recognized by the second model and the recognition result is obtained, the method further includes:

[0094] obtaining a detection frame corresponding to the target person in the image and coordinates corresponding to the detection frame;

[0095] cropping the image according to the coordinates corresponding to the detection frame, and obtaining a cropped image;

[0096] Correspondingly, the object in the image except the target person is recognized by the second model and the recognition result is obtained, including:

[0097] the object in the cropped image except the target person is recognized by the second model and the recognition result is obtained;

[0098] And / or, before the object in the image except the target person is recognized by the second model and the recognition result is obtained, the method further includes:

[0099] obtaining a detection frame corresponding to the target person in the image and coordinates corresponding to the detection frame;

[0100] filling the detection frame with a preset color according to the coordinates corresponding to the detection frame;

[0101] obtaining a filled image;

[0102] Correspondingly, the object in the image except the target person is recognized by the second model and the recognition result is obtained, including:

[0103] the object in the filled image except the target person is recognized by the second model and the recognition result is obtained.

[0104] When the target person is one or more, each target person has a corresponding detection frame, the detection frame of each target person is obtained, then the detection frames of all target persons are cropped to obtain an image not containing the target person, and then the image is input into the second model for personnel recognition, and when the personnel is recognized, the recognized personnel is the person in non-prescribed dress.

[0105] In addition to the above-mentioned method of cropping the detection frame to remove the target person, the present embodiment also removes the target person by filling the detection frame. It should be noted that when filling the detection frame with color, the filled color needs to completely cover the detection frame, otherwise the target person may be judged as a person in non-prescribed clothing. If the face position in the detection frame is not filled with color, the second model can recognize the person in the detection frame, thereby determining the person as a person in non-prescribed clothing, while in fact the person belongs to the prescribed clothing. It can be seen that in practice, completely filling the detection frame can avoid the occurrence of false detection as much as possible and improve the accuracy of detection of non-prescribed clothing for people; in the process of model series connection (the first model and the second model are connected in series), the detection target coordinate frame is used to replace the transmission of a large number of pictures, and the pictures of the dressed people are cropped according to the transmitted coordinate frame, which reduces the copying of a large number of pictures and improves the detection speed.

[0106] In order to detect whether a person in an image is not wearing prescribed clothing in real time, in implementation, inputting the image into a pre-established first model includes:

[0107] Inputting the current frame image into a pre-established first model;

[0108] Correspondingly, identifying objects other than the target person in the image using the second model and obtaining a recognition result includes:

[0109] Identify objects other than the target person in the current frame image using the second model and obtain a recognition result;

[0110] After identifying objects other than the target person in the image using the second model and obtaining the recognition results, the method further includes:

[0111] The next frame of the current frame is obtained as a new current frame, and the process returns to the step of inputting the current frame image into the pre-established first model.

[0112] In the method provided in this embodiment, each frame of image is used to detect whether a person is wearing non-regulatory clothing, thereby achieving real-time detection of whether a person is wearing non-regulatory clothing.

[0113] After determining that a person is not wearing the prescribed attire, in order to promptly ensure the safety of the person not wearing the prescribed attire, the implementation includes:

[0114] Output information to remind personnel to wear the prescribed attire.

[0115] The information output to remind personnel to wear the required attire includes:

[0116] After determining that a person is not wearing the prescribed attire, a message is output within a preset time to remind the person that the person is not wearing the prescribed attire.

[0117] The preset time is not limited, and the non-regulation dressing personnel can be prompted immediately after the non-regulation dressing of the personnel is determined. The prompting mode and the prompting content are not limited, as long as the non-regulation dressing personnel can be prompted.

[0118] The embodiment provided in the embodiment can prompt the personnel after the non-regulation dressing is determined, so that the personnel can realize that the personnel is not dressed according to the regulation, and the clothing of the personnel can be adjusted in time.

[0119] In the above embodiment, the detection method of the non-regulation dressing of the personnel is described in detail, and the detection device of the non-regulation dressing of the personnel and the corresponding embodiment of the detection equipment of the non-regulation dressing of the personnel are provided. It should be noted that the embodiment of the device part is described from two angles, one is based on the function module, and the other is based on the hardware.

[0120] Figure 2 The structure diagram of the detection device of the non-regulation dressing of the personnel provided in an embodiment of the present application is provided. The embodiment is based on the function module and includes:

[0121] The acquisition module 10 is configured to acquire an image collected by an image sensor.

[0122] The input module 11 is configured to input the image into a first model established in advance; the first model is a model for identifying personnel regulation dressing.

[0123] The output module 12 is configured to output a target personnel dressed according to the regulation through the first model.

[0124] The identification and acquisition module 13 is configured to identify and acquire an identification result of an object other than the target personnel in the image through a second model; the second model is a model for identifying personnel.

[0125] The determination module 14 is configured to determine that the personnel is not dressed according to the regulation in the case that the identification result is personnel.

[0126] The detection device of the non-regulation dressing of the personnel includes an establishment module configured to establish the first model, and the establishment module includes:

[0127] The acquisition module is configured to acquire a regulation dressing image as an initial sample image in the case that the regulation dressing quantity is N; the number of initial sample images is greater than 0 and less than N.

[0128] The increasing module is configured to increase the number of initial sample images and acquire new sample images.

[0129] The first input module is configured to input the new sample images into the first model for training to establish the first model.

[0130] Additional modules include:

[0131] A segmentation module is used to segment each initial sample image to determine different clothing parts;

[0132] A first acquisition module is used to adjust and combine various clothing parts according to preset clothing attributes and obtain a combined clothing image; wherein the preset clothing attributes include at least clothing color;

[0133] The adding module is used to add the combined clothing image to the initial sample image to increase the number of sample images.

[0134] The invention also includes: an operation module, the operation module is used to perform at least one of the following operations on each combined clothing image and the initial sample image:

[0135] Erase operation, rotation operation, mirror operation.

[0136] Also includes:

[0137] The second acquisition module is used to obtain the detection frame corresponding to the target person in the image and the coordinates corresponding to the detection frame;

[0138] The third acquisition module is used to crop the image according to the coordinates corresponding to the detection frame and obtain the cropped image;

[0139] Correspondingly, the identification and acquisition module 13 includes:

[0140] A first recognition module is used to recognize objects other than the target person in the cropped image using a second model and obtain a recognition result;

[0141] and / or, also include:

[0142] The fourth acquisition module is used to obtain the detection frame corresponding to the target person in the image and the coordinates corresponding to the detection frame;

[0143] A filling module is used to fill the detection frame with a preset color according to the coordinates corresponding to the detection frame;

[0144] A fifth acquisition module, configured to acquire the filled image;

[0145] Correspondingly, the identification and acquisition module 13 includes:

[0146] The second recognition module is used to recognize objects other than the target person in the filled image through the second model and obtain recognition results.

[0147] The input module 11 includes:

[0148] The second input module is configured to input the current frame image into the first model established in advance.

[0149] Correspondingly, the identification and acquisition module 13 comprises:

[0150] The third identification module is configured to identify objects other than the target person in the current frame image through the second model and acquire an identification result.

[0151] Further comprising:

[0152] The sixth acquisition module is configured to acquire a next frame of the current frame as a new current frame and trigger the input module 11.

[0153] Further comprising:

[0154] The first output module is configured to output information for prompting the person to wear prescribed clothes.

[0155] The first output module comprises:

[0156] The second output module is configured to output information for prompting the person to wear non-prescribed clothes within a preset time after the person is determined to wear non-prescribed clothes.

[0157] Since the embodiments of the device part correspond to the embodiments of the method part, the embodiments of the device part are described in the description of the embodiments of the method part, and will not be described here.

[0158] Figure 3 The structural diagram of the detection device for non-prescribed clothes of a person provided in another embodiment of the present application. This embodiment is based on the hardware angle, as shown in Figure 3 The detection device for non-prescribed clothes of a person comprises:

[0159] The memory 20 is configured to store a computer program.

[0160] The processor 21 is configured to implement the steps of the detection method for non-prescribed clothes of a person mentioned in the above embodiments when executing the computer program.

[0161] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0162] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory, and non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the method for detecting non-prescribed clothing of personnel disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include but is not limited to the data involved in the above-mentioned method for detecting non-prescribed clothing of personnel, etc.

[0163] In some embodiments, the device for detecting non-prescribed clothing for personnel may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .

[0164] Those skilled in the art will understand that Figure 3 The structure shown in the figure does not constitute a limitation on the detection equipment for personnel not wearing prescribed clothing, and may include more or fewer components than shown in the figure.

[0165] The device for detecting a person wearing non-prescribed attire provided in an embodiment of the present invention includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: The device for detecting a person wearing non-prescribed attire has the same effect as above.

[0166] The present invention further provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiment.

[0167] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0168] The computer-readable storage medium provided by the present invention includes the above-mentioned method for detecting personnel wearing non-prescribed clothing, and the effect is the same as above.

[0169] In order to make those skilled in the art better understand the present invention, Figure 4 , Attachment Figure 5 The present invention is further described in detail with specific embodiments. Figure 4 A flowchart of a training method for identifying a person's prescribed clothing model provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the method includes:

[0170] S15: Collect samples of personnel’s prescribed attire;

[0171] S16: Enhanced sample data;

[0172] S17: Personnel prescribed dress model training.

[0173] Figure 5 A flowchart of a method for quickly detecting non-standard clothing for a person provided by an embodiment of the present invention is shown as follows: Figure 5 As shown, the method includes:

[0174] S18: input image;

[0175] S19: Personnel dress code target detection;

[0176] S20: Crop the detected target person from the image;

[0177] S21: Input the general model for person detection;

[0178] S22: Determine whether a human target is detected; if so, proceed to step S23; if not, return to step S19;

[0179] S23: Give an alert for dress code violations.

[0180] The training steps for the first model used to identify the person's prescribed clothing model are as follows:

[0181] Step 1: Collect materials of people's clothing in specific scenes;

[0182] Step 2: Perform data enhancement;

[0183] Specifically, step 2 includes the following process:

[0184] 1) Use Mask RCNN to segment the image and separate different clothing parts such as headgear and outerwear;

[0185] 2) Perform color combination changes based on actual clothing colors to increase the training sample set;

[0186] 3) Continue to perform data enhancement by randomly erasing, rotating, mirroring, and using Generative Adversarial Networks (GAN) to generate new data.

[0187] Step 3: Use the enhanced data to train the clothing model.

[0188] The steps to pass the first model test are as follows:

[0189] Step 1: First decode the video stream;

[0190] Step 2: The decoded image is input into the person's clothing target detection model to detect pedestrian clothing targets and obtain the target frame coordinates;

[0191] Step 3: Crop the input image according to the obtained target coordinate frame;

[0192] Step 4: Perform person recognition on the cropped image.

[0193] Specifically, step 4 includes the following process:

[0194] 1) If a person target is identified, it will be marked on the original image according to the target frame coordinates and an alarm will be issued;

[0195] 2) Otherwise, this round of detection ends and returns to step 2 to detect the next frame;

[0196] The above steps will be processed in an infinite loop. When some data input is detected, it will be processed and then wait for the next frame of data to be input.

[0197] The present embodiment provides a method for rapid detection of non-standard clothing by using deep learning. First, a two-step data enhancement is performed by collecting a small amount of clothing samples (using Mask RCNN for image segmentation to segment different clothing parts such as headgear and outerwear. According to the color of the actual headgear and outerwear, a combination of color change is performed. For example, if the original image is a white headgear, it can be replaced with a yellow headgear. The data samples are increased by analogy. Then, the sample set after the first step enhancement is randomly erased, rotated, mirrored, and a combination of means such as GAN is used to generate new data for the second step data enhancement). The standard clothing recognition model is trained and then connected in series with the general personnel detection model (the clothing recognition model is in front and the general personnel detection model is in the back). In this way, the real-time video image collected by the camera is first processed by the clothing recognition model to identify the dressed personnel. Then, the detected dressed personnel area is cropped and the cropped image is input into the general model for detection. If a person is detected, it is an illegal person who is not dressed according to regulations.

[0198] In the above method, data enhancement is performed by combining color change after Mask RCNN image segmentation, as well as random erasing, rotation, mirroring, and using GAN to generate new data. Only a small amount of sample training of prescribed clothing is needed to effectively solve the problem of detecting a variety of colorful clothing in spring, summer, autumn and winter, greatly reducing the collection and labeling of training samples, and greatly improving the development efficiency of such algorithms for non-prescribed clothing; the models are used in series by using the prescribed clothing personnel model in front and the general personnel target detection model in the back. At the same time, the detection target coordinate frame is used in the model series detection process to replace the transmission of a large number of pictures, and the pictures of the dressed people are cropped according to the transmitted coordinate frame, which reduces the large amount of picture copying and improves the detection speed.

[0199] The personnel non-regulated dressing detection method, device, equipment and medium provided by the present application are described in detail above. Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be understood by referring to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be understood by referring to the method part. It should be pointed out that for ordinary technical personnel in the art, without departing from the principle of the present application, the present application can be improved and modified in several ways, and these improvements and modifications also fall within the protection scope of the claims of the present application.

[0200] It should also be noted that in this specification, relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without further limitation, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or equipment including the element.

Claims

1. A method for detecting a person wearing non-standard clothing, characterized in that: include: Acquire an image captured by an image sensor; Inputting the image into a pre-established first model; wherein the first model is a model for recognizing a person's prescribed attire; Outputting the target person dressed as per regulations through the first model; Identify objects other than the target person in the image using a second model and obtain a recognition result; wherein the second model is a model for identifying people; the first model and the second model are connected in series, with the first model in front and the second model in the back; If the identification result is a person, determining that the person is not wearing prescribed attire; Before identifying objects other than the target person in the image using the second model and obtaining a recognition result, the method further includes: Obtaining a detection frame corresponding to the target person in the image and coordinates corresponding to the detection frame; Cropping the image according to the coordinates corresponding to the detection frame, and obtaining the cropped image; Correspondingly, identifying objects other than the target person in the image using a second model and obtaining a recognition result includes: Identifying objects other than the target person in the cropped image using the second model and obtaining the recognition result; And / or, before identifying objects other than the target person in the image using the second model and obtaining a recognition result, the method further includes: Obtaining a detection frame corresponding to the target person in the image and coordinates corresponding to the detection frame; Filling the detection frame with a preset color according to the coordinates corresponding to the detection frame; Get the filled image; Correspondingly, identifying objects other than the target person in the image using a second model and obtaining a recognition result includes: Objects other than the target person in the filled image are identified using the second model and the identification result is obtained.

2. The method for detecting non-standard clothing of a person according to claim 1, characterized in that: Establishing the first model includes: When the number of prescribed clothing is N, collecting images of the prescribed clothing as initial sample images; wherein the number of the initial sample images is greater than 0 and less than N; Increasing the number of the initial sample images and acquiring new sample images; The new sample image is input into the first model for training to establish the first model.

3. The method for detecting non-standard clothing of a person according to claim 2, characterized in that: Increasing the number of the initial sample images includes: Segmenting each of the initial sample images to determine different clothing parts; Adjusting and combining various clothing parts according to preset clothing attributes, and obtaining a combined clothing image; wherein the preset clothing attributes include at least clothing color; The combined clothing images are added to the initial sample images to increase the number of the sample images.

4. The method for detecting non-standard clothing of a person according to claim 3, characterized in that: After adding the combined clothing image to the initial sample image, the method further includes: Perform at least one of the following operations on each of the combined clothing images and the initial sample image: Erase operation, rotation operation, mirror operation.

5. The method for detecting non-standard clothing of a person according to claim 1, characterized in that: The inputting the image into the pre-established first model comprises: Inputting the current frame image into the first pre-established model; Correspondingly, identifying objects other than the target person in the image using a second model and obtaining a recognition result includes: Identify objects other than the target person in the current frame image using the second model and obtain the recognition result; After identifying objects other than the target person in the image using the second model and obtaining a recognition result, the method further includes: The next frame of the current frame is obtained as a new current frame, and the process returns to the step of inputting the current frame image into the pre-established first model.

6. The method for detecting non-standard clothing of a person according to claim 1, characterized in that: After determining that the personnel are not wearing prescribed attire, the method further includes: Outputting information for reminding the personnel to wear prescribed attire.

7. The method for detecting non-standard clothing of a person according to claim 6, characterized in that: The information output for prompting the personnel to wear the prescribed attire includes: After determining that the person is not wearing the prescribed attire, information for reminding the person that the person is not wearing the prescribed attire is output within a preset time.

8. A device for detecting people wearing non-standard clothing, characterized in that: include: An acquisition module, used to acquire images collected by an image sensor; An input module, configured to input the image into a pre-established first model; wherein the first model is a model for recognizing a person's prescribed attire; An output module, configured to output a target person dressed as required by the first model; an identification and acquisition module, configured to identify objects in the image other than the target person using a second model and obtain an identification result; wherein the second model is a model for identifying people; and the first model and the second model are connected in series, with the first model in front and the second model in the back; A determination module, configured to determine that the person is not wearing prescribed clothing when the recognition result is a person; Before identifying objects other than the target person in the image using the second model and obtaining a recognition result, the method further includes: Obtaining a detection frame corresponding to the target person in the image and coordinates corresponding to the detection frame; Cropping the image according to the coordinates corresponding to the detection frame, and obtaining the cropped image; Correspondingly, identifying objects other than the target person in the image using a second model and obtaining a recognition result includes: Identifying objects other than the target person in the cropped image using the second model and obtaining the recognition result; And / or, before identifying objects other than the target person in the image using the second model and obtaining a recognition result, the method further includes: Obtaining a detection frame corresponding to the target person in the image and coordinates corresponding to the detection frame; Filling the detection frame with a preset color according to the coordinates corresponding to the detection frame; Get the filled image; Correspondingly, identifying objects other than the target person in the image using a second model and obtaining a recognition result includes: Objects other than the target person in the filled image are identified using the second model and the identification result is obtained.

9. A device for detecting people wearing non-standard clothing, characterized in that: include: Memory for storing computer programs; A processor is configured to implement the steps of the method for detecting non-prescribed attire of a person as claimed in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for detecting non-prescribed attire of a person according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Dressing detection device and method and storage medium

    CN111325150A