WO2020048388A1 - 图片生成方法和装置、存储介质及电子装置 - Google Patents

图片生成方法和装置、存储介质及电子装置 Download PDF

Info

Publication number
WO2020048388A1
WO2020048388A1 PCT/CN2019/103510 CN2019103510W WO2020048388A1 WO 2020048388 A1 WO2020048388 A1 WO 2020048388A1 CN 2019103510 W CN2019103510 W CN 2019103510W WO 2020048388 A1 WO2020048388 A1 WO 2020048388A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
network model
sample
target
model
Prior art date
Application number
PCT/CN2019/103510
Other languages
English (en)
French (fr)
Inventor
巩晓波
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2020048388A1 publication Critical patent/WO2020048388A1/zh
Priority to US17/081,551 priority Critical patent/US11538208B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/776Validation; Performance evaluation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/22Cropping

Definitions

  • This application relates to the field of computers, and in particular, to image processing technologies.
  • the image elements contained in the picture are often adjusted accordingly, such as adjusting the combination of different image elements to synthesize a new picture.
  • the above-mentioned terminal application usually directly combines and stitches different image elements directly. For example, when editing hairstyles in a portrait picture, directly paste different types of hairstyles near the face of the same object, thereby generating pictures with different hairstyles for the object.
  • the user often selects a hairstyle suitable for the object in the picture from a variety of hairstyles, and needs to constantly switch to see the effect of various hairstyles to finally make a decision.
  • the hairstyle you have chosen In this way, users often cannot determine the most suitable hairstyle for multiple operations. For users, they cannot quickly choose the best solution. The user experience is poor, and the system needs to respond multiple times. Operation, wasting system resources.
  • the embodiments of the present application provide a picture generating method and device, a storage medium, and an electronic device, in order to simplify user operations and facilitate users to quickly generate a required synthetic hairstyle picture, which can improve system resource utilization to a certain extent.
  • a picture generating method which is applied to user equipment and includes: obtaining a source portrait picture displaying a target object; and cropping the source portrait picture to obtain a face corresponding to the target object.
  • the face region picture is input to the picture generation model and the output result of the picture generation model is obtained, wherein the picture generation model is obtained by machine training using a plurality of sample pictures through an adversarial neural network model; using the above An output result of the picture generation model generates a target portrait picture, where the target portrait picture displays a target hairstyle matching the face of the target object.
  • a picture generating device including: a first obtaining unit for obtaining a source portrait picture displaying a target object; and a cropping unit for cropping the source portrait picture To obtain a face area picture corresponding to the face of the target object; an input unit configured to input the face area picture into a picture generation model and obtain an output result of the picture generation model, wherein the picture generation model is through an adversarial neural network
  • the model is obtained after machine training by using a plurality of sample pictures;
  • a generating unit is configured to generate a target portrait picture by using the above-mentioned picture to generate a model output result, wherein the target portrait picture displays a target matching the face of the target subject hairstyle.
  • the first obtaining module includes: a determining submodule for determining a candidate hairstyle set according to the facial features of the target object; and a first obtaining submodule for obtaining a candidate hairstyle set from the candidate hairstyle set.
  • the hairstyle with the highest degree of matching with the facial features of the target object is used as the target hairstyle.
  • the generating module includes: a replacing submodule, configured to replace the target hairstyle with the original hairstyle of the target object in the source portrait picture to generate the target portrait picture.
  • the second obtaining unit includes: a second obtaining module configured to obtain a valid sample picture set matching a valid field from the network, where the valid field includes an object field for indicating a hotspot object;
  • the first determining module is configured to use the valid sample pictures in the valid sample picture set as the multiple sample pictures for training the adversarial neural network model.
  • the training unit includes: repeatedly performing the following steps until the output result of the generating network model in the adversarial neural network model converges to a predetermined threshold: a first training module for training the adversarial The above-mentioned judgment network model in the neural network model is obtained until a convergence judgment network model is obtained; a second training module is used to train the above-mentioned generation network model using the above convergence judgment network model until a convergence-generated network model is obtained; a third training module is used for When the output result of the convergence generation network model does not converge to the predetermined threshold, use the convergence generation network model to continue training the judgment network model; a second determination module for converging the output result of the convergence generation network model to In the case of the predetermined threshold, the convergence generation network model that has converged to the predetermined threshold is used as the picture generation model.
  • the first training module includes: repeatedly performing the following steps until the convergence judgment network model is obtained: a second acquisition submodule, configured to acquire a first current sample source displaying a first sample object Portrait picture; a first cropping sub-module for cropping the first current sample source portrait picture to obtain a first sample facial area picture corresponding to the face of the first sample object; a first input sub-module, Inputting the first sample facial area picture into the generating network model to generate a first current sample target portrait picture of the first sample object; a second input sub-module, configured to combine the first sample facial area picture with A first sample pair consisting of the first current sample source portrait picture and a second sample pair consisting of the first sample face area picture and the first current sample target portrait picture are input to the judgment network model for training; Three acquisition sub-modules are used to acquire the next display if the output of the above-mentioned judgment network model does not converge First sample object portrait image sample source, the current sample as the first portrait image source; Fourth obtaining sub-module,
  • the above-mentioned second training module includes: repeatedly performing the following steps until the above-mentioned convergence-generating network model is obtained: a fifth obtaining sub-module for obtaining a second current sample source portrait showing a second sample object A picture; a second cropping sub-module for cropping the second current sample source portrait picture to obtain a second sample facial area picture corresponding to the face of the second sample object; a third input sub-module for transforming the above The second sample face area picture is input into the above generating network model to generate a second current sample target portrait picture of the second sample object; a fourth input submodule is configured to combine the second sample face area picture with the second current sample source A third sample pair consisting of a portrait picture, and a fourth sample pair consisting of the second sample face area picture and the second current sample target portrait picture are input to the convergence judgment network model; a sixth acquisition submodule is used for the above When the output of the convergence judgment network model indicates that the above-mentioned generated network model does not converge To obtain
  • a non-volatile computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the above-mentioned picture generation method when running.
  • an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the foregoing by using the computer program.
  • Picture generation method
  • a source portrait picture displaying a target object is obtained; the source portrait picture is cropped to obtain a face region picture corresponding to the face of the target object; and the face region picture is input into the picture Generate a model and obtain the output result of the picture generation model, where the picture generation model is obtained after machine training using multiple sample pictures through an adversarial neural network model; using the output results of the picture generation model to generate a target portrait picture,
  • the target portrait picture displays a target hairstyle matching the face of the target object.
  • the target portrait picture of the target hairstyle matching the face does not need the user to artificially generate the target portrait picture based on the personal aesthetic matching hairstyle multiple times, which improves the generation efficiency of the target portrait picture, and it is convenient for the user to quickly determine the best solution. user experience.
  • FIG. 1 is a schematic diagram of an application environment of an optional picture generating method according to an embodiment of the present application
  • FIG. 2 is a schematic flowchart of an optional picture generating method according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of an optional picture generating method according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of another optional picture generating method according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of another optional picture generating method according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of another optional picture generating method according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of another optional picture generating method according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an optional picture generating device according to an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of another optional picture generating apparatus according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an optional electronic device according to an embodiment of the present application.
  • a picture generating method is provided as an optional implementation manner, and the above picture generating method may be applied to the environment shown in FIG. 1, but is not limited thereto.
  • the user 102 may perform human-computer interaction with the user equipment 104.
  • the user equipment 104 includes a memory 106 and a processor 108.
  • the user device 104 obtains a source portrait picture displaying the target object, and crops the source portrait picture to obtain a face region picture corresponding to the face of the target object.
  • the user equipment 104 sends the obtained facial area picture to the server 112 through the network 110.
  • the server 112 includes an index database 114 and a picture generation model 116.
  • the picture generation model 116 includes a judgment network model 118 and a generation network model 120. After the picture generation model 116 obtains the facial area picture, a target portrait picture is generated based on the facial area picture, and the target portrait picture is sent to the user device 104 through the network 110 through step S104.
  • the object in the generated picture matches the replaced hairstyle.
  • the above facial area picture is input into the trained adversarial neural network model, and the adversarial neural network model generates and displays the target and the target image.
  • the target portrait picture of the target hairstyle matching the face of the subject no longer requires the user to artificially generate the target portrait picture based on personal aesthetic matching hairstyles multiple times, which improves the generation efficiency of the target portrait picture, making it easier for users to quickly determine the best solution and improve User experience.
  • the above picture generating method may be applied to, but not limited to, terminals that can calculate data, such as mobile phones, tablet computers, notebook computers, and PCs.
  • the above networks may include, but are not limited to, wireless networks or wired networks.
  • the wireless network includes: wireless fidelity (WIFI) and other networks that implement wireless communication.
  • the wired network may include, but is not limited to, a wide area network, a metropolitan area network, and a local area network.
  • the foregoing server may include, but is not limited to, any hardware device capable of performing calculations.
  • the foregoing picture generating method includes:
  • S208 Use the output result of the picture generation model to generate a target portrait picture, where the target portrait picture displays a target hairstyle that matches the face of the target object.
  • the above-mentioned picture generating method may be, but is not limited to, applied to the field of wedding photo retouching, or applied to a mobile terminal camera, or used in the field of photo landscaping.
  • the above-mentioned facial area picture may be, but is not limited to, a picture of a face remaining after cutting out hair of a target object in the source portrait picture.
  • 302 is an optional source portrait picture
  • the source portrait picture includes a target object 304, a target object 306, and a target object 308.
  • the face 310 of the target object 304, the face 312 of the target object 306, and the face 314 of the target object 308 are extracted.
  • the face of each target object is cropped to generate a face region picture corresponding to the face of each target object.
  • a face area picture 316, a face area picture 318, and a face area picture 320 are obtained.
  • the face area picture 318 is input into a picture generation model to obtain a face 402 with a changed hairstyle.
  • the facial area picture obtained by cropping the source portrait picture is obtained, the facial area picture is input into the trained adversarial neural network model, and the adversarial neural network model is used. Generate a target portrait picture showing a target hairstyle matching the face of the target object, thereby eliminating the need for the user to manually generate a target portrait picture based on personal aesthetic matching hairstyles multiple times, improving the generation efficiency of the generated target portrait picture, and facilitating users to quickly Identifying the best solution improves the user experience.
  • the above cropping the source portrait picture to obtain a face area picture includes:
  • the source portrait picture contains a target object
  • the source portrait picture is cropped to obtain a face area picture.
  • the source portrait picture contains multiple target objects
  • the source portrait picture is cropped to obtain a facial area picture corresponding to the face of each target object.
  • the multiple target objects may be cropped and divided to obtain multiple portrait pictures, and each portrait picture includes a target object, and then A cropping step is performed on each portrait picture to obtain a facial area picture corresponding to each target object.
  • the source portrait picture in FIG. 3 includes 3 target objects.
  • the source portrait picture is first cropped into 3 portrait pictures, each portrait picture contains a target object, and then each portrait picture is cropped to obtain multiple facial area pictures.
  • all target objects are cropped at once to obtain multiple facial area pictures.
  • the face of each target object is cropped at once to obtain 3 facial area pictures, and the 3 facial area pictures correspond to the faces of the 3 target objects, respectively. .
  • obtaining the output result of the picture generation model includes: extracting from the face area picture by using an encoding module in the picture generation model. Facial features that match the face of the target object; the target hairstyle that matches the facial features of the target object is obtained through the decoding module in the picture generation model.
  • using the output result of the picture generation model to generate the target portrait picture includes: replacing the original hairstyle of the target object in the source portrait picture with the target hairstyle to generate the target portrait picture.
  • the aforementioned encoding module may, but is not limited to, extracting facial features that match the face of the target object by identifying the color of each pixel in the face area picture.
  • the foregoing decoding module may, but is not limited to, generating multiple hairstyles, and selecting one of the multiple hairstyles as a target hairstyle.
  • the obtaining the target hairstyle matching the facial features of the target object through the decoding module includes: determining a candidate hairstyle set according to the facial features of the target object; and obtaining a match from the candidate hairstyle set to the facial features of the target object The hairstyle with the highest degree is used as the target hairstyle.
  • each output result carries a probability, and the probability is greater than or equal to zero and less than or equal to 1.
  • the above probability can be expressed as a fraction or as a decimal. The greater the probability, the more realistic the display effect of the output result.
  • the probability in the above output result may be used as the matching degree.
  • the hairstyles in the candidate hairstyle set may be sorted according to the degree of matching with the facial features of the target object. The higher the degree of matching, the higher the ranking of hairstyles.
  • the method before obtaining the source portrait picture displaying the target object, the method further includes: obtaining multiple sample pictures; and training the adversarial neural network model by using the multiple sample pictures, wherein the adversarial neural network model includes: a model with a picture generation A matching generation network model and a determination network model for determining a generation result of the generation network model.
  • the above sample pictures may be obtained, but not limited to, obtained by directly downloading the public pictures, or obtained by using a crawler method.
  • the above sample pictures may be obtained from, but not limited to, a set of valid sample pictures searched by inputting a valid field.
  • the valid field mentioned above may be, but is not limited to, any descriptive words, such as handsome guy, beauty, long hair, short hair, etc.
  • a valid sample picture set and a valid sample picture set are searched. Contains valid sample pictures corresponding to short hair.
  • the valid sample picture in the obtained valid sample picture set is used as a sample picture for training an adversarial neural network model.
  • the adversarial neural network model includes generating a network model and determining a network model.
  • training the adversarial neural network model may include, but is not limited to, the following steps:
  • the predetermined threshold may be, but is not limited to, a preset value.
  • the predetermined threshold is greater than or equal to zero and less than or equal to 1.
  • the predetermined threshold is 0.5
  • the above-mentioned output result converges to the predetermined threshold may be, but is not limited to, the output result is greater than or equal to 0.5.
  • After generating the network model and obtaining the output results use the convergence judgment network model to judge the obtained output results. If it is determined that the output result is less than 0.5, continue to train the convergence judgment network model and the convergence generation network model. If it is determined that the output result is greater than or equal to 0.5, the convergence generation network model is determined as a picture generation model, and the picture generation model is used to process the face region picture to obtain the target portrait picture.
  • the judgment network model may be trained through the following steps: repeatedly performing the following steps until a convergence judgment network model is obtained: obtaining a first current sample source portrait picture showing a first sample object; and comparing the first current sample
  • the source portrait picture is cropped to obtain a first sample face area picture corresponding to the face of the first sample object; the first sample face area picture is input to a network model to generate a first current sample target of the first sample object A portrait picture; a first sample pair consisting of a first sample face area picture and a first current sample source portrait picture, and a second sample pair consisting of a first sample face area picture and a first current sample target portrait picture, Enter the judgment network model for training; if the output of the judgment network model does not converge, obtain the next sample source portrait picture showing the first sample object as the first current sample source portrait picture; When the output results converge, a convergence judgment network model is obtained.
  • using the above convergence judgment network model training to generate a network model may, but is not limited to, using the following steps: Repeat the following steps until a convergence is obtained to generate a network model: obtaining The second current sample source portrait picture is cropped; the second current sample source portrait picture is cropped to obtain a second sample face region picture corresponding to the face of the second sample object; the second sample face region picture is input into a network model to generate a first The second current sample target portrait picture of the two sample objects; a third sample pair consisting of the second sample face region picture and the second current sample source portrait picture, and the second sample face region picture and the second current sample target portrait picture The fourth sample pair, input the convergence judgment network model; if the output of the convergence judgment network model indicates that the generated network model is not converged, obtain the next sample source portrait picture showing the second sample object as the second current sample Source portrait picture; network model for convergence judgment The output indicates the case where the convergence of generating a network model, generating a network model to obtain convergence.
  • the facial area picture is input into a trained adversarial neural network model, and the adversarial neural network model generates
  • the target portrait picture of the target hairstyle matching the face eliminates the need for the user to manually generate the target portrait picture based on the individual aesthetic matching of the hairstyle multiple times, which improves the generation efficiency of the target portrait picture and facilitates the user to quickly determine the best solution and improves user experience.
  • inputting a picture of a facial area into a picture generation model and obtaining an output result of the picture generation model includes:
  • the above-mentioned encoding module may, but is not limited to, extracting facial features that match the face of the target object by identifying the color of each pixel in the face area picture.
  • the decoding module may generate, but is not limited to, multiple hairstyles, and select one of the multiple hairstyles as the target hairstyle, and replace the original hairstyle of the target object to generate the target portrait picture.
  • facial features are extracted through an encoding module in a picture generation model, and a target hairstyle is obtained through a decoding module in the picture generation model.
  • a target portrait picture is further generated according to the target hairstyle, and the generated target portrait picture is guaranteed to a certain extent. Meet user expectations.
  • obtaining a target hairstyle matching a facial feature of a target object through a decoding module in a picture generation model includes:
  • the hairstyles are sorted according to the matching degree, and the hairstyle with the highest matching degree is determined as the target hairstyle.
  • the starting pattern 1 can be determined as the target hairstyle.
  • using the output result of the image generation model to generate the target portrait image includes:
  • the original hairstyle of the target object is cropped, and the original hairstyle is replaced with the target hairstyle to obtain the target portrait picture, or the target hairstyle is directly overlaid on the original hairstyle to obtain the target portrait picture.
  • a suitable target hairstyle can be selected for the target object, which facilitates the user to quickly determine the best solution and improves the user experience.
  • the method before obtaining the source portrait picture displaying the target object, the method further includes:
  • the above sample pictures may be obtained, but not limited to, obtained by directly downloading public pictures, or obtained by using a crawler method. For example, downloading multiple sample pictures from a set of pictures that have been published on the Internet; further, training multiple adversarial neural network models using multiple sample pictures.
  • obtaining multiple sample pictures includes:
  • the above valid field may be, but is not limited to, any descriptive words, such as handsome guy, beauty, long hair, short hair, traditional, classic, fashion, sexy, trendy, etc.
  • Search for a set of valid sample pictures where the set of valid sample pictures contains valid sample pictures corresponding to short hair.
  • the valid sample pictures in the obtained valid sample picture set are used to train the adversarial neural network model.
  • an effective sample picture is selected as a picture for training an adversarial neural network model according to an effective field, so that the adversarial neural network model can be selectively trained, and the training efficiency of the neural network model is improved.
  • training an adversarial neural network model using multiple sample pictures includes:
  • the predetermined threshold may be, but is not limited to, a preset value.
  • the predetermined threshold is greater than or equal to zero and less than or equal to 1.
  • the predetermined threshold is 0.5
  • the above-mentioned output result converges to the predetermined threshold may be, but is not limited to, the output result is greater than or equal to 0.5.
  • After generating the network model and obtaining the output results use the convergence judgment network model to judge the obtained output results. If it is determined that the output result is less than 0.5, continue to train the convergence judgment network model and the convergence generation network model. If it is determined that the output result is greater than or equal to 0.5, the convergence generation network model is determined as a picture generation model, and the picture generation model is used to process the face region picture to obtain the target portrait picture.
  • the judgment network model and the generated network model are trained through the above steps to obtain a convergence judgment network model and a convergence generation network model, and the convergence generation network model is used as a picture generation model, so that users can quickly determine the best Program to improve user experience.
  • the judgment network model in training the adversarial neural network model includes:
  • the first sample pair consisting of the first sample face area picture and the first current sample source portrait picture, and the second sample pair consisting of the first sample face area picture and the first current sample target portrait picture are input.
  • Judge network model for training
  • FIG. 6 is a schematic diagram of a process of training a judgment network model.
  • the face of the target object in the source portrait picture is cropped to obtain a face area picture, and the face area picture is input into a generated network model to obtain an output result.
  • the output is input to the recognizer 602 as a negative sample.
  • the recognizer 602 recognizes the negative sample, obtains a recognition result of the negative sample, and inputs the recognition result of the negative sample to the comparator 604.
  • the comparator 604 compares the recognition results of the negative samples to obtain the comparison results of the negative samples, and sends the comparison results of the negative samples to the optimizer 606.
  • the optimizer decides whether to adjust the parameters of the recognizer 602 according to the comparison results of the negative samples. .
  • the target object and the face region picture are input to the recognizer 608 as positive samples.
  • the recognizer 608 recognizes the positive sample, obtains the recognition result of the positive sample, and inputs the recognition result of the positive sample to the comparator 610.
  • the comparator 610 compares the recognition results of the positive samples to obtain the comparison results of the positive samples, and sends the comparison results of the positive samples to the optimizer 606.
  • the optimizer 606 decides whether to adjust the parameters of the recognizer 608 according to the comparison results of the positive samples. .
  • the convergence judgment network model refers to the trained judgment network model It should be understood that it can be determined that the model tends to converge when the model error is less than a preset error threshold during the training process. After the convergence judgment network model is obtained, the convergence judgment network model can be used to judge the output of the generated network model.
  • the judgment network model is trained by the foregoing method until a convergence judgment network model is obtained, thereby improving the accuracy of the judgment network model obtained.
  • training and generating a network model using the convergence judgment network model includes:
  • the third sample pair consisting of the second sample face area picture and the second current sample source portrait picture, and the fourth sample pair consisting of the second sample face area picture and the second current sample target portrait picture are input to the convergence judgment network. model;
  • the face of the target object in the source portrait picture is cropped to obtain a face area picture.
  • the face region picture is input into the generated network model 702, so as to obtain the output result of the generated network model 702.
  • the output result and the face area picture are input to the recognizer 704, and are recognized by the recognizer 704.
  • the recognizer 704 recognizes the recognition result, it sends the recognition result to the comparator 708 to obtain a comparison result.
  • the face of the target object and the output result of the generated network model are input to the comparator 706, and the comparator 706 outputs another comparison result.
  • the two comparison results are input into the optimizer 710, and the optimizer 710 decides whether to adjust the parameters of the generated network model according to the two comparison results. Since the recognizer 704, the comparator 706, and the comparator 708 have already been trained, if the output result of the generated network model 702 does not meet the requirements, the optimizer 710 needs to perform parameters on the generated network model 702 according to the above two comparison results. Adjustment.
  • the adjusted generated network model is used to obtain an output result based on the face area picture, and the new output result is input to the recognizer 704, the comparator 706, and the comparator 708 for judgment. If the output result of the generated network model 702 meets the requirements, the parameters of the generated network model 702 need not be adjusted. At this time, a mature generated network model 702 is obtained.
  • the generated network model is trained by the foregoing method until a convergent generated network model is obtained, thereby improving the accuracy of obtaining the generated network model.
  • the method according to the above embodiments can be implemented by means of software plus a necessary universal hardware platform, and of course, also by hardware, but in many cases the former is Better implementation.
  • the technical solution of this application that is essentially or contributes to the existing technology can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, The optical disc) includes several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of the embodiments of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.
  • the source portrait picture is cropped to obtain a facial area picture.
  • the hair of the target object in the source portrait picture is trimmed to obtain a facial area picture that retains only facial features.
  • the facial area picture is input into a mature adversarial neural network model.
  • the adversarial neural network model includes a picture generation model and a convergence judgment network model. Input the face area picture into the picture generation model to get the output result. For example, the picture on the right in Figure 4 is the output result. In the output result, the input facial area picture with only facial features is added with hair.
  • the target hairstyle in the source portrait picture can be automatically generated by the adversarial neural network model.
  • the adversarial neural network model needs to be trained in advance. Specifically, the judgment network model in the adversarial neural network model is trained first.
  • the source portrait picture containing the hairstyle and the cropped facial area picture are used as positive samples, and the output results generated by the facial area picture and the untrained generation network model are input to the judgment network model as negative samples.
  • the judgment network model is trained. After determining that the recognition accuracy rate of the network model exceeds an empirical value, the output result of the generated network model is identified through the above-mentioned determination network model until the determination network model cannot accurately determine that the input result is the source portrait picture. Repeat the above process until you get a mature adversarial neural network model.
  • a picture generating device for implementing the above picture generating method is also provided. As shown in Figure 8, the device includes:
  • a first obtaining unit 802 configured to obtain a source portrait picture displaying a target object
  • a cropping unit 804 is configured to crop the source portrait picture to obtain a facial area picture corresponding to the face of the target object;
  • An input unit 806 is configured to input a picture of a facial area into a picture generation model and obtain an output result of the picture generation model.
  • the picture generation model is obtained by machine training using multiple sample pictures through an adversarial neural network model ;
  • a generating unit 808 is configured to generate a target portrait picture by using an output result of the picture generation model, where the target portrait picture displays a target hairstyle matching the face of the target object.
  • the foregoing input unit 806 includes:
  • An extraction module 902 is configured to extract a facial feature matching a face of a target object from a picture of a facial region through an encoding module in a picture generation model;
  • a first acquisition module 904 is configured to acquire a target hairstyle matching a facial feature of a target object through a decoding module in a picture generation model.
  • the foregoing first obtaining module 904 includes:
  • a first acquisition submodule is configured to acquire, from the candidate hairstyle set, a hairstyle with the highest degree of matching with the facial features of the target object as the target hairstyle.
  • the generating unit 808 includes:
  • Substitute submodule which is used to replace the original hairstyle of the target object in the source portrait picture with the target hairstyle to generate the target portrait picture.
  • the above device further includes:
  • a second obtaining unit configured to obtain multiple sample pictures before obtaining a source portrait picture displaying a target object
  • a training unit for training an adversarial neural network model by using multiple sample pictures wherein the adversarial neural network model includes a generation network model that matches the image generation model, and is used to perform the generation result of the generation network model.
  • Judgment Judgment Network Model Judgment Judgment Network Model.
  • the second obtaining unit includes:
  • a second obtaining module configured to obtain a valid sample picture set matching a valid field from the network, where the valid field includes an object field for indicating a hotspot object;
  • a first determining module configured to use the valid sample pictures in the valid sample picture set as a plurality of sample pictures for training an adversarial neural network model.
  • the training unit includes:
  • a second training module configured to use the convergence judgment network model to train and generate a network model until a convergence is obtained to generate a network model
  • a third training module configured to continue training and determining the network model using the convergence-generating network model if the output of the convergence-generating network model does not converge to a predetermined threshold
  • a second determination module configured to use the convergence generation network model that converges to a predetermined threshold as a picture generation model when the output result of the convergence generation network model converges to a predetermined threshold.
  • the first training module includes:
  • a second acquisition submodule configured to acquire a first current sample source portrait picture displaying the first sample object
  • a first cropping sub-module configured to crop the first current sample source portrait picture to obtain a first sample face area picture corresponding to the face of the first sample object
  • a second input sub-module configured to combine a first sample facial area picture with a first current sample source portrait picture and a first sample pair, and a first sample facial area picture and a first current sample target portrait.
  • the second sample pair composed of pictures is input to the judgment network model for training;
  • a third acquisition submodule configured to obtain a next sample source portrait picture that displays the first sample object when the output result of the network model is not converged, as the first current sample source portrait picture;
  • a fourth acquisition submodule is configured to obtain a convergence judgment network model when the output result of the judgment network model is converged.
  • the foregoing second training module includes:
  • a fifth acquisition submodule configured to acquire a second current sample source portrait picture displaying a second sample object
  • a second cropping submodule configured to crop a second current sample source portrait picture to obtain a second sample face area picture corresponding to the face of the second sample object
  • a third input sub-module configured to input a second sample facial area picture to generate a network model, and generate a second current sample target portrait picture of the second sample object;
  • a fourth input sub-module configured to combine a third sample pair consisting of the second sample face area picture and the second current sample source portrait picture, and a second sample face area picture and the second current sample target portrait picture The fourth sample pair, input the convergence judgment network model;
  • the sixth acquisition submodule is used to obtain the next sample source portrait picture that shows the second sample object when the output of the convergence judgment network model indicates that the generated network model has not converged, as the second current sample source Portrait picture
  • a seventh acquisition submodule is configured to obtain a convergence-generating network model in a case where the output of the convergence judgment network model indicates convergence of the generating network model.
  • the above facial area picture is input into the trained adversarial neural network model, and the adversarial neural network model generates and displays the target and the target image.
  • the target portrait picture of the target hairstyle matching the face of the subject no longer requires the user to artificially generate the target portrait picture based on personal aesthetic matching hairstyles multiple times, which improves the generation efficiency of the target portrait picture, making it easier for users to quickly determine the best solution and improve User experience.
  • an electronic device for implementing the above picture generating method includes a memory and a processor, and the computer program is stored in the memory.
  • the processor is configured to execute the steps in any one of the foregoing method embodiments by a computer program.
  • the foregoing electronic device may be located in at least one network device among a plurality of network devices in a computer network.
  • the foregoing processor may be configured to execute the following steps by a computer program:
  • the structure shown in FIG. 10 is only for illustration, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, and a mobile Internet device (Mobile Internet devices (MID), PAD and other terminal equipment.
  • FIG. 10 does not limit the structure of the electronic device.
  • the electronic device may further include more or fewer components (such as a network interface, a display device, etc.) than those shown in FIG. 10, or have a different configuration from that shown in FIG. 10.
  • the memory 1002 may be used to store software programs and modules, such as program instructions / modules corresponding to the picture generating method and device in the embodiments of the present application.
  • the processor 1004 executes the software programs and modules stored in the memory 1002 to execute each program.
  • a variety of functional applications and data processing, that is, the above-mentioned picture generation method is implemented.
  • the memory 1002 may include a high-speed random access memory, and may further include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memory.
  • the memory 1002 may further include a memory remotely set with respect to the processor 1004, and these remote memories may be connected to the terminal through a network.
  • the memory 1002 may specifically, but not limited to, store information such as a source portrait picture, a target portrait picture, and the like.
  • the memory 1002 may include, but is not limited to, a first obtaining unit 802, a cropping unit 804, an input unit 806, and a generating unit 808 in the picture generating device.
  • it may also include but is not limited to other module units in the above-mentioned picture generating device, which will not be repeated in this example.
  • the above-mentioned transmission device 1006 is configured to receive or send data via a network.
  • Specific examples of the foregoing network may include a wired network and a wireless network.
  • the transmission device 1006 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable so as to communicate with the Internet or a local area network.
  • the transmission device 1006 is a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.
  • RF radio frequency
  • the electronic device further includes: a display 1008 for displaying a target portrait picture; and a connection bus 1010 for connecting various module components in the electronic device.
  • a non-volatile computer-readable storage medium stores a computer program, wherein the computer program is configured to execute any one of the foregoing when run. Steps in a method embodiment.
  • the foregoing storage medium may be configured to store a computer program for performing the following steps:
  • the foregoing storage medium may be configured to store a computer program for performing the following steps:
  • the foregoing storage medium may be configured to store a computer program for performing the following steps:
  • the foregoing storage medium may be configured to store a computer program for performing the following steps:
  • the foregoing storage medium may be configured to store a computer program for performing the following steps:
  • the foregoing storage medium may be configured to store a computer program for performing the following steps:
  • the foregoing storage medium may be configured to store a computer program for performing the following steps:
  • the foregoing storage medium may be configured to store a computer program for performing the following steps:
  • the first sample pair consisting of the first sample facial area picture and the first current sample source portrait picture, and the second sample pair consisting of the first sample face area picture and the first current sample target portrait picture are input.
  • the foregoing storage medium may be configured to store a computer program for performing the following steps:
  • the third sample pair consisting of the second sample face area picture and the second current sample source portrait picture, and the fourth sample pair consisting of the second sample face area picture and the second current sample target portrait picture are input to the convergence judgment network. model;
  • the storage media may include: a flash disk, a read-only memory (ROM), a random access device (Random Access Memory, RAM), a magnetic disk, or an optical disk.
  • a computer program product which, when running on a computer, causes the computer to execute the steps in any one of the method embodiments described above.
  • the integrated unit in the foregoing embodiment When the integrated unit in the foregoing embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in the computer-readable storage medium.
  • the technical solution of the present application essentially or part that contributes to the existing technology or all or part of the technical solution may be embodied in the form of a software product, which is stored in a storage medium.
  • Several instructions are included to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to perform all or part of the steps of the method described in the embodiments of the present application.
  • the disclosed client can be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or may be combined. Integration into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, units or modules, and may be electrical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objective of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or in the form of software functional unit.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Multimedia (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Processing Or Creating Images (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

本申请公开了一种图片生成方法和装置、存储介质及电子装置。其中,该方法包括:获取显示有目标对象的源人像图片;对源人像图片进行裁剪,得到与目标对象的面部对应的面部区域图片;将面部区域图片输入图片生成模型,获取该图片生成模型的输出结果,其中,图片生成模型为通过对抗式神经网络模型利用多个样本图片进行机器训练后得到;利用图片生成模型的输出结果生成目标人像图片,其中,目标人像图片中显示有与目标对象的面部相匹配的目标发型。本申请解决了相关技术中生成的图片难以达到用户的预期效果的技术问题。

Description

图片生成方法和装置、存储介质及电子装置
本申请要求于2018年09月03日提交中国专利局、申请号为2018110196882、申请名称为“图片生成方法和装置、存储介质及电子装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机领域,具体涉及图像处理技术。
背景技术
在很多用于编辑图片的终端应用中,常常会对图片中所包含的图像元素进行相应的调整,如调整不同图像元素的组合,以合成新的图片。为了简化合成步骤,上述终端应用通常直接将不同的图像元素进行简单地组合拼接。例如,针对人像图片中的发型进行编辑时,直接将不同类型的发型粘贴到同一个对象的脸部附近,从而为该对象生成具有不同发型的图片。
然而,上述相关技术所提供的图片生成方法中,往往由用户从多种发型中选择适配图片中对象的发型,需要不断切换查看各种发型的效果最终做出决定,操作繁琐且用户很难记住曾经所选的发型,如此,用户常常多次操作无法确定最适配的发型,对于用户而言,也无法快速选择最佳方案,用户体验较差,对于系统而言需要响应多次无效操作,浪费系统资源。
发明内容
本申请实施例提供了一种图片生成方法和装置、存储介质及电子装置,以简化用户操作方便用户快速生成所需的合成发型图片,一定程度能够提高系统资源利用率。
根据本申请实施例的一个方面,提供了一种图片生成方法,应用于用户设备,包括:获取显示有目标对象的源人像图片;对上述源人像图片进行裁剪,得到与上述目标对象的面部对应的面部区域图片;将上述面部区域图片输入图片生成模型,获取该图片生成模型的输出结果,其中,上述图片生成模型为通过对抗式神经网络模型利用多个样本图片进行机器训练后得到;利用上述图片生成模型的输出结果,生成目标人像图片,其中,上述目标人像图片中显示有与上述目标对象的面部相匹配的目标发型。
根据本申请实施例的另一方面,还提供了一种图片生成装置,包括:第一获取单元,用于获取显示有目标对象的源人像图片;裁剪单元,用于对上述源人像图片进行裁剪,得到与上述目标对象的面部对应的面部区域图片;输入单元,用于将上述面部区域图片输入图片生成模型,获取该图片生成模型的输出结果,其中,上述图片生成模型为通过对抗式神经网络模型利用多个样本图片进行机器训练后得到;生成单元,用于利用上述图片生成模型的输出结果,生成目标人像图片,其中,上述目标人像图片中显示有与上述目 标对象的面部相匹配的目标发型。
作为一种可选的示例,上述第一获取模块包括:确定子模块,用于根据上述目标对象的上述面部特征确定候选发型集合;第一获取子模块,用于从上述候选发型集合中,获取与上述目标对象的上述面部特征之间匹配度最高的发型作为上述目标发型。
作为一种可选的示例,上述生成模块包括:代替子模块,用于将上述目标发型代替上述源人像图片中上述目标对象的原发型,以生成上述目标人像图片。
作为一种可选的示例,上述第二获取单元包括:第二获取模块,用于从网络获取与有效字段匹配的有效样本图片集合,其中,上述有效字段包括用于指示热点对象的对象字段;第一确定模块,用于将上述有效样本图片集合中的有效样本图片,作为用于训练上述对抗式神经网络模型的上述多个样本图片。
作为一种可选的示例,上述训练单元包括:重复执行以下步骤,直至上述对抗式神经网络模型中的上述生成网络模型的输出结果收敛至预定阈值:第一训练模块,用于训练上述对抗式神经网络模型中的上述判断网络模型,直至得到收敛判断网络模型;第二训练模块,用于使用上述收敛判断网络模型训练上述生成网络模型,直至得到收敛生成网络模型;第三训练模块,用于在上述收敛生成网络模型的输出结果未收敛至上述预定阈值的情况下,使用上述收敛生成网络模型继续训练上述判断网络模型;第二确定模块,用于在上述收敛生成网络模型的输出结果收敛至上述预定阈值的情况下,将收敛至上述预定阈值的上述收敛生成网络模型作为上述图片生成模型。
作为一种可选的示例,上述第一训练模块包括:重复执行以下步骤,直至得到上述收敛判断网络模型:第二获取子模块,用于获取显示有第一样本对象的第一当前样本源人像图片;第一裁剪子模块,用于对上述第一当前样本源人像图片进行裁剪,得到与上述第一样本对象的面部对应的第一样本面部区域图片;第一输入子模块,用于将上述第一样本面部区域图片输入上述生成网络模型,生成上述第一样本对象的第一当前样本目标人像图片;第二输入子模块,用于将上述第一样本面部区域图片与上述第一当前样本源人像图片构成的第一样本对,及上述第一样本面部区域图片与上述第一当前样本目标人像图片构成的第二样本对,输入上述判断网络模型进行训练;第三获取子模块,用于在上述判断网络模型的输出结果未收敛的情况下,获取下一个显示有上述第一样本对象的样本源人像图片,作为上述第一当前样本源人像图片;第四获取子模块,用于在上述判断网络模型的输出结果收敛的情况下,得到上述收敛判断网络模型。
作为一种可选的示例,上述第二训练模块包括:重复执行以下步骤,直至得到上述收敛生成网络模型:第五获取子模块,用于获取显示有第二样本 对象的第二当前样本源人像图片;第二裁剪子模块,用于对上述第二当前样本源人像图片进行裁剪,得到与上述第二样本对象的面部对应的第二样本面部区域图片;第三输入子模块,用于将上述第二样本面部区域图片输入上述生成网络模型,生成上述第二样本对象的第二当前样本目标人像图片;第四输入子模块,用于将上述第二样本面部区域图片与上述第二当前样本源人像图片构成的第三样本对,及上述第二样本面部区域图片与上述第二当前样本目标人像图片构成的第四样本对,输入上述收敛判断网络模型;第六获取子模块,用于在上述收敛判断网络模型的输出结果指示上述生成网络模型未收敛的情况下,获取下一个显示有上述第二样本对象的样本源人像图片,作为上述第二当前样本源人像图片;第七获取子模块,用于在上述收敛判断网络模型的输出结果指示上述生成网络模型收敛的情况下,得到上述收敛生成网络模型。
根据本申请实施例的又一方面,还提供了一种非易失性计算机可读存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述图片生成方法。
根据本申请实施例的又一方面,还提供了一种电子装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,上述处理器通过计算机程序执行上述的图片生成方法。
在本申请实施例提供的图片生成方法中,获取显示有目标对象的源人像图片;对上述源人像图片进行裁剪,得到与上述目标对象的面部对应的面部区域图片;将上述面部区域图片输入图片生成模型,获取该图片生成模型的输出结果,其中,上述图片生成模型为通过对抗式神经网络模型利用多个样本图片进行机器训练后得到;利用上述图片生成模型的输出结果,生成目标人像图片,其中,上述目标人像图片中显示有与上述目标对象的面部相匹配的目标发型。在上述方法中,在获取到对源人像图片进行裁剪得到的面部区域图片后,将该面部区域图片输入到训练好的对抗式神经网络模型中,由对抗式神经网络模型生成显示有与目标对象的面部相匹配的目标发型的目标人像图片,不再需要用户人为根据个人审美多次匹配发型生成目标人像图片,提高了生成目标人像图片的生成效率,便于用户快速地确定最佳方案,提高了用户体验。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1是根据本申请实施例的一种可选的图片生成方法的应用环境的示意图;
图2是根据本申请实施例的一种可选的图片生成方法的流程示意图;
图3是根据本申请实施例的一种可选的图片生成方法的示意图;
图4是根据本申请实施例的又一种可选的图片生成方法的示意图;
图5是根据本申请实施例的又一种可选的图片生成方法的示意图;
图6是根据本申请实施例的又一种可选的图片生成方法的示意图;
图7是根据本申请实施例的又一种可选的图片生成方法的示意图;
图8是根据本申请实施例的一种可选的图片生成装置的结构示意图;
图9是根据本申请实施例的另一种可选的图片生成装置的结构示意图;
图10是根据本申请实施例的一种可选的电子装置的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
根据本申请实施例的一个方面,提供了一种图片生成方法作为一种可选的实施方式,上述图片生成方法可以但不限于应用于如图1所示的环境中。
用户102可以与用户设备104之间进行人机交互。用户设备104包括有存储器106与处理器108。用户设备104获取显示有目标对象的源人像图片,并对源人像图片进行裁剪,得到与目标对象的面部对应的面部区域图片。通过步骤S102,用户设备104将获取到的面部区域图片通过网络110发送给服务器112。服务器112中包含有索引数据库114以及图片生成模型116,图片生成模型116中包含判断网络模型118与生成网络模型120。在图片生成模型116获取到上述面部区域图片后,基于该面部区域图片生成目标人像图片,并通过步骤S104,通过网络110将目标人像图片发送给用户设备104。
需要说明的是,相关技术中往往是由用户根据自身的审美为图片中的对象人工选择所要替换的发型,无法保证所生成的图片中的对象与替换后的发型相匹配。而本实施例中,在获取到对源人像图片进行裁剪得到的面部区域图片后,将上述面部区域图片输入到训练好的对抗式神经网络模型中,由对抗式神经网络模型生成显示有与目标对象的面部相匹配的目标发型的目标人 像图片,不再需要用户人为根据个人审美多次匹配发型生成目标人像图片,提高了生成目标人像图片的生成效率,便于用户快速地确定最佳方案,提高了用户体验。可选地,上述图片生成方法可以但不限于应用于可以计算数据的终端上,例如手机、平板电脑、笔记本电脑、PC机等终端上,上述网络可以包括但不限于无线网络或有线网络。其中,该无线网络包括:无线保真(Wireless Fidelity,WIFI)及其他实现无线通信的网络。上述有线网络可以包括但不限于:广域网、城域网、局域网。上述服务器可以包括但不限于任何可以进行计算的硬件设备。
可选地,作为一种可选的实施方式,如图2所示,上述图片生成方法包括:
S202,获取显示有目标对象的源人像图片;
S204,对源人像图片进行裁剪,得到与目标对象的面部对应的面部区域图片;
S206,将面部区域图片输入图片生成模型,获取所述图片生成模型的输出结果,其中,图片生成模型为通过对抗式神经网络模型利用多个样本图片进行机器训练后得到;
S208,利用图片生成模型的输出结果,生成目标人像图片,其中,目标人像图片中显示有与目标对象的面部相匹配的目标发型。
可选地,上述图片生成方法可以但不限于应用于婚纱照修图领域,或者应用于移动终端相机上,或者应用于证件照美化领域。
可选地,上述面部区域图片可以但不限于为将源人像图片中目标对象的头发裁剪掉后所剩余的面部的图片。
以下结合图3进行说明。如图3所示,302为一张可选的源人像图片,源人像图片中包含有目标对象304、目标对象306和目标对象308三个目标对象。提取出目标对象304的面部310、目标对象306的面部312、目标对象308的面部314。对每一个目标对象的面部进行裁剪,生成每一个目标对象的面部对应的面部区域图片。从而得到面部区域图片316、面部区域图片318和面部区域图片320。继续结合图4进行说明。在对目标对象的面部312进行裁剪,得到面部区域图片318之后,将面部区域图片318输入到图片生成模型中,得到更改了发型的面部402。
需要说明的是,本实施例中,由于在获取到对源人像图片进行裁剪得到的面部区域图片后,将该面部区域图片输入到训练好的对抗式神经网络模型中,由对抗式神经网络模型生成显示有与目标对象的面部相匹配的目标发型的目标人像图片,从而不再需要用户人为根据个人审美多次匹配发型生成目标人像图片,提高了生成目标人像图片的生成效率,便于用户快速地确定最佳方案,提高了用户体验。
可选地,上述对源人像图片进行裁剪,得到面部区域图片包括:
(1)在源人像图片中包含有一个目标对象的情况下,对源人像图片进行裁剪,得到面部区域图片。
(2)在源人像图片中包含有多个目标对象的情况下,对源人像图片进行裁剪,得到每一个目标对象的面部对应的面部区域图片。
可选地,在一张源人像图片中包含有多个目标对象的情况下,可以先将多个目标对象裁剪分割,得到多张人像图片,每一张人像图片中包含一个目标对象,再对每一张人像图片执行裁剪步骤,得到每一个目标对象对应的面部区域图片。
如图3所示,图3中的源人像图片中包含有3个目标对象。在对源人像图片进行裁剪时,先将源人像图片裁剪为3张人像图片,每一张人像图片中包含有一个目标对象,再对每一张人像图片进行裁剪,得到多张面部区域图片。
或者在人像图片中包含有多个目标对象的情况下,一次性对所有的目标对象进行裁剪,得到多张面部区域图片。
例如,在源人像图片中包含有3个目标对象的情况下,一次性对每一个目标对象的面部进行裁剪,得到3个面部区域图片,3个面部区域图片分别与3个目标对象的面部对应。
可选地,在获取到面部区域图片,将上述面部区域图片输入到图片生成模型中之后,获取图片生成模型的输出结果,包括:通过图片生成模型中的编码模块,从面部区域图片中提取出与目标对象的面部相匹配的面部特征;通过图片生成模型中的解码模块,获取与目标对象的面部特征相匹配的目标发型。相应地,利用图片生成模型的输出结果生成目标人像图片,包括:将目标发型代替源人像图片中目标对象的原发型,以生成目标人像图片。
可选地,上述编码模块可以但不限于通过识别面部区域图片中每一个像素的颜色,提取出目标对象的面部相匹配的面部特征。
可选地,上述解码模块可以但不限于生成多个发型,并从多个发型中选择其中一个作为目标发型。
可选地,上述通过解码模块获取与目标对象的面部特征相匹配的目标发型,包括:根据目标对象的面部特征确定候选发型集合;从候选发型集合中,获取与目标对象的面部特征之间匹配度最高的发型作为目标发型。
可选地,图片生成模型在得到输出结果时,每一个输出结果携带一个概率,上述概率大于等于零,小于等于1。上述概率可以用分数表示,可以用小数表示。概率越大,则表示输出结果的显示效果越逼真。在图片生成模型得到输出结果时,可以将上述输出结果中的概率作为匹配度。
可选地,在获取到上述候选发型集合后,可以但不限于按照与目标对象的面部特征之间的匹配度,对候选发型集合中的发型进行排序。匹配度越高,发型排序越靠前。
可选地,在获取显示有目标对象的源人像图片之前,还包括:获取多个样本图片;利用多个样本图片训练对抗式神经网络模型,其中,对抗式神经网络模型包括:与图片生成模型相匹配的生成网络模型、用于对生成网络模型的生成结果进行判定的判断网络模型。
可选地,上述样本图片可以但不限于为从直接下载公开的图片中获取到,或者采用爬虫手段获取得到。
可选地,上述样本图片可以但不限于从通过输入有效字段搜索到的有效样本图片集合中获取。可选地,上述有效字段可以但不限于为任何描述性词汇,例如,帅哥、美女、长发、短发等等,在接收到有效字段为短发后,搜索到有效样本图片集合,有效样本图片集合中包含有与短发对应的有效样本图片。进而,将获取到的有效样本图片集合中的有效样本图片作为样本图片,用作训练对抗式神经网络模型。
可选地,对抗式神经网络模型中包括生成网络模型与判断网络模型。
可选地,对对抗式神经网络模型进行训练可以但不限于采用如下步骤:
S1,训练对抗式神经网络模型中的判断网络模型,直至得到收敛判断网络模型;
S2,使用收敛判断网络模型训练生成网络模型,直至得到收敛生成网络模型;
S3,在收敛生成网络模型的输出结果未收敛至预定阈值的情况下,使用收敛生成网络模型继续训练判断网络模型;
S4,在收敛生成网络模型的输出结果收敛至预定阈值的情况下,将收敛至预定阈值的收敛生成网络模型作为图片生成模型。
S5,重复S1-S4,直到对抗式神经网络模型中的收敛生成网络模型的输出结果收敛至预定阈值。
可选地,上述预定阈值可以但不限于为预先设定的值。预定阈值大于等于零且小于等于1。例如预定阈值为0.5,上述输出结果收敛至预定阈值可以但不限于为输出结果大于等于0.5。在生成网络模型获取到输出结果后,使用收敛判断网络模型对获取到的输出结果进行判断,若判断出输出结果小于0.5,则继续对收敛判断网络模型与收敛生成网络模型进行训练。若判断出上述输出结果大于等于0.5,则将收敛生成网络模型确定为图片生成模型,并使用图片生成模型对面部区域图片进行处理,得到目标人像图片。
可选地,可以但不限于通过以下步骤训练判断网络模型:重复执行以下步骤,直至得到收敛判断网络模型:获取显示有第一样本对象的第一当前样本源人像图片;对第一当前样本源人像图片进行裁剪,得到与第一样本对象的面部对应的第一样本面部区域图片;将第一样本面部区域图片输入生成网络模型,生成第一样本对象的第一当前样本目标人像图片;将第一样本面部区域图片与第一当前样本源人像图片构成的第一样本对,及第一样本面部区 域图片与第一当前样本目标人像图片构成的第二样本对,输入判断网络模型进行训练;在判断网络模型的输出结果未收敛的情况下,获取下一个显示有第一样本对象的样本源人像图片,作为第一当前样本源人像图片;在判断网络模型的输出结果收敛的情况下,得到收敛判断网络模型。
可选地,当上述判断网络模型收敛时,使用上述收敛判断网络模型训练生成网络模型可以但不限于使用如下步骤:重复执行以下步骤,直至得到收敛生成网络模型:获取显示有第二样本对象的第二当前样本源人像图片;对第二当前样本源人像图片进行裁剪,得到与第二样本对象的面部对应的第二样本面部区域图片;将第二样本面部区域图片输入生成网络模型,生成第二样本对象的第二当前样本目标人像图片;将第二样本面部区域图片与第二当前样本源人像图片构成的第三样本对,及第二样本面部区域图片与第二当前样本目标人像图片构成的第四样本对,输入收敛判断网络模型;在收敛判断网络模型的输出结果指示生成网络模型未收敛的情况下,获取下一个显示有第二样本对象的样本源人像图片,作为第二当前样本源人像图片;在收敛判断网络模型的输出结果指示生成网络模型收敛的情况下,得到收敛生成网络模型。
通过本实施例,获取到对源人像图片进行裁剪得到的面部区域图片后,将该面部区域图片输入到训练好的对抗式神经网络模型中,由对抗式神经网络模型生成显示有与目标对象的面部相匹配的目标发型的目标人像图片,从而不再需要用户人为根据个人审美多次匹配发型生成目标人像图片,提高了生成目标人像图片的生成效率,便于用户快速地确定最佳方案,提高了用户体验。
作为一种可选的实施方案,将面部区域图片输入图片生成模型,获取该图片生成模型的输出结果,包括:
S1,通过图片生成模型中的编码模块,从面部区域图片中提取出与目标对象的面部相匹配的面部特征;
S2,通过图片生成模型中的解码模块,获取与目标对象的面部特征相匹配的目标发型。
可选地,上述编码模块可以但不限于通过识别面部区域图片中每一个像素的颜色,提取出与目标对象的面部相匹配的面部特征。
可选地,上述解码模块可以但不限于生成多个发型,并从多个发型中选择其中一个作为目标发型,替换目标对象的原发型,从而生成目标人像图片。
例如,识别面部区域图片中每一个像素的颜色,从而提取出目标对象的面部特征,并在生成多个发型后,选取与面部特征匹配度最高的发型作为目标发型,根据面部特征与目标发型生成目标人像图片。
通过本实施例,通过图片生成模型中的编码模块提取面部特征,并通过图片生成模型中的解码模块获取目标发型,进一步根据目标发型生成目标人 像图片,在一定程度上保证所生成的目标人像图片符合用户的预期效果。
作为一种可选的实施方案,通过图片生成模型中的解码模块,获取与目标对象的面部特征相匹配的目标发型包括:
S1,根据目标对象的面部特征确定候选发型集合;
S2,从候选发型集合中,获取与目标对象的面部特征之间匹配度最高的发型作为目标发型。
例如,以候选发型集合中包含有5个发型为例,如图5所示,每一个发型与面部特征之间存在一个匹配度。按照匹配度对发型进行排序,匹配度最高的发型即确定为目标发型。从而可以确定出发型1为目标发型。将发型1替换目标对象的原发型,生成目标人像图片。
通过本实施例,通过获取匹配度最高的发型作为目标发型,从而提高了目标发型选择的准确度,便于用户快速地确定最佳方案,提高了用户体验。作为一种可选的实施方案,利用图片生成模型的输出结果,生成目标人像图片包括:
S1,将目标发型代替源人像图片中目标对象的原发型,以生成目标人像图片。
例如,在获取到目标发型后,裁剪掉目标对象的原发型,并使用目标发型替换掉原发型,得到目标人像图片,或者直接将目标发型覆盖到原发型之上,得到目标人像图片。
通过本实施例,通过将目标发型替换掉源人像图片中的目标对象的原发型,从而可以为目标对象选择合适的目标发型,便于用户快速地确定最佳方案,提高了用户体验。
作为一种可选的实施方案,在获取显示有目标对象的源人像图片之前,还包括:
S1,获取多个样本图片;
S2,利用多个样本图片训练对抗式神经网络模型,其中,对抗式神经网络模型包括:与图片生成模型相匹配的生成网络模型、用于对生成网络模型的生成结果进行判定的判断网络模型。
可选地,上述样本图片可以但不限于为通过直接下载公开的图片获取到,或者采用爬虫手段获取得到。例如,从网上已经公开的图片集中下载多个样本图片;进而,使用多个样本图片训练对抗式神经网络模型。
通过本实施例,通过利用所获取的公开的图片训练对抗式神经网络模型,从而可以使用大量的数据训练对抗式神经网络模型,提高了对抗式神经网络模型的精准度。
作为一种可选的实施方案,获取多个样本图片包括:
S1,从网络获取与有效字段匹配的有效样本图片集合,其中,有效字段 包括用于指示热点对象的对象字段;
S2,将有效样本图片集合中的有效样本图片,作为用于训练对抗式神经网络模型的多个样本图片。
可选地,上述有效字段可以但不限于为任何描述性词汇,例如,帅哥、美女、长发、短发,传统,经典,时尚,性感,潮流,等等,在接收到有效字段为短发后,搜索有效样本图片集合,该有效样本图片集合中包含有与短发对应的有效样本图片。将获取到的有效样本图片集合中的有效样本图片用作训练对抗式神经网络模型。
通过本实施例,根据有效字段选择有效样本图片作为训练对抗式神经网络模型的图片,从而可以有选择的对对抗式神经网络模型进行训练,提高了对神经网络模型的训练效率。
作为一种可选的实施方案,利用多个样本图片训练对抗式神经网络模型包括:
重复执行以下步骤,直至对抗式神经网络模型中的生成网络模型的输出结果收敛至预定阈值:
S1,训练对抗式神经网络模型中的判断网络模型,直至得到收敛判断网络模型;
S2,使用收敛判断网络模型训练生成网络模型,直至得到收敛生成网络模型;
S3,在收敛生成网络模型的输出结果未收敛至预定阈值的情况下,使用收敛生成网络模型继续训练判断网络模型;
S4,在收敛生成网络模型的输出结果收敛至预定阈值的情况下,将收敛至预定阈值的收敛生成网络模型作为图片生成模型。
可选地,上述预定阈值可以但不限于为预先设定的值。预定阈值大于等于零且小于等于1。例如预定阈值为0.5,上述输出结果收敛至预定阈值可以但不限于为输出结果大于等于0.5。在生成网络模型获取到输出结果后,使用收敛判断网络模型对获取到的输出结果进行判断,若判断出输出结果小于0.5,则继续对收敛判断网络模型与收敛生成网络模型进行训练。若判断出上述输出结果大于等于0.5,则将收敛生成网络模型确定为图片生成模型,并使用图片生成模型对面部区域图片进行处理,得到目标人像图片。
通过本实施例,通过上述步骤对判断网络模型以及生成网络模型进行训练,从而得到收敛判断网络模型与收敛生成网络模型,并将收敛生成网络模型作为图片生成模型,从而便于用户快速地确定最佳方案,提高了用户体验。
作为一种可选的实施方案,训练对抗式神经网络模型中的判断网络模型包括:
重复执行以下步骤,直至得到收敛判断网络模型:
S1,获取显示有第一样本对象的第一当前样本源人像图片;
S2,对第一当前样本源人像图片进行裁剪,得到与第一样本对象的面部对应的第一样本面部区域图片;
S3,将第一样本面部区域图片输入生成网络模型,生成第一样本对象的第一当前样本目标人像图片;
S4,将第一样本面部区域图片与第一当前样本源人像图片构成的第一样本对,及第一样本面部区域图片与第一当前样本目标人像图片构成的第二样本对,输入判断网络模型进行训练;
S5,在判断网络模型的输出结果未收敛的情况下,获取下一个显示有第一样本对象的样本源人像图片,作为第一当前样本源人像图片;
S6,在判断网络模型的输出结果收敛的情况下,得到收敛判断网络模型。
例如,如图6所示,图6为对判断网络模型进行训练的过程示意图。在获取到第一当前样本源人像图片后,对源人像图片中目标对象的面部进行裁剪,得到面部区域图片,将面部区域图片输入到生成网络模型中,得到输出结果,将面部区域图片与上述输出结果作为负样本输入到识别器602中。识别器602对上述负样本进行识别,得到负样本的识别结果,将负样本的识别结果输入到比较器604中。比较器604对负样本的识别结果进行比较,得到负样本的比较结果,并将负样本的比较结果发送给优化器606,优化器根据负样本的比较结果决定是否对识别器602的参数进行调整。
此外,对目标对象进行裁剪得到面部区域图片后,将目标对象与面部区域图片作为正样本输入到识别器608中。识别器608对正样本进行识别,得到正样本的识别结果,并将正样本的识别结果输入到比较器610中。比较器610对正样本的识别结果进行比较,得到正样本的比较结果,将正样本的比较结果发送给优化器606,优化器606根据正样本的比较结果决定是否对识别器608的参数进行调整。
经过上述正样本与负样本的训练后,识别器602与识别器608的参数愈加成熟,从而可以形成收敛判断网络模型,此处的收敛判断网络模型是指训练得到的趋于收敛的判断网络模型,应理解,在训练过程中模型误差小于预设误差阈值时即可确定模型趋于收敛。在得到收敛判断网络模型之后,可以使用收敛判断网络模型对生成网络模型的输出结果进行判断。
通过本实施例,通过上述方法对判断网络模型进行训练,直到获取到收敛的判断网络模型,从而提高了获取的判断网络模型的准确度。
作为一种可选的实施方案,使用收敛判断网络模型训练生成网络模型包括:
重复执行以下步骤,直至得到收敛生成网络模型:
S1,获取显示有第二样本对象的第二当前样本源人像图片;
S2,对第二当前样本源人像图片进行裁剪,得到与第二样本对象的面部 对应的第二样本面部区域图片;
S3,将第二样本面部区域图片输入生成网络模型,生成第二样本对象的第二当前样本目标人像图片;
S4,将第二样本面部区域图片与第二当前样本源人像图片构成的第三样本对,及第二样本面部区域图片与第二当前样本目标人像图片构成的第四样本对,输入收敛判断网络模型;
S5,在收敛判断网络模型的输出结果指示生成网络模型未收敛的情况下,获取下一个显示有第二样本对象的样本源人像图片,作为第二当前样本源人像图片;
S6,在收敛判断网络模型的输出结果指示生成网络模型收敛的情况下,得到收敛生成网络模型。
例如,如图7所示,在获取到源人像图片后,对源人像图片中目标对象的面部进行裁剪,得到面部区域图片。将面部区域图片输入到生成网络模型702中,从而得到生成网络模型702的输出结果。将上述输出结果与面部区域图片输入到识别器704中,由识别器704进行识别。识别器704识别得到识别结果后,将识别结果发送给比较器708,得到一个比较结果。此外,将目标对象的面部和生成网络模型的输出结果输入到比较器706中,由比较器706输出另一个比较结果。将上述两个比较结果输入到优化器710中,优化器710根据两个比较结果决定是否对生成网络模型的参数进行调整。由于识别器704与比较器706、比较器708已经经过了训练,因此,若是生成网络模型702的输出结果不符合要求,则优化器710需要根据上述两个比较结果对生成网络模型702的参数进行调整。
在对生成网络模型调整之后,使用调整后的生成网络模型根据面部区域图片得到输出结果,并将新的输出结果输入到识别器704、比较器706、比较器708中进行判断。而若是生成网络模型702的输出结果符合要求,则不需要对生成网络模型702的参数进行调整。此时,得到成熟的生成网络模型702。
通过本实施例,通过上述方法对生成网络模型进行训练,直到获取到收敛的生成网络模型,从而提高了获取生成网络模型的准确度。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的 形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例的方法。
以下结合具体示例对上述图片生成方法进行说明。以源人像图片中包含有一个目标对象为例,在获取到上述源人像图片之后,对上述源人像图片进行裁剪,得到面部区域图片。例如,如图4所示,将源人像图片中的目标对象的头发裁剪掉,得到仅保留面部特征的面部区域图片。在获取到上述面部区域图片后,将上述面部区域图片输入到成熟的对抗式神经网络模型中。对抗式神经网络模型中包含有图片生成模型和收敛判断网络模型。将面部区域图片输入到图片生成模型中得到输出结果。例如图4中的右侧的图片为输出结果。输出结果中将输入的仅保留面部特征的面部区域图片添加上了头发。
经过上述过程,可以通过对抗式神经网络模型自动为源人像图片中的目标对象生成目标发型。而为了得到上述成熟的对抗式神经网络模型,需要预先对对抗式神经网络模型进行训练。具体先训练对抗式神经网络模型中的判断网络模型。将包含有发型的源人像图片与裁剪后的面部区域图片作为正样本,将面部区域图片与还未训练过的生成网络模型所生成的输出结果作为负样本输入到判断网络模型中。从而对判断网络模型进行训练。在判断网络模型的识别准确率超过一个经验值之后,通过上述判断网络模型对生成网络模型的输出结果进行识别,直到判断网络模型无法准确判断出输入的结果为源人像图片。重复上述过程,直到得到成熟的对抗式神经网络模型。
根据本申请实施例的另一个方面,还提供了一种用于实施上述图片生成方法的图片生成装置。如图8所示,该装置包括:
(1)第一获取单元802,用于获取显示有目标对象的源人像图片;
(2)裁剪单元804,用于对源人像图片进行裁剪,得到与目标对象的面部对应的面部区域图片;
(3)输入单元806,用于将面部区域图片输入图片生成模型,获取所述图片生成模型的输出结果,其中,图片生成模型为通过对抗式神经网络模型利用多个样本图片进行机器训练后得到;
(4)生成单元808,用于利用图片生成模型的输出结果,生成目标人像图片,其中,目标人像图片中显示有与目标对象的面部相匹配的目标发型。
作为一种可选的实施方案,如图9所示,上述输入单元806包括:
(1)提取模块902,用于通过图片生成模型中的编码模块,从面部区域图片中提取出与目标对象的面部相匹配的面部特征;
(2)第一获取模块904,用于通过图片生成模型中的解码模块,获取与目标对象的面部特征相匹配的目标发型。
作为一种可选的实施方案,上述第一获取模块904包括:
(1)确定子模块,用于根据目标对象的面部特征确定候选发型集合;
(2)第一获取子模块,用于从候选发型集合中,获取与目标对象的面部特征之间匹配度最高的发型作为目标发型。
作为一种可选的实施方案,上述生成单元808包括:
(1)代替子模块,用于将目标发型代替源人像图片中目标对象的原发型,以生成目标人像图片。
作为一种可选的实施方案,上述装置还包括:
(1)第二获取单元,用于在获取显示有目标对象的源人像图片之前,获取多个样本图片;
(2)训练单元,用于利用多个样本图片训练对抗式神经网络模型,其中,对抗式神经网络模型包括:与图片生成模型相匹配的生成网络模型、用于对生成网络模型的生成结果进行判定的判断网络模型。
作为一种可选的实施方案,上述第二获取单元包括:
(1)第二获取模块,用于从网络获取与有效字段匹配的有效样本图片集合,其中,有效字段包括用于指示热点对象的对象字段;
(2)第一确定模块,用于将有效样本图片集合中的有效样本图片,作为用于训练对抗式神经网络模型的多个样本图片。
作为一种可选的实施方案,上述训练单元包括:
重复执行以下模块执行的步骤,直至对抗式神经网络模型中的生成网络模型的输出结果收敛至预定阈值:
(1)第一训练模块,用于训练对抗式神经网络模型中的判断网络模型,直至得到收敛判断网络模型;
(2)第二训练模块,用于使用收敛判断网络模型训练生成网络模型,直至得到收敛生成网络模型;
(3)第三训练模块,用于在收敛生成网络模型的输出结果未收敛至预定阈值的情况下,使用收敛生成网络模型继续训练判断网络模型;
(4)第二确定模块,用于在收敛生成网络模型的输出结果收敛至预定阈值的情况下,将收敛至预定阈值的收敛生成网络模型作为图片生成模型。
作为一种可选的实施方案,上述第一训练模块包括:
重复执行以下子模块执行的步骤,直至得到收敛判断网络模型:
(1)第二获取子模块,用于获取显示有第一样本对象的第一当前样本源人像图片;
(2)第一裁剪子模块,用于对第一当前样本源人像图片进行裁剪,得到与第一样本对象的面部对应的第一样本面部区域图片;
(3)第一输入子模块,用于将第一样本面部区域图片输入生成网络模型,生成第一样本对象的第一当前样本目标人像图片;
(4)第二输入子模块,用于将第一样本面部区域图片与第一当前样本源人像图片构成的第一样本对,及第一样本面部区域图片与第一当前样本目标 人像图片构成的第二样本对,输入判断网络模型进行训练;
(5)第三获取子模块,用于在判断网络模型的输出结果未收敛的情况下,获取下一个显示有第一样本对象的样本源人像图片,作为第一当前样本源人像图片;
(6)第四获取子模块,用于在判断网络模型的输出结果收敛的情况下,得到收敛判断网络模型。
作为一种可选的实施方案,上述第二训练模块包括:
重复执行以下子模块执行的步骤,直至得到收敛生成网络模型:
(1)第五获取子模块,用于获取显示有第二样本对象的第二当前样本源人像图片;
(2)第二裁剪子模块,用于对第二当前样本源人像图片进行裁剪,得到与第二样本对象的面部对应的第二样本面部区域图片;
(3)第三输入子模块,用于将第二样本面部区域图片输入生成网络模型,生成第二样本对象的第二当前样本目标人像图片;
(4)第四输入子模块,用于将第二样本面部区域图片与第二当前样本源人像图片构成的第三样本对,及第二样本面部区域图片与第二当前样本目标人像图片构成的第四样本对,输入收敛判断网络模型;
(5)第六获取子模块,用于在收敛判断网络模型的输出结果指示生成网络模型未收敛的情况下,获取下一个显示有第二样本对象的样本源人像图片,作为第二当前样本源人像图片;
(6)第七获取子模块,用于在收敛判断网络模型的输出结果指示生成网络模型收敛的情况下,得到收敛生成网络模型。而本实施例中,在获取到对源人像图片进行裁剪得到的面部区域图片后,将上述面部区域图片输入到训练好的对抗式神经网络模型中,由对抗式神经网络模型生成显示有与目标对象的面部相匹配的目标发型的目标人像图片,不再需要用户人为根据个人审美多次匹配发型生成目标人像图片,提高了生成目标人像图片的生成效率,便于用户快速地确定最佳方案,提高了用户体验。
根据本申请实施例的又一个方面,还提供了一种用于实施上述图片生成方法的电子装置,如图10所示,该电子装置包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为通过计算机程序执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述电子装置可以位于计算机网络的多个网络设备中的至少一个网络设备。
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:
S1,获取显示有目标对象的源人像图片;
S2,对源人像图片进行裁剪,得到与目标对象的面部对应的面部区域图片;
S3,将面部区域图片输入图片生成模型,获取所述图片生成模型的输出结果其中,图片生成模型为通过对抗式神经网络模型利用多个样本图片进行机器训练后得到;
S4,利用图片生成模型的输出结果,生成目标人像图片,其中,目标人像图片中显示有与目标对象的面部相匹配的目标发型。
可选地,本领域普通技术人员可以理解,图10所示的结构仅为示意,电子装置也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图10其并不对上述电子装置的结构造成限定。例如,电子装置还可包括比图10中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图10所示不同的配置。
其中,存储器1002可用于存储软件程序以及模块,如本申请实施例中的图片生成方法和装置对应的程序指令/模块,处理器1004通过运行存储在存储器1002内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的图片生成方法。存储器1002可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器1002可进一步包括相对于处理器1004远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。其中,存储器1002具体可以但不限于用于存储源人像图片、目标人像图片等信息。作为一种示例,如图10所示,上述存储器1002中可以但不限于包括上述图片生成装置中的第一获取单元802、裁剪单元804、输入单元806及生成单元808。此外,还可以包括但不限于上述图片生成装置中的其他模块单元,本示例中不再赘述。
可选地,上述的传输装置1006用于经由一个网络接收或者发送数据。上述的网络具体实例可包括有线网络及无线网络。在一个实例中,传输装置1006包括一个网络适配器(Network Interface Controller,NIC),其可通过网线与其他网络设备与路由器相连从而可与互联网或局域网进行通讯。在一个实例中,传输装置1006为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
此外,上述电子装置还包括:显示器1008,用于显示目标人像图片;和连接总线1010,用于连接上述电子装置中的各个模块部件。
根据本申请的实施例的又一方面,还提供了一种非易失性计算机可读存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运 行时执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,获取显示有目标对象的源人像图片;
S2,对源人像图片进行裁剪,得到与目标对象的面部对应的面部区域图片;
S3,将面部区域图片输入图片生成模型,获取所述图片生成模型的输出结果其中,图片生成模型为通过对抗式神经网络模型利用多个样本图片进行机器训练后得到;
S4,利用图片生成模型的输出结果,生成目标人像图片,其中,目标人像图片中显示有与目标对象的面部相匹配的目标发型。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,通过图片生成模型中的编码模块,从面部区域图片中提取出与目标对象的面部相匹配的面部特征;
S2,通过图片生成模型中的解码模块,获取与目标对象的面部特征相匹配的目标发型。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,根据目标对象的面部特征确定候选发型集合;
S2,从候选发型集合中,获取与目标对象的面部特征之间匹配度最高的发型作为目标发型。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,将目标发型代替源人像图片中目标对象的原发型,以生成目标人像图片。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,获取多个样本图片;
S2,利用多个样本图片训练对抗式神经网络模型,其中,对抗式神经网络模型包括:与图片生成模型相匹配的生成网络模型、用于对生成网络模型的生成结果进行判定的判断网络模型。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,从网络获取与有效字段匹配的有效样本图片集合,其中,有效字段包括用于指示热点对象的对象字段;
S2,将有效样本图片集合中的有效样本图片,作为用于训练对抗式神经 网络模型的多个样本图片。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,训练对抗式神经网络模型中的判断网络模型,直至得到收敛判断网络模型;
S2,使用收敛判断网络模型训练生成网络模型,直至得到收敛生成网络模型;
S3,在收敛生成网络模型的输出结果未收敛至预定阈值的情况下,使用收敛生成网络模型继续训练判断网络模型;
S4,在收敛生成网络模型的输出结果收敛至预定阈值的情况下,将收敛至预定阈值的收敛生成网络模型作为图片生成模型。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,获取显示有第一样本对象的第一当前样本源人像图片;
S2,对第一当前样本源人像图片进行裁剪,得到与第一样本对象的面部对应的第一样本面部区域图片;
S3,将第一样本面部区域图片输入生成网络模型,生成第一样本对象的第一当前样本目标人像图片;
S4,将第一样本面部区域图片与第一当前样本源人像图片构成的第一样本对,及第一样本面部区域图片与第一当前样本目标人像图片构成的第二样本对,输入判断网络模型进行训练;
S5,在判断网络模型的输出结果未收敛的情况下,获取下一个显示有第一样本对象的样本源人像图片,作为第一当前样本源人像图片;
S6,在判断网络模型的输出结果收敛的情况下,得到收敛判断网络模型。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,获取显示有第二样本对象的第二当前样本源人像图片;
S2,对第二当前样本源人像图片进行裁剪,得到与第二样本对象的面部对应的第二样本面部区域图片;
S3,将第二样本面部区域图片输入生成网络模型,生成第二样本对象的第二当前样本目标人像图片;
S4,将第二样本面部区域图片与第二当前样本源人像图片构成的第三样本对,及第二样本面部区域图片与第二当前样本目标人像图片构成的第四样本对,输入收敛判断网络模型;
S5,在收敛判断网络模型的输出结果指示生成网络模型未收敛的情况下,获取下一个显示有第二样本对象的样本源人像图片,作为第二当前样本源人像图片;
S6,在收敛判断网络模型的输出结果指示生成网络模型收敛的情况下,得到收敛生成网络模型。
可选地,在本实施例中,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
根据本申请的实施例的又一方面,还提供了一种计算机程序产品,当其在计算机上运行时,使得计算机执行上述任一项方法实施例中的步骤。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
上述实施例中的集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在上述计算机可读取的存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在存储介质中,包括若干指令用以使得一台或多台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的客户端,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。

Claims (14)

  1. 一种图片生成方法,应用于用户设备,包括:
    获取显示有目标对象的源人像图片;
    对所述源人像图片进行裁剪,得到与所述目标对象的面部对应的面部区域图片;
    将所述面部区域图片输入图片生成模型,获取所述图片生成模型的输出结果,其中,所述图片生成模型为通过对抗式神经网络模型利用多个样本图片进行机器训练后得到;
    利用所述图片生成模型的输出结果,生成目标人像图片,其中,所述目标人像图片中显示有与所述目标对象的面部相匹配的目标发型。
  2. 根据权利要求1所述的方法,其中所述将所述面部区域图片输入图片生成模型,获取所述图片生成模型的输出结果包括:
    通过所述图片生成模型中的编码模块,从所述面部区域图片中提取出与所述目标对象的面部相匹配的面部特征;
    通过所述图片生成模型中的解码模块,获取与所述目标对象的所述面部特征相匹配的所述目标发型。
  3. 根据权利要求2所述的方法,其中所述通过所述图片生成模型中的解码模块,获取与所述目标对象的所述面部特征相匹配的所述目标发型包括:
    根据所述目标对象的所述面部特征确定候选发型集合;
    从所述候选发型集合中,获取与所述目标对象的所述面部特征之间匹配度最高的发型作为所述目标发型。
  4. 根据权利要求2所述的方法,其中所述利用所述图片生成模型的输出结果,生成目标人像图片包括:
    将所述目标发型代替所述源人像图片中所述目标对象的原发型,以生成所述目标人像图片。
  5. 根据权利要求1所述的方法,其中在所述获取显示有目标对象的源人像图片之前,还包括:
    获取所述多个样本图片;
    利用所述多个样本图片训练所述对抗式神经网络模型,其中,所述对抗式神经网络模型包括:与所述图片生成模型相匹配的生成网络模型、用于对所述生成网络模型的生成结果进行判定的判断网络模型。
  6. 根据权利要求5所述的方法,其中所述获取所述多个样本图片包括:
    从网络获取与有效字段匹配的有效样本图片集合,其中,所述有效字段包括用于指示热点对象的对象字段;
    将所述有效样本图片集合中的有效样本图片,作为用于训练所述对抗式神经网络模型的所述多个样本图片。
  7. 根据权利要求5所述的方法,其中所述利用所述多个样本图片训练所 述对抗式神经网络模型包括:
    重复执行以下步骤,直至所述对抗式神经网络模型中的所述生成网络模型的输出结果收敛至预定阈值:
    训练所述对抗式神经网络模型中的所述判断网络模型,直至得到收敛判断网络模型;
    使用所述收敛判断网络模型训练所述生成网络模型,直至得到收敛生成网络模型;
    在所述收敛生成网络模型的输出结果未收敛至所述预定阈值的情况下,使用所述收敛生成网络模型继续训练所述判断网络模型;
    在所述收敛生成网络模型的输出结果收敛至所述预定阈值的情况下,将收敛至所述预定阈值的所述收敛生成网络模型作为所述图片生成模型。
  8. 根据权利要求7所述的方法,其中所述训练所述对抗式神经网络模型中的所述判断网络模型包括:
    重复执行以下步骤,直至得到所述收敛判断网络模型:
    获取显示有第一样本对象的第一当前样本源人像图片;
    对所述第一当前样本源人像图片进行裁剪,得到与所述第一样本对象的面部对应的第一样本面部区域图片;
    将所述第一样本面部区域图片输入所述生成网络模型,生成所述第一样本对象的第一当前样本目标人像图片;
    将所述第一样本面部区域图片与所述第一当前样本源人像图片构成的第一样本对,及所述第一样本面部区域图片与所述第一当前样本目标人像图片构成的第二样本对,输入所述判断网络模型进行训练;
    在所述判断网络模型的输出结果未收敛的情况下,获取下一个显示有所述第一样本对象的样本源人像图片,作为所述第一当前样本源人像图片;
    在所述判断网络模型的输出结果收敛的情况下,得到所述收敛判断网络模型。
  9. 根据权利要求8所述的方法,其中所述使用所述收敛判断网络模型训练所述生成网络模型包括:
    重复执行以下步骤,直至得到所述收敛生成网络模型:
    获取显示有第二样本对象的第二当前样本源人像图片;
    对所述第二当前样本源人像图片进行裁剪,得到与所述第二样本对象的面部对应的第二样本面部区域图片;
    将所述第二样本面部区域图片输入所述生成网络模型,生成所述第二样本对象的第二当前样本目标人像图片;
    将所述第二样本面部区域图片与所述第二当前样本源人像图片构成的第三样本对,及所述第二样本面部区域图片与所述第二当前样本目标人像图片构成的第四样本对,输入所述收敛判断网络模型;
    在所述收敛判断网络模型的输出结果指示所述生成网络模型未收敛的情况下,获取下一个显示有所述第二样本对象的样本源人像图片,作为所述第二当前样本源人像图片;
    在所述收敛判断网络模型的输出结果指示所述生成网络模型收敛的情况下,得到所述收敛生成网络模型。
  10. 一种图片生成装置,包括:
    第一获取单元,用于获取显示有目标对象的源人像图片;
    裁剪单元,用于对所述源人像图片进行裁剪,得到与所述目标对象的面部对应的面部区域图片;
    输入单元,用于将所述面部区域图片输入图片生成模型,获取所述图片生成模型的输出结果,其中,所述图片生成模型为通过对抗式神经网络模型利用多个样本图片进行机器训练后得到;
    生成单元,用于利用所述图片生成模型的输出结果,生成目标人像图片,其中,所述目标人像图片中显示有与所述目标对象的面部相匹配的目标发型。
  11. 根据权利要求10所述的装置,其中所述输入单元包括:
    提取模块,用于通过所述图片生成模型中的编码模块,从所述面部区域图片中提取出与所述目标对象的面部相匹配的面部特征;
    第一获取模块,用于通过所述图片生成模型中的解码模块,获取与所述目标对象的所述面部特征相匹配的所述目标发型。
  12. 根据权利要求10所述的装置,其中所述装置还包括:
    第二获取单元,用于在所述获取显示有目标对象的源人像图片之前,获取所述多个样本图片;
    训练单元,用于利用所述多个样本图片训练所述对抗式神经网络模型,其中,所述对抗式神经网络模型包括:与所述图片生成模型相匹配的生成网络模型、用于对所述生成网络模型的生成结果进行判定的判断网络模型。
  13. 一种非易失性计算机可读存储介质,所述存储介质包括存储的计算机程序,其中,所述计算机程序运行时执行上述权利要求1至9任一项中所述的方法。
  14. 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行所述权利要求1至9任一项中所述的方法。
PCT/CN2019/103510 2018-09-03 2019-08-30 图片生成方法和装置、存储介质及电子装置 WO2020048388A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/081,551 US11538208B2 (en) 2018-09-03 2020-10-27 Picture generation method and device, storage medium, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811019688.2A CN109447895B (zh) 2018-09-03 2018-09-03 图片生成方法和装置、存储介质及电子装置
CN201811019688.2 2018-09-03

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/081,551 Continuation US11538208B2 (en) 2018-09-03 2020-10-27 Picture generation method and device, storage medium, and electronic device

Publications (1)

Publication Number Publication Date
WO2020048388A1 true WO2020048388A1 (zh) 2020-03-12

Family

ID=65533201

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103510 WO2020048388A1 (zh) 2018-09-03 2019-08-30 图片生成方法和装置、存储介质及电子装置

Country Status (3)

Country Link
US (1) US11538208B2 (zh)
CN (1) CN109447895B (zh)
WO (1) WO2020048388A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190267A (zh) * 2021-05-27 2021-07-30 上海幻电信息科技有限公司 界面布局的动态配置方法与系统
CN113536006A (zh) * 2021-06-25 2021-10-22 北京百度网讯科技有限公司 生成图片的方法、装置、设备、存储介质和计算机产品

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109447895B (zh) 2018-09-03 2021-06-08 腾讯科技(武汉)有限公司 图片生成方法和装置、存储介质及电子装置
JP7353032B2 (ja) * 2018-11-15 2023-09-29 株式会社Preferred Networks データ生成装置、データ生成方法及びプログラム
CN110111246B (zh) 2019-05-15 2022-02-25 北京市商汤科技开发有限公司 一种虚拟头像生成方法及装置、存储介质
CN110473135B (zh) * 2019-07-31 2022-12-27 哈尔滨工业大学(深圳) 图像处理方法、系统、可读存储介质及智能设备
CN110619600B (zh) * 2019-09-17 2023-12-08 南京旷云科技有限公司 神经网络模型训练方法及装置、存储介质及电子设备
CN111062918B (zh) * 2019-12-10 2023-11-21 歌尔股份有限公司 一种基于计算机视觉的异常检测方法及装置
CN111444366B (zh) * 2020-04-10 2024-02-20 Oppo广东移动通信有限公司 图像分类方法、装置、存储介质及电子设备
CN111597946B (zh) * 2020-05-11 2022-04-08 腾讯医疗健康(深圳)有限公司 图像生成器的处理方法、图像生成方法及装置
CN112489169B (zh) * 2020-12-17 2024-02-13 脸萌有限公司 人像图像处理方法及装置
CN113256513B (zh) * 2021-05-10 2022-07-01 杭州格像科技有限公司 一种基于对抗神经网络的人像美化方法和系统
CN114187633B (zh) * 2021-12-07 2023-06-16 北京百度网讯科技有限公司 图像处理方法及装置、图像生成模型的训练方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170344860A1 (en) * 2016-01-25 2017-11-30 Adobe Systems Incorporated Utilizing deep learning for automatic digital image segmentation and stylization
CN107527318A (zh) * 2017-07-17 2017-12-29 复旦大学 一种基于生成对抗式网络模型的发型更换方法
CN107862334A (zh) * 2017-11-06 2018-03-30 广东欧珀移动通信有限公司 眼镜的推荐方法、装置、存储介质及终端设备
CN108389077A (zh) * 2018-02-11 2018-08-10 广东欧珀移动通信有限公司 电子装置、信息推荐方法及相关产品
CN109447895A (zh) * 2018-09-03 2019-03-08 腾讯科技(武汉)有限公司 图片生成方法和装置、存储介质及电子装置

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130129210A1 (en) * 2010-11-02 2013-05-23 Sk Planet Co., Ltd. Recommendation system based on the recognition of a face and style, and method thereof
GB201102794D0 (en) * 2011-02-17 2011-03-30 Metail Ltd Online retail system
US8675112B2 (en) * 2011-06-24 2014-03-18 Intellectual Ventures Fund 83 Llc Imaging device providing capture location guidance
KR101664940B1 (ko) * 2016-05-12 2016-10-12 (주)엘리비젼 가상현실을 이용한 헤어 스마트 미러 시스템
US10552977B1 (en) * 2017-04-18 2020-02-04 Twitter, Inc. Fast face-morphing using neural networks
EP3669318A1 (de) * 2017-08-16 2020-06-24 Henkel AG & Co. KGaA Verfahren und vorrichtung zur computergestützten haarbehandlungsberatung
US11010944B2 (en) * 2017-12-28 2021-05-18 Facebook, Inc. Systems and methods for swapping faces and face components based on facial recognition
KR102661019B1 (ko) * 2018-02-23 2024-04-26 삼성전자주식회사 얼굴에 대응하는 3차원 아바타를 이용하여 얼굴의 움직임이 반영된 3차원 아바타를 포함하는 이미지를 생성하는 전자 장치 및 그 동작 방법
CN108446697B (zh) * 2018-03-06 2019-11-12 平安科技(深圳)有限公司 图片处理方法、电子装置及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170344860A1 (en) * 2016-01-25 2017-11-30 Adobe Systems Incorporated Utilizing deep learning for automatic digital image segmentation and stylization
CN107527318A (zh) * 2017-07-17 2017-12-29 复旦大学 一种基于生成对抗式网络模型的发型更换方法
CN107862334A (zh) * 2017-11-06 2018-03-30 广东欧珀移动通信有限公司 眼镜的推荐方法、装置、存储介质及终端设备
CN108389077A (zh) * 2018-02-11 2018-08-10 广东欧珀移动通信有限公司 电子装置、信息推荐方法及相关产品
CN109447895A (zh) * 2018-09-03 2019-03-08 腾讯科技(武汉)有限公司 图片生成方法和装置、存储介质及电子装置

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190267A (zh) * 2021-05-27 2021-07-30 上海幻电信息科技有限公司 界面布局的动态配置方法与系统
CN113190267B (zh) * 2021-05-27 2024-03-26 上海幻电信息科技有限公司 界面布局的动态配置方法与系统
CN113536006A (zh) * 2021-06-25 2021-10-22 北京百度网讯科技有限公司 生成图片的方法、装置、设备、存储介质和计算机产品
CN113536006B (zh) * 2021-06-25 2023-06-13 北京百度网讯科技有限公司 生成图片的方法、装置、设备、存储介质和计算机产品

Also Published As

Publication number Publication date
US11538208B2 (en) 2022-12-27
CN109447895A (zh) 2019-03-08
CN109447895B (zh) 2021-06-08
US20210074046A1 (en) 2021-03-11

Similar Documents

Publication Publication Date Title
WO2020048388A1 (zh) 图片生成方法和装置、存储介质及电子装置
US10979624B2 (en) Methods and devices for establishing photographing template database and providing photographing recommendation information
CN110110118B (zh) 妆容推荐方法、装置、存储介质及移动终端
US9741137B2 (en) Image-based color palette generation
US9552656B2 (en) Image-based color palette generation
US9396560B2 (en) Image-based color palette generation
US9311889B1 (en) Image-based color palette generation
WO2019228167A1 (zh) 一种辅助化妆方法、装置及智能镜
KR20210144625A (ko) 영상 데이터 처리 방법, 장치 및 판독 가능 저장 매체
CN108198177A (zh) 图像获取方法、装置、终端及存储介质
US9536285B2 (en) Image processing method, client, and image processing system
KR102455966B1 (ko) 중개 장치, 방법 및 컴퓨터 판독 가능한 기록매체
CN111476708A (zh) 模型生成方法、模型获取方法、装置、设备及存储介质
US11881023B2 (en) Method and system for generating video
CN106161939A (zh) 一种照片拍摄方法及终端
US11380037B2 (en) Method and apparatus for generating virtual operating object, storage medium, and electronic device
CN106815803B (zh) 图片的处理方法及装置
CN110755847A (zh) 虚拟操作对象的生成方法和装置、存储介质及电子装置
WO2023143126A1 (zh) 图像处理方法、装置、电子设备及存储介质
CN105824863A (zh) 一种桌面主题推荐方法及终端
WO2016082470A1 (zh) 一种图片处理方法、装置及计算机存储介质
CN114170472A (zh) 图像处理方法、可读存储介质及计算机终端
CN116823869A (zh) 背景替换的方法和电子设备
CN109842757B (zh) 图像处理方法及装置
CN109712216B (zh) 图表渲染方法、装置、可读存储介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19857104

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19857104

Country of ref document: EP

Kind code of ref document: A1