CN112991154B - Method for producing mixture, and method for producing picture of face mask - Google Patents
Method for producing mixture, and method for producing picture of face mask Download PDFInfo
- Publication number
- CN112991154B CN112991154B CN202110285026.5A CN202110285026A CN112991154B CN 112991154 B CN112991154 B CN 112991154B CN 202110285026 A CN202110285026 A CN 202110285026A CN 112991154 B CN112991154 B CN 112991154B
- Authority
- CN
- China
- Prior art keywords
- picture
- target
- mixture
- feature vector
- graphite
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 239000000203 mixture Substances 0.000 title claims abstract description 111
- 238000004519 manufacturing process Methods 0.000 title claims abstract description 10
- VTYYLEPIZMXCLO-UHFFFAOYSA-L Calcium carbonate Chemical compound [Ca+2].[O-]C([O-])=O VTYYLEPIZMXCLO-UHFFFAOYSA-L 0.000 claims abstract description 110
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 claims abstract description 55
- 108010010803 Gelatin Proteins 0.000 claims abstract description 55
- 229910000019 calcium carbonate Inorganic materials 0.000 claims abstract description 55
- 229920000159 gelatin Polymers 0.000 claims abstract description 55
- 239000008273 gelatin Substances 0.000 claims abstract description 55
- 235000019322 gelatine Nutrition 0.000 claims abstract description 55
- 235000011852 gelatine desserts Nutrition 0.000 claims abstract description 55
- 229910002804 graphite Inorganic materials 0.000 claims abstract description 55
- 239000010439 graphite Substances 0.000 claims abstract description 55
- 239000011347 resin Substances 0.000 claims abstract description 55
- 229920005989 resin Polymers 0.000 claims abstract description 55
- 239000013077 target material Substances 0.000 claims abstract description 54
- 239000000463 material Substances 0.000 claims abstract description 40
- 238000000034 method Methods 0.000 claims abstract description 38
- 239000013598 vector Substances 0.000 claims description 176
- 238000004590 computer program Methods 0.000 claims description 7
- 230000001815 facial effect Effects 0.000 abstract description 10
- 238000012549 training Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 8
- 238000013461 design Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 238000001579 optical reflectometry Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000015572 biosynthetic process Effects 0.000 description 3
- 238000003786 synthesis reaction Methods 0.000 description 3
- 238000003491 array Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/04—Context-preserving transformations, e.g. by using an importance map
-
- C—CHEMISTRY; METALLURGY
- C08—ORGANIC MACROMOLECULAR COMPOUNDS; THEIR PREPARATION OR CHEMICAL WORKING-UP; COMPOSITIONS BASED THEREON
- C08L—COMPOSITIONS OF MACROMOLECULAR COMPOUNDS
- C08L101/00—Compositions of unspecified macromolecular compounds
-
- C—CHEMISTRY; METALLURGY
- C08—ORGANIC MACROMOLECULAR COMPOUNDS; THEIR PREPARATION OR CHEMICAL WORKING-UP; COMPOSITIONS BASED THEREON
- C08L—COMPOSITIONS OF MACROMOLECULAR COMPOUNDS
- C08L89/00—Compositions of proteins; Compositions of derivatives thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- C—CHEMISTRY; METALLURGY
- C08—ORGANIC MACROMOLECULAR COMPOUNDS; THEIR PREPARATION OR CHEMICAL WORKING-UP; COMPOSITIONS BASED THEREON
- C08K—Use of inorganic or non-macromolecular organic substances as compounding ingredients
- C08K3/00—Use of inorganic substances as compounding ingredients
- C08K3/18—Oxygen-containing compounds, e.g. metal carbonyls
- C08K3/24—Acids; Salts thereof
- C08K3/26—Carbonates; Bicarbonates
- C08K2003/265—Calcium, strontium or barium carbonate
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Chemical & Material Sciences (AREA)
- General Physics & Mathematics (AREA)
- Biophysics (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Biomedical Technology (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Chemical Kinetics & Catalysis (AREA)
- Medicinal Chemistry (AREA)
- Polymers & Plastics (AREA)
- Organic Chemistry (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
The application provides a method for manufacturing a mixture, the mixture and a method for generating pictures of facial makeup, which comprises the following steps: mixing gelatin, resin, graphite and calcium carbonate to obtain an initial mixture; determining a first characteristic of a picture of the initial mixture and a target characteristic of a picture of the target material; the first feature characterizes a material property of the initial mixture; the target characteristics represent the material properties of the target material; when the relation between the first characteristic and the target characteristic does not meet the preset condition, the mixing proportion among gelatin, resin, graphite and calcium carbonate is updated until the relation between the second characteristic and the target characteristic of the picture of the mixture of the gelatin, resin, graphite and calcium carbonate mixed according to the updated proportion meets the preset condition, and then a large number of masks with the same material as the target material can be manufactured by utilizing the mode, so that the training of the face recognition system is ensured to have sufficient samples.
Description
Technical Field
The application relates to the technical field of materials, in particular to a method for manufacturing a mixture, the mixture and a method for generating pictures of facial makeup.
Background
The samples of the mask with special material are rare, so that the recognition accuracy of the face recognition system trained by using the samples of the mask with special material is not high, and then the face recognition system may erroneously recognize the mask with special material as a face of a real person.
Disclosure of Invention
In view of the above, an object of the embodiments of the present application is to provide a method for producing a mixture, and a method for generating a picture of a facial mask, so as to solve the above-mentioned problems.
In a first aspect, embodiments of the present application provide a method for preparing a mixture, wherein gelatin, resin, graphite and calcium carbonate are mixed to obtain an initial mixture; determining a first characteristic of a picture of the initial mixture and a target characteristic of a picture of the target material; the first feature characterizes a material property of the initial mixture; the target features characterize the material properties of the target material; and updating the mixing proportion among the gelatin, the resin, the graphite and the calcium carbonate when the relation between the first characteristic and the target characteristic does not meet the preset condition, until the relation between the second characteristic of the picture of the mixed mixture of the gelatin, the resin, the graphite and the calcium carbonate according to the updated proportion and the target characteristic meets the preset condition.
In the implementation process, as the characteristics of the pictures of the mixture represent the material property of the mixture, the characteristics of the pictures of the mixture A are more similar to the characteristics of the pictures of the mixture B, and the characteristics of the pictures of the mixture A are more similar to the characteristics of the pictures of the mixture B, therefore, by continuously updating the mixing proportion among gelatin, resin, graphite and calcium carbonate until the relationship among the second characteristics of the pictures of the mixture mixed by the gelatin, the resin, the graphite and the calcium carbonate according to the updated proportion meets the preset condition, the quality of the obtained mixed mixture is basically consistent with the target material, and on the basis, a large number of masks with the consistent material with the target material can be manufactured by utilizing the mode, so that the training of the face recognition system is ensured to have sufficient samples.
Based on the first aspect, in one possible design, the determining the first characteristic of the picture of the initial mixture and the target characteristic of the picture of the target material includes: determining a first feature vector of a picture of the initial mixture and a target feature vector of a picture of the target material; wherein the first feature comprises: the first feature vector; the target features include: the target feature vector; correspondingly, when the relationship between the first feature and the target feature is determined not to meet the preset condition, updating the mixing proportion among the gelatin, the resin, the graphite and the calcium carbonate until the relationship between the second feature and the target feature of the picture of the mixture in which the gelatin, the resin, the graphite and the calcium carbonate are mixed according to the updated proportion meets the preset condition, including: updating the mixing proportion among the gelatin, the resin, the graphite and the calcium carbonate when the cosine similarity between the first feature vector and the target feature vector is smaller than a preset threshold value, until the cosine similarity between the second feature vector and the target feature vector of the picture of the mixture in which the gelatin, the resin, the graphite and the calcium carbonate are mixed according to the updated proportion is not smaller than the preset threshold value; wherein the second feature comprises: the second feature vector.
In the implementation process, since the characteristic vector of the picture of the mixture characterizes the material property of the mixture, the larger the cosine similarity between the characteristic vector of the picture of the mixture A and the characteristic vector of the picture of the mixture B is, the more similar the materials of the mixture A and the mixture B are characterized, therefore, the mixing proportion among gelatin, resin, graphite and calcium carbonate is continuously updated until the cosine similarity between the second characteristic vector of the picture of the mixture, which is obtained by mixing the gelatin, the resin, the graphite and the calcium carbonate according to the updated proportion, and the target characteristic vector is not smaller than the preset threshold value, so as to ensure that the obtained mixed mixture is basically consistent with the target material.
Based on the first aspect, in one possible design, the determining the first characteristic of the picture of the initial mixture and the target characteristic of the picture of the target material includes: determining a first reflectance of a picture of the initial mixture and a second reflectance of a picture of the target material; wherein the first feature comprises: the first reflectance; the target features include: a second degree of reflectance; correspondingly, when the relationship between the first feature and the target feature is determined not to meet the preset condition, updating the mixing proportion among the gelatin, the resin, the graphite and the calcium carbonate until the relationship between the second feature and the target feature of the picture of the mixture in which the gelatin, the resin, the graphite and the calcium carbonate are mixed according to the updated proportion meets the preset condition, including: updating the mixing ratio of the gelatin, the resin, the graphite and the calcium carbonate when the difference between the first reflectance and the second reflectance is greater than or equal to a preset difference, until the difference between the third reflectance and the second reflectance of the picture of the mixture in which the gelatin, the resin, the graphite and the calcium carbonate are mixed according to the updated ratio is smaller than the preset difference; wherein the second feature comprises the third luminosity.
In the implementation process, as the light reflectivities of the pictures of different mixtures are different, the smaller the difference between the light reflectivities of the pictures of the mixture A and the light reflectivities of the pictures of the mixture B is, the more similar the materials of the mixture A and the mixture B are represented, therefore, the mixing proportion among gelatin, resin, graphite and calcium carbonate is continuously updated until the difference between the third light reflectivities of the pictures of the mixture which is obtained by mixing the gelatin, the resin, the graphite and the calcium carbonate according to the updated proportion and the second light reflectivities is smaller than a preset difference value, so that the obtained mixed mixture is basically consistent with the target material in terms of the materials.
In a second aspect, an embodiment of the present application provides a method for generating a picture of a face mask, where the method includes: acquiring a first high-dimensional feature vector of a picture of a target material; the first high-dimensional feature vector characterizes the material attribute and the shape attribute of the object in the target material picture; acquiring a second high-dimensional feature vector of the face picture; the second high-dimensional feature vector characterizes the material attribute and the shape attribute of the object in the face picture; the dimensions of the first high-dimensional feature vector and the second high-dimensional feature vector are equal; according to a preset selection proportion, partial features are respectively selected from the first high-dimensional feature vector and the second high-dimensional feature vector to be spliced, and a spliced feature vector is obtained; the dimensions of the spliced feature vector and the dimensions of the first high-dimensional feature vector are equal; and inputting the spliced feature vectors into a pre-trained generated countermeasure network to obtain a synthesized picture.
In the implementation process, according to the preset selection proportion, partial characteristics are selected from the first high-dimensional characteristic vector of the picture of the target material and the second high-dimensional characteristic vector of the face picture respectively to be spliced, so that spliced characteristic vectors are obtained, and because the spliced characteristic vectors contain the material properties and the shape property characteristics of the picture of the target material and the object in the face picture, the spliced characteristic vectors are input into a pre-trained generation countermeasure network, the obtained synthesized picture comprises the characteristics of the face picture and the object in the picture of the target material, and then the material of the face mask manufactured by using the synthesized picture and the mixed mixture of the first aspect is consistent with the target material, and the shape of the face mask is consistent with the object in the face picture, so that the training of the face recognition system is ensured to have sufficient samples.
Based on the second aspect, in one possible design, the selecting, according to a preset ratio, a part of features from the first high-dimensional feature vector and the second high-dimensional feature vector to be combined to obtain a spliced feature vector includes: and according to the selected preset proportion, respectively randomly selecting part of the features from the first high-dimensional feature vector and the second high-dimensional feature vector to splice, and obtaining the spliced feature vector.
In the implementation process, according to a preset proportion, part of the feature vectors are randomly selected from the first high-dimensional feature vector and the second high-dimensional feature vector to be spliced, so that the spliced feature vectors can reflect the features of the objects in the picture of the target material and the face picture.
Based on the second aspect, in one possible design, the preset ratio is 1:1.
in the above implementation, by setting the preset ratio to 1:1, so that the finally synthesized picture equally comprises the picture of the target material and the characteristics of the object in the face picture, and the situation that the finally synthesized picture only comprises the characteristics of the object in the face picture or only comprises the characteristics of the object in the picture of the target material is avoided.
In a third aspect, an embodiment of the present application provides a mixture, where the mixture is composed of gelatin, resin, graphite and calcium carbonate, and a cosine similarity between a feature vector of a picture of the mixture and a target feature vector of a picture of a target material is not less than a preset threshold.
Based on the third aspect, in one possible design, the difference between the reflectance of the picture of the mixture and the reflectance of the picture of the target material is less than a preset difference.
In a fourth aspect, an embodiment of the present application provides a device for generating a picture of a face mask, where the device includes: a first feature acquisition unit configured to acquire a first high-dimensional feature vector of a picture of a target material; the first high-dimensional feature vector characterizes the material attribute and the shape attribute of the object in the target material picture; the second feature acquisition unit is used for acquiring a second high-dimensional feature vector of the face picture; the second high-dimensional feature vector characterizes the material attribute and the shape attribute of the object in the face picture; the dimensions of the first high-dimensional feature vector and the second high-dimensional feature vector are equal; the splicing unit is used for respectively selecting partial features from the first high-dimensional feature vector and the second high-dimensional feature vector according to a preset selection proportion to splice to obtain spliced feature vectors; the dimensions of the spliced feature vector and the dimensions of the first high-dimensional feature vector are equal; and the picture synthesis unit is used for inputting the spliced feature vectors into a pre-trained generation countermeasure network to obtain synthesized pictures.
Based on the fourth aspect, in one possible design, the stitching unit is specifically configured to randomly select, according to the selection preset ratio, a part of features from the first high-dimensional feature vector and the second high-dimensional feature vector, and stitch the features to obtain the stitched feature vector.
Based on the fourth aspect, in one possible design, the preset ratio is 1:1.
in a fifth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory connected to the processor, where the memory stores a computer program, and when the computer program is executed by the processor, causes the electronic device to perform the method described in the second aspect.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the embodiments of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a method for manufacturing a mixture according to an embodiment of the application.
Fig. 2 is a flowchart illustrating a method for generating a picture of a facial mask according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of a device for generating a picture of a facial mask according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Icon: 300-a device for generating a picture of a mask of a human face; 310-a first feature acquisition unit; 320-a second feature acquisition unit; 330-a splicing unit; 340-a picture synthesis unit; 400-an electronic device; 401-a processor; 402-memory; 403-communication interface.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a flowchart of a method for preparing a mixture according to an embodiment of the present application, and the flowchart shown in fig. 1 will be described in detail, where the method includes: S11-S13.
S11: gelatin, resin, graphite and calcium carbonate were mixed to obtain an initial mixture.
S12: determining a first characteristic of a picture of the initial mixture and a target characteristic of a picture of the target material; the first feature characterizes a material property of the initial mixture; the target feature characterizes a material property of the target material.
S13: and updating the mixing proportion among the gelatin, the resin, the graphite and the calcium carbonate when the relation between the first characteristic and the target characteristic does not meet the preset condition, until the relation between the second characteristic of the picture of the mixed mixture of the gelatin, the resin, the graphite and the calcium carbonate according to the updated proportion and the target characteristic meets the preset condition.
The above method is described in detail below.
S11: gelatin, resin, graphite and calcium carbonate were mixed to obtain an initial mixture.
In actual practice, S11 may be performed as follows, in a preset initial ratio, or by randomly mixing gelatin, resin, graphite and calcium carbonate to obtain an initial mixture. Wherein the initial proportion is set according to the user demand. In this embodiment, the initial ratio may be 1:1:1:1, in other embodiments, the initial ratio may also be 1:2:1:2.
s12: determining a first characteristic of a picture of the initial mixture and a target characteristic of a picture of the target material; the first feature characterizes a material property of the initial mixture; the target feature characterizes a material property of the target material.
As one embodiment, S12 includes: determining a first feature vector of a picture of the initial mixture and a target feature vector of a picture of the target material; wherein the first feature comprises: the first feature vector; the target features include: the target feature vector.
Specifically, after an initial mixture is obtained, the initial mixture is coated on a head die or a mask, then the head die or the mask coated with the initial mixture is shot to obtain a picture of the initial mixture, the picture of the initial mixture is input into a pre-trained convolution model for detecting materials, and a first eigenvector is obtained, wherein the first eigenvector characterizes the material properties of the initial mixture; and inputting the picture of the target material into a convolution model of the detected material to obtain the target feature vector, wherein the target feature vector characterizes the material property of the target material.
Specific embodiments for extracting feature vectors of a picture by using a convolution model of a detected material are well known in the art, and therefore will not be described herein.
In one embodiment, a picture of the target material may be obtained by photographing a head mold or mask made of the target material, which is acquired in advance.
Under the precondition that the proportion of gelatin in the mixture is lower than that of resin, the higher the proportion of gelatin to resin is, the higher the reflection degree of the picture of the initial mixture is; under the precondition that the ratio of graphite in the mixture is lower than that of calcium carbonate, the larger the ratio between calcium carbonate and graphite, the lower the reflectance of the picture of the resulting mixture, and therefore, as an embodiment, S12 includes: determining a first reflectance of a picture of the initial mixture and a second reflectance of a picture of the target material; wherein the first feature comprises: the first reflectance; the target features include: and a second degree of reflectance.
Specifically, a first reflectance of the picture of the initial mixture at infrared light is determined, and a second reflectance of the picture of the target material at infrared light is determined.
S13: and updating the mixing proportion among the gelatin, the resin, the graphite and the calcium carbonate when the relation between the first characteristic and the target characteristic does not meet the preset condition, until the relation between the second characteristic of the picture of the mixed mixture of the gelatin, the resin, the graphite and the calcium carbonate according to the updated proportion and the target characteristic meets the preset condition.
As one embodiment, the first feature includes: the first feature vector; the target features include: when the target feature vector is the target feature vector, S13 includes: updating the mixing proportion among the gelatin, the resin, the graphite and the calcium carbonate when the cosine similarity between the first feature vector and the target feature vector is smaller than a preset threshold value, until the cosine similarity between the second feature vector and the target feature vector of the picture of the mixture in which the gelatin, the resin, the graphite and the calcium carbonate are mixed according to the updated proportion is not smaller than the preset threshold value; wherein the second feature comprises: the second feature vector.
Specifically, after the first feature vector and the target feature vector are determined, determining cosine similarity between the first feature vector and the target feature vector, updating a mixing proportion among the gelatin, the resin, the graphite and the calcium carbonate when the cosine similarity is determined to be smaller than a preset threshold, and mixing the gelatin, the resin, the graphite and the calcium carbonate according to the updated proportion until the cosine similarity between a second feature vector and the target feature vector of a picture of the mixed mixture is larger than or equal to the preset threshold. The preset threshold may be set according to actual requirements, in this embodiment, the preset threshold may be 0.8, and in other embodiments, the preset threshold may also be 0.7,0.9 or 1, etc.
As one embodiment, the first feature includes: the first reflectance; the target features include: in the second reflectance, S13 includes: updating the mixing ratio of the gelatin, the resin, the graphite and the calcium carbonate when the difference between the first reflectance and the second reflectance is greater than or equal to a preset difference, until the difference between the third reflectance and the second reflectance of the picture of the mixture in which the gelatin, the resin, the graphite and the calcium carbonate are mixed according to the updated ratio is smaller than the preset difference; wherein the second feature comprises the third luminosity. The preset difference may be set according to actual requirements, in this embodiment, the preset difference may be 0.4, and in other embodiments, the preset difference may also be 0.3 or 0.5.
Specifically, determining whether the difference between the first reflectance and the second reflectance is smaller than a preset difference, updating the mixing ratio among the gelatin, the resin, the graphite and the calcium carbonate when determining that the difference between the first reflectance and the second reflectance is larger than or equal to the preset difference, and mixing the gelatin, the resin, the graphite and the calcium carbonate according to the updated ratio until the difference between the third reflectance and the second reflectance of the picture of the mixed mixture is smaller than the preset difference.
As one embodiment, the first feature includes: the first eigenvector and a first reflectance; the target features include: the second eigenvector and the second reflectance; s13 may be implemented by determining whether a difference between the first reflectance and the second reflectance is less than a preset difference, determining whether cosine similarity between a first feature vector and a target feature vector is greater than or equal to a preset threshold, updating a mixing ratio among the gelatin, the resin, the graphite, and the calcium carbonate when it is determined that cosine similarity between the second feature vector and the target feature vector is less than the preset threshold, and/or a difference between the first reflectance and the second reflectance is greater than or equal to a preset difference, and mixing the gelatin, the resin, the graphite, and the calcium carbonate according to the updated ratio until cosine similarity between the second feature vector and the target feature vector of a picture of the mixed mixture is greater than or equal to the preset threshold, and a difference between the third reflectance and the second reflectance of a picture of the mixed mixture is less than the preset difference.
Referring to fig. 2, fig. 2 is a flowchart of a method for generating a picture of a face mask according to an embodiment of the present application, where the method includes the steps of: S21-S24.
S21: acquiring a first high-dimensional feature vector of a picture of a target material; the first high-dimensional feature vector characterizes material properties and shape properties of objects in the target material picture.
In the actual implementation process, S21 may be implemented in a manner that a picture of the target material is input into a feature extraction model trained in advance, so as to obtain a first high-dimensional feature vector representing a material attribute and a shape attribute of an object in the picture of the target material; wherein the first high-dimensional feature vector may be a row vector or a column vector.
S22: acquiring a second high-dimensional feature vector of the face picture; the second high-dimensional feature vector characterizes the material attribute and the shape attribute of the object in the face picture; the dimensions of the first high-dimensional feature vector and the second high-dimensional feature vector are equal.
The second high-dimensional feature vector may be a row vector or a column vector, so long as it is guaranteed to be consistent with the first high-dimensional feature vector.
In the specific embodiment of S22, please refer to S21, and therefore, the description thereof is omitted herein.
S23: according to a preset selection proportion, partial features are respectively selected from the first high-dimensional feature vector and the second high-dimensional feature vector to be spliced, and a spliced feature vector is obtained; the dimensions of the spliced feature vector and the dimensions of the first high-dimensional feature vector are equal.
Wherein, the preset ratio may be 1:1, also 1:2, setting according to the requirements of users.
In the actual implementation process, S23 may be implemented in a manner that, according to a preset selection ratio, according to a preset selection direction (from top to bottom, from bottom to top, from left to right, or from right to left), partial elements are sequentially selected from the first high-dimensional feature vector to construct a first sub-feature vector (i.e., a partial feature); selecting partial features from the first high-dimensional feature vector according to the preset direction, sequentially selecting partial elements from the second high-dimensional feature vector to construct a second feature sub-vector (namely partial features), and splicing the first feature sub-vector behind or in front of the second feature sub-vector to obtain a spliced feature vector; the dimensions of the spliced feature vector and the dimensions of the first high-dimensional feature vector are equal.
For ease of understanding, the following illustrates the manner in which the splice vector is obtained, assuming that the preset ratio is 1:1, a first high-dimensional feature vector is [1,2,4,5,3,7,8,3,6,1]; the first high-dimensional feature vector is [2,1,3,4,6,5,8,3,7,9]; if the first feature sub-vector is formed by 1,2,4,5,3 as a part of elements extracted from the first high-dimensional feature vector according to the left-to-right selection direction, the first feature sub-vector is [1,2,4,5,3]; according to the left-to-right selection direction, the first feature sub-vector formed by the 2,1,3,4,6 partial elements extracted from the second high-dimensional feature vector is [2,1,3,4,6]; then, if the first feature sub-vector is spliced in front of the second feature sub-vector, the resulting spliced vector is [1,2,4,5,3,2,1,3,4,6].
As one embodiment, S23 includes: and according to the selected preset proportion, respectively randomly selecting part of the features from the first high-dimensional feature vector and the second high-dimensional feature vector to splice, and obtaining the spliced feature vector.
Specifically, according to a preset selection proportion, according to a preset selection direction (from top to bottom, from bottom to top, from left to right or from right to left), randomly selecting part of elements from the first high-dimensional feature vector to construct a first sub-feature vector (namely, part of features); selecting partial features from the first high-dimensional feature vector according to the preset direction, randomly selecting partial elements from the second high-dimensional feature vector to construct a second feature sub-vector (namely partial features), and splicing the first feature sub-vector behind or in front of the second feature sub-vector to obtain a spliced feature vector; the dimensions of the spliced feature vector and the dimensions of the first high-dimensional feature vector are equal.
For ease of understanding, the following illustrates the manner in which the splice vector is obtained, assuming that the preset ratio is 1:1, a first high-dimensional feature vector is [1,2,4,5,3,7,8,3,6,1]; the first high-dimensional feature vector is [2,1,3,4,6,5,8,3,7,9]; if the partial elements randomly selected from the first high-dimensional feature vector are 1,5,7,8,6 according to the left-to-right selection direction, the first feature sub-vector is [1,5,7,8,6]; according to the left-to-right selection direction, the first feature sub-vector formed by the 2,3,4,8,7 partial elements randomly selected from the second high-dimensional feature vector is [2,3,4,8,7]; then, if the first feature sub-vector is spliced behind the second feature sub-vector, the resulting spliced vector is [1,5,7,8,6,2,3,4,8,7].
S24: and inputting the spliced feature vectors into a pre-trained generated countermeasure network to obtain a synthesized picture.
The specific implementation of training to generate the countermeasure network is well known in the art, and therefore will not be described herein.
In this embodiment, the generating countermeasure network is StyleGAN2, and in other embodiments, the generating countermeasure network may be another network capable of outputting a picture according to a feature vector.
As an implementation manner, the embodiment of the application provides a mixture, which is composed of gelatin, resin, graphite and calcium carbonate, wherein the cosine similarity between the characteristic vector of the picture of the mixture and the target characteristic vector of the picture of the target material is not smaller than a preset threshold value.
As one embodiment, the difference between the reflectance of the picture of the mixture and the reflectance of the picture of the target material is less than a preset difference.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a device 300 for generating a picture of a facial mask according to an embodiment of the present application, where the device includes:
a first feature acquiring unit 310, configured to acquire a first high-dimensional feature vector of a picture of a target material; the first high-dimensional feature vector characterizes material properties and shape properties of objects in the target material picture.
A second feature obtaining unit 320, configured to obtain a second high-dimensional feature vector of the face picture; the second high-dimensional feature vector characterizes the material attribute and the shape attribute of the object in the face picture; the dimensions of the first high-dimensional feature vector and the second high-dimensional feature vector are equal.
The splicing unit 330 is configured to respectively select a part of features from the first high-dimensional feature vector and the second high-dimensional feature vector according to a preset selection ratio, and splice the features to obtain a spliced feature vector; the dimensions of the spliced feature vector and the dimensions of the first high-dimensional feature vector are equal.
And the picture synthesis unit 340 is configured to input the spliced feature vector into a pre-trained generating countermeasure network, so as to obtain a synthesized picture.
As an implementation manner, the stitching unit 330 is specifically configured to randomly select, according to the selection preset ratio, a part of features from the first high-dimensional feature vector and the second high-dimensional feature vector, and stitch the part of features, so as to obtain the stitched feature vector.
As an embodiment, the preset ratio is 1:1.
for the process of implementing the respective functions by the functional units in this embodiment, please refer to the content described in the embodiment shown in fig. 2, which is not described herein again.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device 400 according to an embodiment of the application, where the electronic device 400 may be a personal computer, a tablet computer, a smart phone, a personal digital assistant (personal digital assistant, PDA), etc.
The electronic device 400 may include: memory 402, processor 401, communication interface 403, and a communication bus for implementing the connected communication of these components.
The Memory 402 is used for storing various data such as computer program instructions corresponding to the method and apparatus for generating a picture of a facial mask according to the embodiments of the present application, where the Memory 402 may be, but is not limited to, a random access Memory (ram), a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), and the like.
The processor 401 is configured to read and execute computer program instructions corresponding to the method and apparatus for generating a picture of a facial mask stored in the memory, so as to obtain a synthesized picture.
The processor 401 may be an integrated circuit chip with signal processing capability. The processor 401 may be a general-purpose processor including a CPU, a network processor (Network Processor, NP), etc.; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
A communication interface 403 for receiving or transmitting data.
In addition, the embodiment of the application also provides a storage medium, in which a computer program is stored, which when run on a computer, causes the computer to execute the method provided by any one of the embodiments of the application.
In summary, according to the method for manufacturing a mixture, the mixture and the method for generating a picture of a facial mask provided by the embodiments of the present application, since the characteristics of the picture of the mixture represent the material properties of the mixture, the more similar the characteristics of the picture of the mixture a and the characteristics of the picture of the mixture B are, the more similar the characteristics of the picture of the mixture a and the material of the mixture B are represented, therefore, by continuously updating the mixing ratio of gelatin, resin, graphite and calcium carbonate until the relationship between the second characteristics of the picture of the mixture in which the gelatin, the resin, graphite and calcium carbonate are mixed according to the updated ratio meets the preset condition, the quality of the obtained mixed mixture is ensured to be substantially consistent with the target material, and on this basis, a large number of masks with the consistent material with the target material are manufactured by using the above method, thereby ensuring that training of the facial mask system has sufficient samples.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, of the flowcharts and block diagrams in the figures that illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based devices which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
Claims (5)
1. A method of making a mixture, the method comprising:
mixing gelatin, resin, graphite and calcium carbonate to obtain an initial mixture;
determining a first characteristic of a picture of the initial mixture and a target characteristic of a picture of a target material, wherein the picture of the initial mixture is obtained by photographing a head mold or mask coated with the initial mixture, and wherein the target material comprises gelatin, resin, graphite, and calcium carbonate; the first feature characterizes a material property of the initial mixture; the target features characterize the material properties of the target material;
and when the relation between the first characteristic and the target characteristic does not meet the preset condition, updating the mixing proportion among the gelatin, the resin, the graphite and the calcium carbonate until the relation between the second characteristic of the picture of the mixed mixture of the gelatin, the resin, the graphite and the calcium carbonate according to the updated proportion and the target characteristic meets the preset condition.
2. The method of claim 1, wherein determining the first characteristic of the picture of the initial mixture and the target characteristic of the picture of the target material comprises:
determining a first feature vector of a picture of the initial mixture and a target feature vector of a picture of the target material; wherein the first feature comprises: the first feature vector; the target features include: the target feature vector;
correspondingly, when the relationship between the first feature and the target feature is determined not to meet the preset condition, updating the mixing proportion among the gelatin, the resin, the graphite and the calcium carbonate until the relationship between the second feature and the target feature of the picture of the mixture in which the gelatin, the resin, the graphite and the calcium carbonate are mixed according to the updated proportion meets the preset condition, including:
updating the mixing proportion among the gelatin, the resin, the graphite and the calcium carbonate when the cosine similarity between the first feature vector and the target feature vector is smaller than a preset threshold value, until the cosine similarity between the second feature vector and the target feature vector of the picture of the mixture in which the gelatin, the resin, the graphite and the calcium carbonate are mixed according to the updated proportion is not smaller than the preset threshold value; wherein the second feature comprises: the second feature vector.
3. The method of claim 1, wherein determining the first characteristic of the picture of the initial mixture and the target characteristic of the picture of the target material comprises:
determining a first reflectance of a picture of the initial mixture and a second reflectance of a picture of the target material; wherein the first feature comprises: the first reflectance; the target features include: a second degree of reflectance;
correspondingly, when the relationship between the first feature and the target feature is determined not to meet the preset condition, updating the mixing proportion among the gelatin, the resin, the graphite and the calcium carbonate until the relationship between the second feature and the target feature of the picture of the mixture in which the gelatin, the resin, the graphite and the calcium carbonate are mixed according to the updated proportion meets the preset condition, including:
updating the mixing ratio of the gelatin, the resin, the graphite and the calcium carbonate when the difference between the first reflectance and the second reflectance is greater than or equal to a preset difference, until the difference between the third reflectance and the second reflectance of the picture of the mixture in which the gelatin, the resin, the graphite and the calcium carbonate are mixed according to the updated ratio is smaller than the preset difference; wherein the second feature comprises the third luminosity.
4. A mixture, characterized in that it is produced according to the method of any one of claims 1-3.
5. An electronic device comprising a memory and a processor, the memory having stored therein computer program instructions that, when read and executed by the processor, perform the method of any of claims 1-3.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110285026.5A CN112991154B (en) | 2021-03-17 | 2021-03-17 | Method for producing mixture, and method for producing picture of face mask |
CN202311263322.0A CN117173008A (en) | 2021-03-17 | 2021-03-17 | Method for producing mixture, and method for producing picture of face mask |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110285026.5A CN112991154B (en) | 2021-03-17 | 2021-03-17 | Method for producing mixture, and method for producing picture of face mask |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311263322.0A Division CN117173008A (en) | 2021-03-17 | 2021-03-17 | Method for producing mixture, and method for producing picture of face mask |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112991154A CN112991154A (en) | 2021-06-18 |
CN112991154B true CN112991154B (en) | 2023-10-17 |
Family
ID=76333020
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311263322.0A Pending CN117173008A (en) | 2021-03-17 | 2021-03-17 | Method for producing mixture, and method for producing picture of face mask |
CN202110285026.5A Active CN112991154B (en) | 2021-03-17 | 2021-03-17 | Method for producing mixture, and method for producing picture of face mask |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311263322.0A Pending CN117173008A (en) | 2021-03-17 | 2021-03-17 | Method for producing mixture, and method for producing picture of face mask |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN117173008A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103514443A (en) * | 2013-10-15 | 2014-01-15 | 中国矿业大学 | Single-sample face recognition transfer learning method based on LPP (Low Power Point) feature extraction |
CN105185214A (en) * | 2015-11-02 | 2015-12-23 | 郑佳平 | Neurosurgical operation training or preoperative simulation operation model device |
CN108785017A (en) * | 2018-06-15 | 2018-11-13 | 青岛市中心医院 | Rehabilitation training system and its application method after a kind of mouth neoplasm radiotherapy |
WO2019119505A1 (en) * | 2017-12-18 | 2019-06-27 | 深圳云天励飞技术有限公司 | Face recognition method and device, computer device and storage medium |
CN110458233A (en) * | 2019-08-13 | 2019-11-15 | 腾讯云计算(北京)有限责任公司 | Combination grain object identification model training and recognition methods, device and storage medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030225719A1 (en) * | 2002-05-31 | 2003-12-04 | Lucent Technologies, Inc. | Methods and apparatus for fast and robust model training for object classification |
CN106407912B (en) * | 2016-08-31 | 2019-04-02 | 腾讯科技(深圳)有限公司 | A kind of method and device of face verification |
-
2021
- 2021-03-17 CN CN202311263322.0A patent/CN117173008A/en active Pending
- 2021-03-17 CN CN202110285026.5A patent/CN112991154B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103514443A (en) * | 2013-10-15 | 2014-01-15 | 中国矿业大学 | Single-sample face recognition transfer learning method based on LPP (Low Power Point) feature extraction |
CN105185214A (en) * | 2015-11-02 | 2015-12-23 | 郑佳平 | Neurosurgical operation training or preoperative simulation operation model device |
WO2019119505A1 (en) * | 2017-12-18 | 2019-06-27 | 深圳云天励飞技术有限公司 | Face recognition method and device, computer device and storage medium |
CN108785017A (en) * | 2018-06-15 | 2018-11-13 | 青岛市中心医院 | Rehabilitation training system and its application method after a kind of mouth neoplasm radiotherapy |
CN110458233A (en) * | 2019-08-13 | 2019-11-15 | 腾讯云计算(北京)有限责任公司 | Combination grain object identification model training and recognition methods, device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN117173008A (en) | 2023-12-05 |
CN112991154A (en) | 2021-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109146892B (en) | Image clipping method and device based on aesthetics | |
US10474929B2 (en) | Cyclic generative adversarial network for unsupervised cross-domain image generation | |
CN111814857B (en) | Target re-identification method, network training method thereof and related device | |
US11749020B2 (en) | Method and apparatus for multi-face tracking of a face effect, and electronic device | |
CN111241340B (en) | Video tag determining method, device, terminal and storage medium | |
CN112419170A (en) | Method for training occlusion detection model and method for beautifying face image | |
US20230146676A1 (en) | Portrait stylization framework to control the similarity between stylized portraits and original photo | |
CN110162604B (en) | Statement generation method, device, equipment and storage medium | |
CN110928411B (en) | AR-based interaction method and device, storage medium and electronic equipment | |
US11604963B2 (en) | Feedback adversarial learning | |
CN106327473A (en) | Method and device for acquiring foreground images | |
CN109902759B (en) | Picture set description method and device | |
CN113395583B (en) | Watermark detection method, watermark detection device, computer equipment and storage medium | |
CN115661320A (en) | Image processing method and electronic device | |
CN114285944B (en) | Video color ring generation method and device and electronic equipment | |
CN112991154B (en) | Method for producing mixture, and method for producing picture of face mask | |
CN110019907B (en) | Image retrieval method and device | |
CN116863042A (en) | Motion generation method of virtual object and training method of motion generation model | |
CN117689752A (en) | Literary work illustration generation method, device, equipment and storage medium | |
CN117670655A (en) | Image generation method, device, electronic equipment, storage medium and chip | |
CN109271706B (en) | Hair style generation method and device | |
US20230401670A1 (en) | Multi-scale autoencoder generation method, electronic device and readable storage medium | |
CN115580690B (en) | Image processing method and electronic equipment | |
CN116048682A (en) | Terminal system interface layout comparison method and electronic equipment | |
CN114612321A (en) | Video processing method, device and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |