Dress code detection method, device and computer-readable storage medium
By acquiring images and using classification and compliance judgment models to determine the category and location of clothing, the accuracy of clothing compliance judgment in contactless state is solved, and high-precision dress code detection is achieved.
Patent Information
- Application Number
- CN202111571302.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-12-21
AI Technical Summary
It is difficult for the prior art to accurately analyze human body dress in a contactless state to determine whether the clothing complies with preset specifications.
By obtaining the captured images, determining the clothing category, and comparing it with the preset categories, combining the human body image and clothing position to determine whether the dress is compliant, and using the classification model and compliance discrimination model for accurate judgment.
It realizes an accurate judgment on whether the clothing complies with preset specifications in a contactless state, and improves judgment accuracy and accuracy.
Smart Images

Figure CN114419362B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dress code detection, and in particular to a dress code detection method, device and computer-readable storage medium. Background Art
[0002] Analyzing human clothing in a non-contact state means acquiring captured images without the need for actual contact and analyzing the clothing information of the people in the images. This technology can meet the professional needs of different industries for clothing requirements. Summary of the Invention
[0003] The present invention provides a dress code detection method, device and computer-readable storage medium, which can determine whether the clothing of a person object in a captured image is worn in compliance with the dress code.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions:
[0005] In a first aspect, the present invention provides a dress code detection method, the method comprising:
[0006] Acquire a captured image, where the captured image includes a human object and a variety of clothing of the human object;
[0007] determining a clothing category for each of the plurality of clothing items;
[0008] comparing the plurality of clothing categories with preset categories, the preset categories comprising at least one pre-stored clothing category;
[0009] Based on the comparison result, determine whether the clothing of the person object complies with the regulations.
[0010] Compared with the existing technology, the dress code detection method provided by the present invention determines the category of each clothing among the multiple clothing in the photographed object, compares the multiple clothing categories with the preset categories, and determines the comparison result between the clothing category worn by the person object in the photographed object and the preset category, so as to judge whether the clothing worn by the person object in the captured image is in compliance with the regulations.
[0011] In a possible implementation, determining the clothing category of each of the multiple clothing items includes:
[0012] Generate multiple clothing images based on the captured image, each clothing image includes a type of clothing of the human object;
[0013] Input each clothing image into a pre-existing classification model;
[0014] Each clothing image is classified by the classification model, and the clothing category corresponding to each clothing image is output. The clothing category is the category of clothing included in the corresponding clothing image.
[0015] In one possible implementation, the dress code detection method further includes:
[0016] Generate a human body image according to the captured image, where the human body image includes a human body region of the human object;
[0017] Determining whether the clothing of the person subject complies with regulations based on the comparison result, including:
[0018] If the multiple clothing categories include a preset category, determining whether the clothing of the person object is in compliance with the regulations based on the human body image, each clothing image, and the clothing category corresponding to each clothing image, the human body image including a body region of the person object;
[0019] If the multiple clothing categories do not include at least one clothing category in the preset categories, it is determined that the clothing of the person object is not in compliance with regulations.
[0020] In one possible implementation, determining whether the clothing of the person object is in compliance with regulations based on the human body image, each clothing image, and the clothing category corresponding to each clothing image includes:
[0021] Generate a category image corresponding to each clothing image according to the clothing category corresponding to each clothing image;
[0022] For each clothing image, the channel superposition technology is used to superimpose the human body image, each clothing image, and the category image corresponding to each clothing image to obtain the target image corresponding to each clothing image;
[0023] Input multiple target images into a pre-stored compliance discrimination model;
[0024] The compliance discrimination model is used to perform compliance judgment on multiple target images and output result information, which is used to indicate whether the clothing of the person object is compliant.
[0025] In one possible implementation, the compliance judgment model is used to judge the compliance of multiple target images and output result information, including:
[0026] For each target image, the following steps are performed: obtaining the preset rules corresponding to each category image, and determining the position of the clothing in each clothing image on the human object based on the human body image and the clothing image corresponding to each category image;
[0027] Determine whether the person's clothing is legal based on each position and the corresponding preset rules.
[0028] In a possible implementation, generating a category image corresponding to each clothing image according to the clothing category corresponding to each clothing image includes:
[0029] According to the category value corresponding to the clothing category corresponding to each clothing image, a category image corresponding to each clothing image is generated. The pixel value of each pixel in the category image is the category value. The category image, clothing image, and human body image have the same size.
[0030] In one possible implementation, the dress code detection method further includes:
[0031] Output prompt information, which is used to indicate whether the person's clothing is in compliance with regulations.
[0032] In a second aspect, the present invention provides a dress code detection device, comprising:
[0033] an acquisition unit, configured to acquire a captured image, wherein the captured image includes a human object and a variety of clothing of the human object;
[0034] a determining unit, configured to determine a clothing category of each of the multiple clothing items in the captured image acquired by the acquiring unit;
[0035] The judgment unit is used to compare the multiple clothing categories with the preset categories, which include at least one pre-stored clothing category; and determine whether the clothing of the character object is compliant based on the comparison result.
[0036] Compared with the prior art, the beneficial effects of the dress code detection device provided by the present invention are the same as the beneficial effects of the dress code detection method described in the first aspect and any possible implementation of the first aspect, and will not be repeated here.
[0037] In a possible implementation, the determining unit is specifically configured to:
[0038] Generate multiple clothing images based on the captured image, each clothing image includes a type of clothing of the human object;
[0039] Input each clothing image into a pre-existing classification model;
[0040] Each clothing image is classified by the classification model, and the clothing category corresponding to each clothing image is output. The clothing category is the category of clothing included in the corresponding clothing image.
[0041] In a possible implementation, the determining unit is specifically configured to:
[0042] Generate a human body image according to the captured image, where the human body image includes a human body region of the human object;
[0043] The above-mentioned judgment unit is specifically used to:
[0044] If the multiple clothing categories include a preset category, a human body image is generated based on the captured image, and whether the clothing of the human subject complies with the regulations is determined based on the human body image, each clothing image, and the clothing category corresponding to each clothing image, wherein the human body image includes a human body region of the human subject;
[0045] If the multiple clothing categories do not include at least one clothing category in the preset categories, it is determined that the clothing of the person object is not in compliance with regulations.
[0046] In a possible implementation, the judgment unit is specifically configured to:
[0047] Generate a category image corresponding to each clothing image according to the clothing category corresponding to each clothing image;
[0048] For each clothing image, the channel superposition technology is used to superimpose the human body image, each clothing image, and the category image corresponding to each clothing image to obtain the target image corresponding to each clothing image;
[0049] Input multiple target images into a pre-stored compliance discrimination model;
[0050] The compliance discrimination model is used to perform compliance judgment on multiple target images and output result information, which is used to indicate whether the clothing of the person object is compliant.
[0051] In a possible implementation, the judgment unit is specifically configured to:
[0052] For each target image, the following steps are performed: obtaining the preset rules corresponding to each category image, and determining the position of the clothing in each clothing image on the human object based on the human body image and the clothing image corresponding to each category image;
[0053] Determine whether the person's clothing is legal based on each position and the corresponding preset rules.
[0054] In a possible implementation, the judgment unit is specifically configured to:
[0055] According to the category value corresponding to the clothing category corresponding to each clothing image, a category image corresponding to each clothing image is generated. The pixel value of each pixel in the category image is the category value. The category image, clothing image, and human body image have the same size.
[0056] In a possible implementation, the dress code detection device further includes: an output unit;
[0057] The output unit is used to output prompt information, which is used to prompt whether the person object's clothing is compliant.
[0058] In a third aspect, the present invention provides a dress code detection device comprising: a processor and a memory. The memory is configured to store computer program code, wherein the computer program code comprises computer instructions. When the processor executes the computer instructions, the dress code detection device performs the dress code detection method of the first aspect and any possible implementation thereof.
[0059] Compared with the prior art, the beneficial effects of the dress code detection device provided by the present invention are the same as the beneficial effects of the dress code detection method described in the first aspect and any possible implementation of the first aspect, and will not be repeated here.
[0060] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon. When the computer instructions are executed on a dress code detection device, the dress code detection device executes the dress code detection method of the first aspect or any one of the possible implementations of the first aspect.
[0061] Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present invention are the same as the beneficial effects of the dress code detection method described in the first aspect and any possible implementation of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 A schematic structural diagram of a dress code detection system provided by an embodiment of the present invention;
[0063] Figure 2 A schematic diagram of the structure of a computing device provided in an embodiment of the present invention;
[0064] Figure 3 Schematic diagram of the process of the dress code detection method provided by the embodiment of the present invention Figure 1 ;
[0065] Figure 4 Schematic diagram of the process of the dress code detection method provided by the embodiment of the present invention Figure 2 ;
[0066] Figure 5 Schematic diagram of the process of the dress code detection method provided by the embodiment of the present invention Figure 3 ;
[0067] Figure 6 Schematic diagram of the process of the dress code detection method provided by the embodiment of the present invention Figure 4 ;
[0068] Figure 7 Schematic diagram of the process of the dress code detection method provided by the embodiment of the present invention Figure 5 ;
[0069] Figure 8 Schematic diagram of the process of the dress code detection method provided by the embodiment of the present invention Figure 6 ;
[0070] Figure 9 Schematic diagram of the process of the dress code detection method provided by the embodiment of the present invention Figure 7 ;
[0071] Figure 10 A structural diagram of a dress code detection device provided by an embodiment of the present invention Figure 1 ;
[0072] Figure 11 A structural diagram of a dress code detection device provided by an embodiment of the present invention Figure 2 . DETAILED DESCRIPTION
[0073] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0074] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, "plurality" means two or more.
[0075] Additionally, the use of “based on” or “according to” is meant to be open and inclusive, as a process, step, calculation, or other action “based on” or “according to” one or more stated conditions or values may, in practice, be based on additional conditions or values beyond those stated.
[0076] In order to determine whether the clothing of the person subject in the captured image is worn in compliance with regulations, an embodiment of the present invention provides a dress code detection method, device and computer-readable storage medium. By comprehensively judging the clothing category of the person subject in the captured image and the position of each category of clothing on the person subject, it is possible to accurately determine whether the clothing of the person subject in the captured image is worn in compliance with regulations.
[0077] The dress code detection method provided in the embodiment of the present invention may be applicable to a dress code detection system. Figure 1 Figure 2 shows a structure of the dress code detection system. Figure 1As shown, the dress code detection system may include: a plurality of image acquisition devices 11 and terminal devices 12. The terminal device 12 is connected to each image acquisition device 11.
[0078] The image acquisition device 11 is used to capture a person object and generate a captured image, which may include the person object and various clothing items of the person object. The image acquisition device 11 is also used to transmit the captured image to the terminal device 12.
[0079] For example, the image acquisition device 11 may be a binocular camera, a camera with a radar detection function, an infrared camera, or other devices.
[0080] For example, the image acquisition device 11 can capture the upper body or the entire body of a person to generate a captured image. The captured image is preferably a red, green, and blue (RGB) image, which has three image channels.
[0081] The terminal device 12 is configured to receive the captured images transmitted by each image acquisition device 11. The terminal device 12 is further configured to determine a clothing category of each of the multiple clothing items based on the captured images, compare the multiple clothing categories with preset categories, and determine whether the clothing worn by the person subject complies with the regulations based on the comparison results. The preset categories may include at least one clothing category pre-stored in the terminal device.
[0082] For example, the terminal device 12 may be a smart phone, a tablet computer, or a desktop computer.
[0083] The basic hardware structures of the above-mentioned image acquisition device 11 and terminal device 12 are similar, both including Figure 2 The computing device shown in FIG. Figure 2 Taking the computing device shown as an example, the hardware structure of the image acquisition device 11 and the terminal device 12 is introduced.
[0084] like Figure 2 As shown, the computing device may include: a processor 21, a memory 22, a communication interface 23, and a bus 24. The processor 21, the memory 22, and the communication interface 23 may be connected via a communication bus 24.
[0085] The processor 21 is the control center of the computing device and can be a single processor 21 or a collective term for multiple processing elements. For example, the processor 21 can be a general-purpose CPU (central processing unit) or another general-purpose processor 21. The general-purpose processor 21 can be a microprocessor 21 or any conventional processor 21.
[0086] As an embodiment, the processor 21 may include one or more CPUs, for example, Figure 2 CPU0 and CPU1 are shown.
[0087] The memory 22 may be a read-only memory 22 (ROM) or other type of static storage device that can store static information and instructions, a random access memory 22 (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory 22 (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0088] In one possible implementation, memory 22 may exist independently of processor 21 and may be connected to processor 21 via bus 24 to store instructions or program codes. When processor 21 calls and executes the instructions or program codes stored in memory 22, the dress code detection method provided in the following embodiments of the present application can be implemented.
[0089] In another possible implementation, the memory 22 may also be integrated with the processor 21 .
[0090] The communication interface 23 is used to connect the computing device to other devices via a communication network, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 23 may include a receiving unit for receiving data and a sending unit for sending data.
[0091] The bus 24 may be an Industry Standard Architecture (ISA) bus 24, a Peripheral Component Interconnect (PCI) bus 24, or an Extended Industry Standard Architecture (EISA) bus 24. The bus 24 may be divided into an address bus 24, a data bus 24, a control bus 24, and the like. For ease of representation, Figure 2Only one thick line is used in the figure, but this does not mean that there is only one bus 24 or only one type of bus 24.
[0092] It should be pointed out that Figure 2 The structure shown in the figure does not constitute a limitation on the computing device, except Figure 2 In addition to the components shown, the computing device may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0093] The dress code detection method provided in the embodiments of the present invention is implemented by a dress code detection device. This dress code detection device can be the aforementioned terminal device, a CPU within the terminal device, a control module within the terminal device for detecting dress codes, or a client within the terminal device for detecting dress codes. The embodiments of the present invention illustrate the dress code detection method provided in this application by taking the execution of the dress code detection method by a terminal device as an example.
[0094] The following describes the dress code detection method provided by the embodiment of the present invention with reference to the accompanying drawings.
[0095] like Figure 3 As shown, the dress code detection method provided by the embodiment of the present invention includes the following steps 301 to 304.
[0096] 301. The terminal device obtains a captured image. The captured image may include a person object and various clothing items of the person object.
[0097] In a dress code detection scenario, a person can stand in front of an image capture device, positioned so that the device can capture the person's head and body. After the image capture device generates a captured image, it transmits the image to a terminal device via a network, which then captures the captured image.
[0098] 302. The terminal device determines a clothing category of each of the multiple clothing items.
[0099] After acquiring the captured image, the terminal device may analyze and process the captured image to determine the clothing category of each of the multiple clothing items.
[0100] 303. The terminal device may compare the multiple clothing categories with a preset category. The preset category may include at least one clothing category pre-stored in the terminal device.
[0101] 304. The terminal device determines whether the person's clothing is compliant based on the comparison result.
[0102] When the terminal device compares each clothing category with the corresponding clothing category in the preset categories and generates a comparison result, it determines whether the clothing of the character object is compliant based on the comparison result.
[0103] Specifically, the comparison result may include: the plurality of clothing categories do not include at least one clothing category in the above-mentioned preset categories; or the plurality of clothing categories include the above-mentioned preset categories.
[0104] Compared with the prior art, the dress code detection method provided in the embodiment of the present invention determines the category of each clothing item among the multiple clothing items in the photographed subject, compares the multiple clothing items with the preset categories, and determines the comparison result between the clothing item category worn by the person subject in the photographed subject and the preset category, so as to judge whether the clothing worn by the person subject in the captured image is in compliance with the regulations.
[0105] Combine Figure 3 ,like Figure 4 As shown, after determining whether the clothing of the person object is compliant in the above step 304, the dress code detection method provided by the embodiment of the present invention may further include the following step 401.
[0106] 401. The terminal device outputs a prompt message.
[0107] After determining whether the person object's attire is compliant, the terminal device may output prompt information, where the prompt information is used to indicate whether the person object's attire is compliant.
[0108] Optionally, the prompt information output by the terminal device can be implemented in various ways. In one implementation, the prompt information can include a rectangular frame marking the area of the human body with inappropriate clothing in the captured image, to remind the user that the clothing within the rectangular frame is inappropriate. In another implementation, the prompt information can be an alarm message, which can include information about the clothing category within the inappropriate clothing area.
[0109] For example, when the prompt message "×× is not wearing properly" is output, the character object takes effective measures to correct the clothing currently being worn based on the prompt message "×× is not wearing properly." For example, when the prompt message "Mask is not wearing properly" is output, the character object adjusts the way the mask is worn so that it properly covers the mouth and nose.
[0110] Optionally, the person can modify their current attire based on the prompt information. Once the person has modified their clothing, the image capture device recaptures the person to generate a new image. The terminal device then re-executes steps 301-304.
[0111] Combine Figure 3 ,like Figure 5As shown, in the above step 302 , the terminal device determining the clothing category of each of the multiple clothing items may include the following steps 501 to 503 .
[0112] 501. The terminal device may generate a plurality of clothing images based on the captured image, and each clothing image may include a type of clothing of the person object.
[0113] After the terminal device acquires the captured image, it can use the pre-stored human body and clothing detection model to detect clothing areas in the captured image. Each detected clothing area can generate a corresponding clothing image, and multiple clothing images can be generated. The size of each clothing image is the same as the captured image.
[0114] It is understood that the above-mentioned human body and clothing detection model can be obtained using different algorithms. For example, the human body and clothing detection model can be obtained using target detection or target segmentation methods. Different algorithms yield different human body and clothing detection models, and the output clothing images are also different. Specifically, if the target detection method is used to obtain clothing images, after the captured image is input into the human body and clothing detection model, each clothing image output from the human body and clothing detection model is a clothing image with a regular border. A clothing image with a regular border includes not only a complete image of clothing of one category, but may also include incomplete images of clothing of other categories or other background images. If the target segmentation method is used to obtain clothing images, after the captured image is input into the human body and clothing detection model, each clothing image output from the human body and clothing detection model only includes the outline of clothing of one category. In other words, the clothing image obtained using the target segmentation method is generated by cutting out each clothing category from the captured image. Therefore, it can be seen that the target segmentation method is used to obtain the human body and clothing detection model, which produces the best clothing image output.
[0115] Furthermore, when training a human and clothing detection model, the training samples can be a large number of sample images with multiple clothing regions labeled. For example, common clothing regions can be labeled as masks, glasses, ties, tops, and culottes. This large number of labeled training samples is fed into a deep neural network for training. After multiple rounds of training iterations until the loss function converges to a stable state, a human and clothing detection model is obtained.
[0116] 502. The terminal device may input each clothing image into a pre-stored classification model.
[0117] The terminal device may also have a pre-stored classification model. When training the classification model, the training samples can be a large number of sample clothing images labeled with clothing categories. In one possible implementation, clothing categories can be represented numerically. For example, the clothing category for a mask is "1," the clothing category for a tie is "2," and so on. These labeled clothing images are fed into a deep neural network for training. After multiple rounds of training iterations until the loss function converges to a stable state, a classification model is obtained.
[0118] 503. The terminal device classifies each clothing image using a classification model and outputs the clothing category corresponding to each clothing image.
[0119] The clothing category is the category of clothing included in the corresponding clothing image. The clothing category may include one or more of the type, style, color, or texture of the clothing.
[0120] For example, when the clothing category is the type of clothing, when the clothing in a clothing image is a mask, after the classification model classifies the clothing image, the clothing category "1" corresponding to the mask is output.
[0121] Combine Figure 5 ,like Figure 6 As shown, while the terminal device generates multiple clothing images according to the captured images in the above step 501, the dress code detection method provided by the embodiment of the present invention may further include the following step 601.
[0122] 601. The terminal device may generate a human body image based on the captured image. The human body image may include a human body region of a human object.
[0123] When training a human body and clothing detection model, the training sample images can also be annotated with human body images. For example, if the sample image is an image of the upper body of a person, the human body region can be annotated as the upper body region; if the sample image is a full-body image of a person, the human body region can be annotated as the full body region.
[0124] After the terminal device obtains the captured image, it can use the human body and clothing detection model or perform human body region detection on the captured image to generate a human body image. The process of generating a human body image is the same as that of generating each clothing image, so it will not be repeated here.
[0125] Combine Figure 6 ,like Figure 7 As shown, in the above step 304, determining whether the clothing of the character object is compliant according to the comparison result may include the following step 701 or step 702.
[0126] 701. If the multiple clothing categories include the preset category, the terminal device may determine whether the clothing of the person object complies with regulations based on the human body image, each clothing image, and the clothing category corresponding to each clothing image.
[0127] When multiple clothing categories include the above-mentioned preset categories, it only indicates that the clothing categories worn by the person in the captured image are compliant. However, whether the person's clothing is compliant, the terminal device needs to further judge by combining the human body image, each clothing image and the clothing category corresponding to each clothing image.
[0128] 702. If the plurality of clothing categories do not include at least one of the preset categories, the terminal device may determine that the clothing of the character object is not in compliance with regulations.
[0129] For example, there are five preset categories, and the values representing the preset categories are 1, 2, 3, 4, and 5. There are five clothing images, and the terminal device uses the classification model to classify the five clothing images. The resulting clothing categories are 1, 2, 3, 4, and 6. In this case, the terminal device can determine that the person's clothing is not in compliance with regulations.
[0130] Combine Figure 7 ,like Figure 8 As shown, the above step 701 determines whether the clothing of the person object is compliant based on the human body image, each clothing image and the clothing category corresponding to each clothing image, which may include the following steps 801-804.
[0131] 801. The terminal device may generate a category image corresponding to each clothing image according to the clothing category corresponding to each clothing image.
[0132] The terminal device may generate a category image corresponding to each clothing image based on the category value corresponding to the clothing category corresponding to each clothing image. The pixel value of each pixel in the category image is the category value.
[0133] For example, if the clothing category corresponding to a clothing image is mask, and the category value of the clothing category corresponding to mask is 1, then the pixel value of each pixel in the category image corresponding to mask is 1. In other words, the category image is a single-channel image.
[0134] 802. For each clothing image, the terminal device may respectively use a channel superposition technology to superimpose the human body image, each clothing image, and the category image corresponding to each clothing image to obtain a target image corresponding to each clothing image.
[0135] For example, for each clothing image, the terminal device may first perform image channel superposition on the human body image and clothing image to generate a 6-channel composite image. The terminal device then performs image channel superposition on the 6-channel composite image and the single-channel category image to generate a 7-channel target image.
[0136] It should be noted that the number of category images is the same as the number of clothing images. In order to superimpose the category images, clothing images and human body images on image channels, the sizes of the category images, clothing images and human body images are all the same.
[0137] 803. The terminal device may input multiple target images into a pre-stored compliance discrimination model.
[0138] The terminal device may also pre-store a compliance discrimination model. When training the compliance discrimination model, the training samples may be a large number of target images with 7 channels that are labeled with compliance results. That is to say, the human body area obtained in the above steps and the clothing categories corresponding to multiple clothing areas are jointly pre-judged. Specifically, the image channel superposition technology is used to superimpose the human body area image (such as a face) and a clothing area image (such as a mask) together to form a 6-channel image. The 6-channel image and the clothing category corresponding to the clothing area are then input into the deep neural network for training. After multiple rounds of training iterations until the value of the loss function tends to a stable convergence state, the compliance discrimination model can be obtained. The output result of the compliance discrimination model is a 1×2 matrix.
[0139] 804. The terminal device may perform compliance judgment on the plurality of target images using the compliance judgment model and output result information. The result information is used to indicate whether the clothing of the person object complies with the regulations.
[0140] In one possible implementation, the output of the compliance discrimination model can be represented by a numerical value. For example, a value of "1" can indicate compliance, and a value of "0" can indicate non-compliance. Alternatively, in another possible implementation, the output of the compliance discrimination model can be represented by a matrix. For example, if the matrix is [1, 0], the clothing of that category is compliant, and if the matrix is [1, 0], the clothing of that category is non-compliant.
[0141] Each captured image can generate multiple clothing images, each of which can generate a corresponding target image. The terminal device inputs the multiple target images obtained after processing in step 802 into the compliance determination model, performing a compliance determination on each target image. The terminal device then uses the compliance determination model to perform multiple wear compliance determinations, ultimately outputting whether each clothing category is wearable and compliant. Ultimately, combining the compliance determinations for each clothing category, a comprehensive determination is made regarding whether the person's attire is wearable and compliant.
[0142] Combine Figure 8 ,like Figure 9 As shown, in the above step 804, the terminal device performs compliance judgment on multiple target images through the compliance judgment model and outputs result information. For each target image, the following steps 901 and 902 may be included.
[0143] 901. The terminal device obtains a preset rule corresponding to each category image, and determines the position of the clothing in each clothing image on the human object based on the human body image and the clothing image corresponding to each category image.
[0144] Preset rules refer to the wearing rules corresponding to a specific category of clothing. For example, the wearing rule for a mask is to cover the mouth and nose of the character. If the mask does not cover the mouth or nose, the mask does not comply with the preset rules. Determining the position of the clothing in each clothing object on the character object refers to the coverage area of a specific category of clothing. For example, a long-sleeved shirt needs to completely cover the upper torso and arms of the character object. If the long-sleeved shirt does not completely cover the upper torso of the character object, the long-sleeved shirt is not worn in compliance.
[0145] 902. The terminal device determines whether the clothing of the person object complies with regulations based on each position and corresponding preset rules.
[0146] Only when the wearing rules for each clothing category and the area covered by the clothing on the person object are both in compliance will the terminal device determine that the clothing category is wearing compliance. If all clothing categories are wearing compliance, the clothing of the person object in the captured image is wearing compliance.
[0147] Compared to the prior art, the dress code detection method provided in the embodiment of the present invention determines the category of each of the multiple clothing items in the photographed subject, and then compares the multiple clothing categories with the preset categories to determine whether the clothing category worn by the person subject in the photographed subject is compliant. If the clothing category worn by the person subject is compliant, the compliance of the person subject's clothing is further determined based on the wearing rules of the specific category of clothing and the position on the person subject. If the clothing category worn by the person subject is not compliant, the person subject's clothing is judged to be non-compliant. In this way, since the clothing worn by the person subject is judged to be non-compliant twice, the accuracy of judging whether the clothing worn by the person subject in the captured image is compliant is improved.
[0148] The above mainly introduces the solution provided by the embodiment of the present invention from the perspective of the dress code detection device. It can be understood that in order to realize the above functions, the dress code detection device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the algorithm steps of each example described in the embodiments disclosed herein, the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0149] Figure 10 A possible schematic diagram of the composition of the dress code detection device 1000 involved in the above embodiment is shown. Figure 10 As shown, the dress code detection device 1000 may include: an acquisition unit 1001 , a determination unit 1002 and a judgment unit 1003 .
[0150] The acquisition unit 1001 is used to acquire a captured image, which includes a person object and a variety of clothing of the person object. Figure 3 , the acquisition unit 1001 can be used to perform step 301. The determination unit 1002 is used to determine the clothing category of each of the multiple clothing items in the captured image acquired by the acquisition unit 1001. Figure 3 The determining unit 1002 may be used to execute step 302. The judging unit 1003 is used to compare the multiple clothing categories with a preset category, where the preset category includes at least one pre-stored clothing category; and to determine whether the clothing of the person object complies with the regulations based on the comparison result.
[0151] Optionally, the determination unit 1002 is specifically used to generate multiple clothing images based on the captured images, each clothing image including a type of clothing of the person object; it is also used to input each clothing image into a pre-stored classification model; it is also used to classify each clothing image separately through the classification model, and output the clothing category corresponding to each clothing image, where the clothing category is the category of clothing included in the corresponding clothing image.
[0152] Optionally, the determining unit 1002 is further configured to generate a human body image according to the captured image, where the human body image includes a human body region of the human object.
[0153] Optionally, the judgment unit 1003 is also used to determine whether the dress of the person object is compliant based on the human body image, each clothing image and the clothing category corresponding to each clothing image when multiple clothing categories include a preset category, and the human body image includes the human body area of the person object; when the multiple clothing categories do not include at least one clothing category in the preset category, it is determined that the dress of the person object is not compliant.
[0154] Optionally, the judgment unit 1003 is further used to generate a category image corresponding to each clothing image based on the clothing category corresponding to each clothing image; it is also used to use channel superposition technology for each clothing image to superimpose the human body image, each clothing image, and the category image corresponding to each clothing image to obtain a target image corresponding to each clothing image; it is also used to input multiple target images into a pre-stored compliance discrimination model; it is also used to perform compliance judgment on multiple target images through the compliance discrimination model, and output result information, where the result information is used to indicate whether the clothing of the person object is compliant.
[0155] Optionally, the judgment unit 1003 is further used to perform the following steps for each target image: obtain the preset rules corresponding to each category image, and determine the position of the clothing in each clothing image on the person object based on the human body image and the clothing image corresponding to each category image; and determine whether the person object's clothing is compliant based on each position and the corresponding preset rules.
[0156] Optionally, the judgment unit 1003 is further configured to generate a category image corresponding to each clothing image based on the category value corresponding to the clothing category corresponding to each clothing image. The pixel value of each pixel in the category image is the category value. The category image, clothing image, and human body image have the same size.
[0157] Optional, combined Figure 10 ,like Figure 11 As shown, the dress code detection device 1000 further includes: an output unit 1101. The output unit 1101 is used to output prompt information, and the prompt information is used to prompt whether the dress of the character object is in compliance with the law. Figure 4 , the output unit 1101 can be used to execute step 401.
[0158] Of course, the dress code detection device 1000 provided by the embodiment of the present invention includes but is not limited to the above modules.
[0159] In actual implementation, the acquisition unit 1001, the determination unit 1002 and the judgment unit 1003 can be composed of Figure 2 The processor 21 shown calls the program code in the memory 22 to implement the process. Figures 3 to 9 The description of the dress code detection method shown in the figure will not be repeated here.
[0160] Another embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on the dress code detection device 1000, the dress code detection device 1000 executes each step executed by the dress code detection device in the method flow shown in the above method embodiment.
[0161] Another embodiment of the present application provides a chip system, which is applied to a dress code detection device 1000. The chip system includes one or more interface circuits and one or more processors 21. The interface circuits and processors 21 are interconnected via circuits. The interface circuits are configured to receive signals from the memory 22 of the dress code detection device 1000 and send these signals to the processors 21. The signals include computer instructions stored in the memory 22. When the processors 21 execute the computer instructions, the dress code detection device 1000 performs the steps performed by the dress code detection device 1000 in the method flow shown in the above method embodiment.
[0162] In another embodiment of the present application, a computer program product is provided. The computer program product includes instructions. When the instructions are executed on the dress code detection device 1000, the dress code detection device 1000 executes each step executed by the dress code detection device 1000 in the method flow shown in the above method embodiment.
[0163] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using a software program, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer-executable instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0164] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed by the present invention shall be covered by the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A dress code detection method, characterized in that: include: Acquire a captured image, wherein the captured image includes a human object and a plurality of clothing items of the human object; determining a clothing category for each of the plurality of clothing items; comparing the plurality of clothing categories with preset categories, the preset categories comprising at least one pre-stored clothing category; Determining whether the clothing of the person object complies with regulations based on the comparison result; The dress code detection method further includes: generating a human body image according to the captured image, wherein the human body image includes a human body region of the human object; Determining whether the clothing of the character object complies with regulations based on the comparison result includes: If the multiple clothing categories include the preset category, determining whether the clothing of the person object is in compliance with the regulations based on the person image, each clothing image, and the clothing category corresponding to each clothing image, the person image including the body region of the person object; If the multiple clothing categories do not include at least one clothing category in the preset categories, determining that the clothing of the character object is not in compliance with regulations; The determining whether the clothing of the person object complies with the regulations based on the human body image, each clothing image, and the clothing category corresponding to each clothing image includes: Generate a category image corresponding to each clothing image according to the clothing category corresponding to each clothing image; For each clothing image, a channel superposition technique is used to superimpose the human body image, each clothing image, and the category image corresponding to each clothing image to obtain a target image corresponding to each clothing image; Input multiple target images into a pre-stored compliance discrimination model; The compliance judgment model is used to perform compliance judgment on the multiple target images, and output result information, where the result information is used to indicate whether the clothing of the person object is compliant.
2. The dress code detection method according to claim 1, characterized in that: Determining the clothing category of each of the multiple clothing items includes: generating a plurality of clothing images according to the captured image, each clothing image including a type of clothing of the human object; Input each clothing image into a pre-existing classification model; Each clothing image is classified by the classification model, and a clothing category corresponding to each clothing image is output, where the clothing category is the category of clothing included in the corresponding clothing image.
3. The dress code detection method according to claim 1, characterized in that: The compliance determination model is used to determine the compliance of the plurality of target images, and output result information, including: For each target image, the following steps are performed: obtaining a preset rule corresponding to each category image, and determining the position of the clothing in each clothing image on the human object based on the human body image and the clothing image corresponding to each category image; According to each position and the corresponding preset rules, it is determined whether the clothing of the character object is compliant.
4. The dress code detection method according to claim 1 or 3, characterized in that: Generating a category image corresponding to each clothing image according to the clothing category corresponding to each clothing image includes: A category image corresponding to each clothing image is generated according to the category value corresponding to the clothing category corresponding to each clothing image, wherein the pixel value of each pixel in the category image is the category value, and the category image, clothing image, and human body image have the same size.
5. The dress code detection method according to claim 1 or 2, characterized in that: The dress code detection method further includes: Output prompt information, where the prompt information is used to prompt whether the clothing of the character object is compliant.
6. A dress code detection device, characterized in that: include: an acquisition unit, configured to acquire a captured image, wherein the captured image includes a human object and a plurality of clothing items of the human object; a determining unit, configured to determine a clothing category of each of the plurality of clothing items in the captured image acquired by the acquiring unit; A judgment unit, configured to compare the plurality of clothing categories with a preset category, wherein the preset category includes at least one pre-stored clothing category; and determine whether the clothing of the character object complies with the regulations based on the comparison result; The determining unit is specifically configured to: generating a human body image according to the captured image, wherein the human body image includes a human body region of the human object; The judgment unit is specifically used to: If the multiple clothing categories include the preset category, determining whether the clothing of the person object is in compliance with the regulations based on the person image, each clothing image, and the clothing category corresponding to each clothing image, the person image including the body region of the person object; If the multiple clothing categories do not include at least one clothing category in the preset categories, determining that the clothing of the character object is not in compliance with regulations; The judgment unit is specifically used to: Generate a category image corresponding to each clothing image according to the clothing category corresponding to each clothing image; For each clothing image, a channel superposition technique is used to superimpose the human body image, each clothing image, and the category image corresponding to each clothing image to obtain a target image corresponding to each clothing image; Input multiple target images into a pre-stored compliance discrimination model; The compliance judgment model is used to perform compliance judgment on the multiple target images, and output result information, where the result information is used to indicate whether the clothing of the person object is compliant.
7. The dress code detection device according to claim 6, characterized in that: The determining unit is specifically configured to: generating a plurality of clothing images according to the captured image, each clothing image including a type of clothing of the human object; Input each clothing image into a pre-existing classification model; Each clothing image is classified by the classification model, and a clothing category corresponding to each clothing image is output, where the clothing category is the category of clothing included in the corresponding clothing image.
8. The dress code detection device according to claim 6, characterized in that: The judgment unit is specifically used to: For each target image, the following steps are performed: obtaining a preset rule corresponding to each category image, and determining the position of the clothing in each clothing image on the human object based on the human body image and the clothing image corresponding to each category image; According to each position and the corresponding preset rules, it is determined whether the clothing of the character object is compliant.
9. The dress code detection device according to claim 6 or 8, characterized in that: The judgment unit is specifically used to: A category image corresponding to each clothing image is generated according to the category value corresponding to the clothing category corresponding to each clothing image, wherein the pixel value of each pixel in the category image is the category value, and the category image, clothing image, and human body image have the same size.
10. The dress code detection device according to claim 6 or 7, characterized in that: The dress code detection device further includes: an output unit; The output unit is used to output prompt information, and the prompt information is used to prompt whether the clothing of the character object is compliant.
11. A dress code detection device, characterized in that: The dress code detection device includes: a processor and a memory; the memory is used to store computer program code, and the computer program code includes computer instructions; when the processor executes the computer instructions, the dress code detection device performs the dress code detection method according to any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that The method comprises computer instructions, which, when executed on a dress code detection device, enable the dress code detection device to perform the dress code detection method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Clothing detection method, device, electronic equipment, program and medium
CN108229559A
Clothing attribute identification method and device, electronic equipment and storage medium
CN109614925A
Employee dressing standard detection method based on improved Faster r-cnn
CN111401418A
Dressing detection method, dressing detection system and computer readable storage medium
CN112766209A