Sample Image Generation Method, Apparatus, Electronic Device, and Storage Medium

By acquiring and adjusting the morphological properties of the reference image and the image to be processed, and generating sample images, the problem of insufficient expansion of sample images is solved, and effective expansion of sample images and personalized attribute representation is realized.

CN114511754BActive Publication Date: 2025-07-11BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210002021.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-04
Publication Date
2025-07-11
Estimated Expiration
2042-01-04

AI Technical Summary

Technical Problem

The prior art cannot effectively expand sample images and cannot meet the number of sample images in deep learning tasks.

Method used

By acquiring the reference image and the image to be processed, the reference morphological properties of the reference morphology subject are determined, and the morphological properties in the image to be processed are adjusted according to the attribute to generate a sample image.

Benefits of technology

The effective expansion of sample images is achieved, and the attributes of the reference morphology subject can be fully characterized and the personalized morphology attribute processing needs in actual image processing scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114511754B_ABST
    Figure CN114511754B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, apparatus, electronic device, and storage medium for generating a sample image, belonging to the technical field of image processing. The method includes: obtaining a reference image and an image to be processed, where the reference image includes a reference morphological entity, and the image to be processed includes a morphological entity to be processed, and determining the reference morphological attributes of the reference morphological entity, and then adjusting the morphological attributes corresponding to the morphological entity to be processed in the image to be processed according to the reference morphological attributes, so as to obtain a sample image corresponding to the image to be processed, realizing the migration of the reference morphological attributes of the reference morphological entity in the reference image to the image to be processed, so that the generated sample image can fully represent the reference morphological attributes of the reference morphological entity, realizing the expansion to obtain a sample image including the reference morphological attributes, and being able to effectively assist in the expansion of the sample image, so that the sample image can effectively meet the personalized morphological attribute processing requirements in the actual image processing scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technologies, and in particular, to a method, apparatus, electronic device, and storage medium for generating sample images. Background Art

[0002] In deep learning tasks, model training usually requires a large number of sample images to improve the robustness and training effect of the model. However, for some specific fields, the number of sample images is insufficient to meet the requirements of the number of sample images for deep learning tasks. Therefore, there is an urgent need to propose a method for generating sample images to meet the requirements of the number of sample images in actual image processing scenarios.

[0003] The sample image generation methods in the related art cannot effectively expand the sample images. Summary of the Invention

[0004] The present disclosure provides a method, apparatus, electronic device, storage medium, and computer program product for generating sample images.

[0005] The technical solution of the present disclosure is as follows:

[0006] According to a first aspect of an embodiment of the present disclosure, a method for generating sample images is provided, including: obtaining a reference image and an image to be processed, where the reference image includes a reference morphological main body, and the image to be processed includes a to-be-processed morphological main body, and the reference morphological main body and the to-be-processed morphological main body are different; determining a reference morphological attribute of the reference morphological main body; and adjusting a morphological attribute corresponding to the to-be-processed morphological main body in the image to be processed according to the reference morphological attribute to obtain a sample image corresponding to the image to be processed.

[0007] In some embodiments of the present disclosure, determining the reference morphological attribute of the reference morphological main body includes:

[0008] determining a type of morphological attribute of the reference image;

[0009] determining a reference morphological attribute value corresponding to the type of morphological attribute according to the reference morphological main body;

[0010] using the type of morphological attribute and the reference morphological attribute value together as the reference morphological attribute.

[0011] In some embodiments of the present disclosure, the number of reference images is a first number, and the number of images to be processed is a second number, and the first number is greater than the second number;

[0012] wherein, determining the reference morphological attribute value corresponding to the type of morphological attribute according to the reference morphological main body includes:

[0013] extracting a reference latent variable corresponding to the reference morphological main body in the reference image;

[0014] Extract the latent variable to be processed corresponding to the main body of the form to be processed from the image to be processed;

[0015] Sample the first quantity of reference latent variables and the second quantity of latent variables to be processed to obtain a plurality of sampled latent variables, where the sampled latent variable is a reference latent variable or a latent variable to be processed;

[0016] Determine the reference form attribute value according to the plurality of sampled latent variables.

[0017] In some embodiments of the present disclosure, determining the reference form attribute value according to the plurality of sampled latent variables includes:

[0018] Determine the sampled image paired with the sampled latent variable, where the sampled image is a reference image or an image to be processed;

[0019] Determine the virtual form attribute value of the corresponding paired sampled image according to the sampled latent variable;

[0020] Perform a sorting process on the plurality of virtual form attribute values;

[0021] Select a set number ratio of the virtual form attribute values from the sorted plurality of virtual form attribute values as the reference form attribute value.

[0022] In some embodiments of the present disclosure, selecting a set number ratio of the virtual form attribute values from the sorted plurality of virtual form attribute values as the reference form attribute value includes:

[0023] Select the first set number ratio of virtual form attribute values ranked at the front from the sorted plurality of virtual form attribute values as the reference form attribute value; and / or

[0024] Select the second set number ratio of virtual form attribute values ranked at the back from the sorted plurality of virtual form attribute values as the reference form attribute value.

[0025] In some embodiments of the present disclosure, adjusting the form attribute corresponding to the main body of the form to be processed in the image to be processed according to the reference form attribute to obtain a sample image corresponding to the image to be processed includes:

[0026] Determine a plurality of sampled latent variables respectively corresponding to the plurality of reference form attributes;

[0027] Use each sampled latent variable to perform an editing process on the latent variable to be processed to obtain the corresponding edited latent variable;

[0028] Adjust the form attribute corresponding to the main body of the form to be processed in the image to be processed according to the edited latent variable to obtain a sample image corresponding to the image to be processed.

[0029] In some embodiments of the present disclosure, each sampled latent variable is used to edit the latent variable to be processed, and the corresponding edited latent variable is obtained, including:

[0030] The latent variable to be processed is input into a binary classification model, and the corresponding edited latent variable output by the binary classification model is obtained. The binary classification model is trained by a plurality of sampled latent variables.

[0031] In some embodiments of the present disclosure, the morphological attribute type includes any one or a combination of the following:

[0032] Age attribute, gender attribute, pose attribute.

[0033] According to the second aspect of the embodiments of the present disclosure, a sample image generation device is provided, including:

[0034] An acquisition module configured to acquire a reference image and an image to be processed, where the reference image includes a reference morphological entity, and the image to be processed includes a morphological entity to be processed, and the reference morphological entity and the morphological entity to be processed are different;

[0035] A determination module configured to determine the reference morphological attribute of the reference morphological entity;

[0036] An adjustment module configured to adjust the morphological attribute corresponding to the morphological entity to be processed in the image to be processed according to the reference morphological attribute to obtain a sample image corresponding to the image to be processed.

[0037] In some embodiments of the present disclosure, the determination module includes:

[0038] A first determination sub-module configured to determine the morphological attribute type of the reference image;

[0039] A second determination sub-module configured to determine the reference morphological attribute value corresponding to the morphological attribute type according to the reference morphological entity;

[0040] A first processing sub-module configured to use the morphological attribute type and the reference morphological attribute value together as the reference morphological attribute.

[0041] In some embodiments of the present disclosure, the number of reference images is a first number, and the number of images to be processed is a second number, and the first number is greater than the second number;

[0042] Wherein, the second determination sub-module is configured to:

[0043] Extract the reference latent variable corresponding to the reference morphological entity in the reference image;

[0044] Extract the latent variable to be processed corresponding to the main body of the morphology to be processed from the image to be processed;

[0045] Sample the first quantity of reference latent variables and the second quantity of latent variables to be processed to obtain a plurality of sampled latent variables, where the sampled latent variable is a reference latent variable or a latent variable to be processed;

[0046] Determine the reference morphology attribute value according to the plurality of sampled latent variables.

[0047] In some embodiments of the present disclosure, the second determination sub-module is configured to execute:

[0048] Determine the sampled image paired with the sampled latent variable, where the sampled image is a reference image or an image to be processed;

[0049] Determine the virtual morphology attribute value of the corresponding paired sampled image according to the sampled latent variable;

[0050] Perform a sorting process on the plurality of virtual morphology attribute values;

[0051] Select a set number ratio of the virtual morphology attribute values from the sorted plurality of virtual morphology attribute values as the reference morphology attribute value.

[0052] In some embodiments of the present disclosure, the second determination sub-module is configured to execute:

[0053] Select the first set number ratio of the virtual morphology attribute values sorted in the front from the sorted plurality of virtual morphology attribute values as the reference morphology attribute value; and / or

[0054] Select the second set number ratio of the virtual morphology attribute values sorted in the back from the sorted plurality of virtual morphology attribute values as the reference morphology attribute value.

[0055] In some embodiments of the present disclosure, the adjustment module includes:

[0056] The third determination sub-module is configured to execute determining a plurality of sampled latent variables corresponding to the plurality of reference morphology attributes respectively;

[0057] The second processing sub-module is configured to execute editing the latent variable to be processed with each sampled latent variable to obtain a corresponding edited latent variable;

[0058] The adjustment sub-module is configured to execute adjusting the morphology attribute corresponding to the main body of the morphology to be processed in the image to be processed according to the edited latent variable to obtain a sample image corresponding to the image to be processed.

[0059] In some embodiments of the present disclosure, the second processing sub-module is configured to execute:

[0060] Input the latent variable to be processed into a binary classification model to obtain the corresponding edited latent variable output by the binary classification model, where the binary classification model is trained by multiple sampled latent variables.

[0061] In some embodiments of the present disclosure, the morphological attribute type includes any one or a combination of the following:

[0062] Age attribute, gender attribute, pose attribute.

[0063] According to the third aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein, the processor is configured to execute the instructions to implement the sample image generation method as described above.

[0064] According to the fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by the processor of the electronic device, enabling the electronic device to execute the sample image generation method as described above.

[0065] According to the fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, including a computer program, which when executed by a processor implements the sample image generation method as described above.

[0066] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:

[0067] In this embodiment, by obtaining a reference image and an image to be processed, where the reference image includes a reference morphological body, and the image to be processed includes a morphological body to be processed, the reference morphological body and the morphological body to be processed are different, and determining the reference morphological attribute of the reference morphological body, and then adjusting the morphological attribute corresponding to the morphological body to be processed in the image to be processed according to the reference morphological attribute to obtain a sample image corresponding to the image to be processed, realizing the migration of the reference morphological attribute of the reference morphological body in the reference image to the image to be processed, so that the generated sample image can fully represent the reference morphological attribute of the reference morphological body, realizing the expansion to obtain a sample image including the reference morphological attribute, which can effectively assist in the expansion of the sample image, so that the sample image can effectively meet the personalized morphological attribute processing requirements in the actual image processing scenario.

[0068] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] The accompanying drawings here are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.

[0070] Figure 1 is a flowchart of a method for generating a sample image shown according to an exemplary embodiment;

[0071] Figure 2 is a flowchart of a method for generating a sample image shown according to another exemplary embodiment;

[0072] Figure 3 is a flowchart of a method for generating a sample image shown according to another exemplary embodiment;

[0073] Figure 4 is a flowchart of a method for generating a sample image shown according to another exemplary embodiment;

[0074] Figure 5 is a schematic diagram of the distribution of the face deflection angles of a reference image and an image to be processed shown according to an exemplary embodiment;

[0075] Figure 6 is a schematic diagram of the distribution of the face deflection angles in sample image data shown according to an exemplary embodiment;

[0076] Figure 7 is a schematic diagram of the error of the average horizontal angle of paired image data of adults and children shown according to an exemplary embodiment;

[0077] Figure 8 is a block diagram of a sample image generation device shown according to an exemplary embodiment;

[0078] Figure 9 is a block diagram of a sample image generation device shown according to another exemplary embodiment;

[0079] Figure 10 is a block diagram of an electronic device shown according to an exemplary embodiment. Detailed implementation manners

[0080] To enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0081] It should be noted that the terms "first", "second", etc. in the description, claims and the above-mentioned drawings of the present disclosure are used to distinguish similar user accounts, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0082] Figure 1 It is a flowchart of a sample image generation method shown according to an exemplary embodiment.

[0083] In this embodiment, the sample image generation method is configured as an example in a sample image generation device.

[0084] In this embodiment, the sample image generation method can be configured in a sample image generation device, and the sample image generation device can be set in an electronic device.

[0085] It should be noted that the execution subject of the embodiments of the present disclosure can be, for example, the central processing unit (CPU) of an electronic device in terms of hardware, and can be, for example, the relevant background service of the electronic device in terms of software, and this is not limited.

[0086] As Figure 1 shown, the sample image generation method includes the following steps:

[0087] In step S101, a reference image and an image to be processed are obtained, where the reference image includes: a reference form main body, and the image to be processed includes: a form main body to be processed, and the reference form main body and the form main body to be processed are different.

[0088] Among them, the image currently to be processed, that is, can be referred to as the image to be processed. The number of the images to be processed can be one or more. The image to be processed can be obtained by a device with a shooting function such as a mobile phone or a camera, or the image to be processed can also be parsed from a video. For example, the image to be processed can be a partial video frame image extracted from multiple video frames included in the video, and this is not limited.

[0089] Among them, during the execution of the sample image generation method, an image that serves as a reference for the image to be processed can be called a reference image. The number of such reference images can be one or more. The reference image can be an image having associated information with the image to be processed. Specifically, for example, it can be an image having semantic association information with the image to be processed, or an image having attribute association information with the image to be processed. There is no limitation in this regard.

[0090] Among them, the reference image and the image to be processed can be used to describe the corresponding morphological entity. The morphological entity can be specifically, for example, a human face, a human head, etc. There is no limitation in this regard.

[0091] The reference image can include: a reference morphological entity, that is, the reference image can be used to describe the reference morphological entity. Correspondingly, obtaining the reference image can be to use a camera device to capture the reference morphological entity to obtain the corresponding reference image. There is no limitation in this regard.

[0092] The image to be processed can include: a morphological entity to be processed, that is, the image to be processed can be used to describe the morphological entity to be processed. Correspondingly, obtaining the image to be processed can be to use a camera device to capture the morphological entity to be processed to obtain the corresponding image to be processed. There is no limitation in this regard.

[0093] It should be noted that the above-mentioned reference morphological entity and the morphological entity to be processed are different.

[0094] Then, in the embodiments of the present disclosure, it is supported to process the morphological entity to be processed in the image to be processed according to the reference morphological entity, so as to obtain a sample image by processing the image to be processed. For details, please refer to the subsequent embodiments.

[0095] It should be noted that the reference image and the image to be processed in the embodiments of the present disclosure are not images obtained for a specific user, and they do not reflect the personal information of a specific user. Moreover, both the reference image and the image to be processed are obtained after the authorization of the relevant user, and their acquisition processes comply with the relevant laws and regulations and do not violate public order and good customs.

[0096] In step S102, determine the reference morphological attribute of the reference morphological entity.

[0097] Among them, the reference morphological entity can have corresponding morphological attributes, which can be called reference morphological attributes. The reference morphological attributes can be the pose attributes of the reference morphological entity, the age attributes of the reference morphological entity, etc. Specifically, for example, they can be child attributes, old person attributes, etc. There is no limitation in this regard.

[0098] In some embodiments, to determine the reference morphological attributes of the reference morphological entity, it can be by determining the accessory features, pose features, and facial features of the reference morphological entity in the reference image, and then determining the reference morphological attributes of the reference morphological entity according to the accessory features, pose features, and facial features of the reference morphological entity in the reference image.

[0099] For example, face image recognition can be performed on the reference morphological entity (e.g., a face morphological entity) in the reference image, and it can be determined whether there are wrinkles on the face. If it is recognized that there are wrinkles on the face, the reference morphological attributes of the reference morphological entity can be determined as the attributes of an elderly person, and there is no limitation thereto.

[0100] In some other embodiments, to determine the reference morphological attributes of the reference morphological entity, it can also be to pre-extract multiple image features for the corresponding reference image of the reference morphological entity, and then perform feature analysis on the multiple extracted image features, so as to determine the reference morphological attributes of the reference morphological entity according to the feature analysis results. Or, any other possible method can also be used to determine the reference morphological attributes of the reference morphological entity, and there is no limitation thereto.

[0101] In step S103, according to the reference morphological attributes, the morphological attributes corresponding to the to-be-processed morphological entity in the to-be-processed image are adjusted to obtain a sample image corresponding to the to-be-processed image.

[0102] After determining the reference morphological attributes of the reference morphological entity in the embodiments of the present disclosure, the morphological attributes corresponding to the to-be-processed morphological entity in the to-be-processed image can be adjusted according to the reference morphological attributes to obtain an image corresponding to the to-be-processed image after adjustment processing, and this image can be referred to as a sample image.

[0103] Among them, the to-be-processed morphological entity in the to-be-processed image can have corresponding morphological attributes, and these morphological attributes can specifically be, for example, the pose attributes of the to-be-processed morphological entity, the age attributes of the to-be-processed morphological entity, etc., and can specifically be, for example, the attributes of a child, the attributes of an elderly person, etc., and there is no limitation thereto.

[0104] Among them, the morphological attributes corresponding to the to-be-processed morphological entity are different from the reference morphological attributes corresponding to the reference morphological entity.

[0105] That is to say, an application scenario of the embodiments of the present disclosure can specifically be, for example, to process the morphological attributes corresponding to the to-be-processed morphological entity in the to-be-processed image according to the reference morphological attributes corresponding to the reference morphological entity in the reference image to obtain a sample image. The following description and explanation of the embodiments of the present disclosure will be exemplified by the foregoing application scenario. Of course, the sample image generation method described in the embodiments of the present disclosure can also be applied to any other possible sample image generation scenarios, and there is no limitation thereto.

[0106] In some embodiments, according to the reference morphological attributes, the morphological attributes corresponding to the morphological object to be processed in the image to be processed are adjusted to obtain a sample image corresponding to the image to be processed. It may be that after determining the reference morphological attributes of the reference morphological object, according to the reference morphological attributes, the local image features of the reference morphological object are determined, and then, according to the local image features, the local image features of the morphological object to be processed in the image to be processed are subjected to feature editing processing to obtain a sample image corresponding to the image to be processed. Or, any other possible method may also be used to implement the adjustment of the morphological attributes corresponding to the morphological object to be processed in the image to be processed according to the reference morphological attributes to obtain a sample image corresponding to the image to be processed. For example, the method of model prediction, the method of image fusion, the engineering method, etc. are not limited thereto.

[0107] In this embodiment, by obtaining a reference image and an image to be processed, wherein the reference image includes a reference morphological object, and the image to be processed includes a morphological object to be processed, the reference morphological object and the morphological object to be processed are different, and the reference morphological attributes of the reference morphological object are determined, and then, according to the reference morphological attributes, the morphological attributes corresponding to the morphological object to be processed in the image to be processed are adjusted to obtain a sample image corresponding to the image to be processed, so as to realize the migration of the reference morphological attributes of the reference morphological object in the reference image to the image to be processed, so that the generated sample image can fully represent the reference morphological attributes of the reference morphological object, and realize the expansion to obtain a sample image containing the reference morphological attributes, which can effectively assist in the expansion of the sample image, so that the sample image can effectively meet the personalized morphological attribute processing requirements in the actual image processing scenario.

[0108] Figure 2 It is a flowchart of a method for generating a sample image shown according to another exemplary embodiment.

[0109] As Figure 2 shown, the method for generating a sample image includes the following steps.

[0110] In step S201, a reference image and an image to be processed are obtained, wherein the reference image includes a reference morphological object, and the image to be processed includes a morphological object to be processed, and the reference morphological object and the morphological object to be processed are different.

[0111] The description of step S201 can be referred to the above embodiment and will not be repeated here.

[0112] In step S202, the type of morphological attributes of the reference image is determined.

[0113] Among them, the morphological attribute type can be used to describe the attribute type to which the morphological attribute of the morphological subject to be processed in the reference image belongs. The morphological attribute type can specifically be an age attribute, a gender attribute, a posture attribute, a body shape attribute, a personality attribute, etc., without limitation thereto.

[0114] In some embodiments, determining the morphological attribute type of the reference image may be to determine the morphological attribute of the morphological subject to be processed in the reference image, and then the determined morphological attribute may be classified to determine the morphological attribute type of the reference image.

[0115] For example, after determining the morphological attribute of the morphological subject to be processed in the reference image, the determined morphological attribute may be input into a pre-trained classification model (for example, a Support Vector Machines (SVM) model, without limitation thereto), and the pre-trained classification model classifies the morphological attribute and outputs the corresponding morphological attribute type, without limitation thereto.

[0116] In other embodiments, determining the morphological attribute type of the reference image may also be to determine multiple morphological attributes corresponding to different morphological attribute types respectively, and then determine the reference morphological attribute of the morphological subject to be processed in the reference image, and then compare the reference morphological attribute of the reference image with the multiple morphological attributes corresponding to the different morphological attribute types respectively, and when the reference morphological attribute matches a certain morphological attribute corresponding to a different morphological attribute type, the morphological attribute type corresponding to this morphological attribute is used as the morphological attribute type of the reference image.

[0117] Alternatively, any other possible method may also be adopted to determine the morphological attribute type of the reference image, without limitation thereto.

[0118] In step S203, according to the reference morphological subject, a reference morphological attribute value corresponding to the morphological attribute type is determined.

[0119] Among them, the value used to quantitatively describe the reference morphological attribute of the reference morphological subject can be referred to as the reference morphological attribute value. The reference morphological attribute value can specifically be, for example, an age value corresponding to the age attribute type, a gender corresponding to the gender attribute type, and a deflection angle value of the reference morphological subject corresponding to the posture attribute type, without limitation thereto.

[0120] In some embodiments, taking the morphological attribute type as the pose attribute as an example, according to the reference morphological entity, the reference morphological attribute value corresponding to the morphological attribute type can be determined. For example, it can be the deflection angle value of the reference morphological entity (such as the face morphology). This deflection angle value can be the angle value of the face deflecting in the left - right direction and / or the pitch - yaw direction. Specifically, for example, it can be the angle value of the face deflecting to the left, the angle value of the face deflecting to the right, etc. And the determined deflection angle value of the face is used as the reference morphological attribute value.

[0121] For example, to determine the deflection angle value of the face, it can be to perform parsing processing on the reference image to determine the Euler angle of the face deflection in the reference image, and use the determined Euler angle of the face deflection in the reference image as the angle value of the face deflection. Then, this angle value of the face deflection is used as the reference morphological attribute value. There is no limitation on this.

[0122] Alternatively, it can also be to combine a pre - trained deep - learning model to implement determining the reference morphological attribute value corresponding to the morphological attribute type according to the reference morphological entity. That is, the reference image corresponding to the reference morphological entity and the morphological attribute type can be input into the pre - trained deep - learning model, and the reference morphological attribute value corresponding to the morphological attribute type output by the pre - trained deep - learning model is obtained. There is no limitation on this.

[0123] In step S204, the morphological attribute type and the reference morphological attribute value are jointly used as the reference morphological attribute.

[0124] After determining the morphological attribute type of the reference image and the reference morphological attribute value corresponding to the morphological attribute type in the embodiments of the present disclosure, the morphological attribute type and the reference morphological attribute value can be jointly used as the reference morphological attribute. Since the morphological attribute type of the reference image is determined first, it is possible to effectively filter out the noise interference brought by the morphological attributes of other morphological attribute types to the determination of the reference morphological attribute value based on the morphological attribute type, and accurately determine the reference morphological attribute value corresponding to the morphological attribute type, so that the reference morphological attribute value can accurately characterize the morphological attribute of the reference image of the corresponding morphological attribute type. Therefore, when the morphological attribute type and the reference morphological attribute value are jointly used as the reference morphological attribute, the referability of the reference morphological attribute is effectively improved.

[0125] In step S205, according to the reference morphological attribute, the morphological attribute corresponding to the to - be - processed morphological entity in the to - be - processed image is adjusted to obtain a sample image corresponding to the to - be - processed image.

[0126] For the description of step S205, reference can be made to the above - mentioned embodiments, and details are not repeated here.

[0127] In this embodiment, by obtaining a reference image and an image to be processed, determining the type of morphological attribute of the reference image, and then using the type of morphological attribute and the reference morphological attribute value together as the reference morphological attribute, it is possible to effectively filter out the noise interference brought by the morphological attributes of other morphological attribute types to the determination of the reference morphological attribute value based on the type of morphological attribute, and accurately determine the reference morphological attribute value corresponding to the type of morphological attribute, so that the reference morphological attribute value can accurately represent the morphological attribute of the reference image of the corresponding morphological attribute type. Therefore, when the type of morphological attribute and the reference morphological attribute value are used together as the reference morphological attribute, the referability of the reference morphological attribute is effectively improved. Then, according to the reference morphological attribute, the morphological attribute corresponding to the morphological subject to be processed in the image to be processed is adjusted to obtain a sample image corresponding to the image to be processed, realizing the migration of the reference morphological attribute of the reference morphological subject in the reference image to the image to be processed, so that the generated sample image can fully represent the reference morphological attribute of the reference morphological subject, and realizing the expansion to obtain a sample image containing the reference morphological attribute, which can effectively assist in the expansion of the sample image, so that the sample image can effectively meet the personalized morphological attribute processing requirements in the actual image processing scenario.

[0128] Figure 3 It is a flowchart of a method for generating a sample image shown in another exemplary embodiment.

[0129] As Figure 3 shown, the method for generating a sample image includes the following steps.

[0130] In step S301, a reference image and an image to be processed are obtained. Among them, the reference image includes: a reference morphological subject, and the image to be processed includes: a morphological subject to be processed, and the reference morphological subject and the morphological subject to be processed are different.

[0131] In step S302, the type of morphological attribute of the reference image is determined.

[0132] The descriptions of steps S301 - S302 can be referred to the above embodiment and will not be elaborated here.

[0133] In step S303, the reference latent variable corresponding to the reference morphological subject in the reference image is extracted.

[0134] Among them, the latent variable refers to the latent coding representation of the attribute space of the image, and this latent variable can be used to describe the attribute information of the corresponding morphological subject of the image. By editing the corresponding latent variable of the image, the attributes of the corresponding morphological subject of the image can be controlled and changed.

[0135] Among them, the latent variable corresponding to the reference form main body in the reference image, which can be called the reference latent variable, can be used as a reference for processing the image to be processed in the subsequent sample image generation method. That is, the image to be processed can be processed accordingly based on the reference latent variable corresponding to the reference form main body in the reference image to generate a sample image. For specific details, please refer to the subsequent embodiments.

[0136] In the embodiments of the present disclosure, a pre-trained Style Generative Adversarial Network (StyleGAN) can be used to extract the reference latent variable corresponding to the reference form main body in the reference image. That is, the reference image can be input into the pre-trained StyleGAN network to obtain the reference latent variable corresponding to the reference form main body in the reference image output by the StyleGAN network. There is no limitation in this regard.

[0137] In step S304, the latent variable to be processed corresponding to the main body of the form to be processed in the image to be processed is extracted.

[0138] Among them, the latent variable corresponding to the main body of the form to be processed in the image to be processed can be called the latent variable to be processed.

[0139] In the embodiments of the present disclosure, a pre-trained Style Generative Adversarial Network (StyleGAN) can be used to extract the latent variable to be processed corresponding to the main body of the form to be processed in the image to be processed. That is, the image to be processed can be input into the pre-trained StyleGAN network to obtain the latent variable to be processed corresponding to the main body of the form to be processed in the image to be processed output by the StyleGAN network. There is no limitation in this regard.

[0140] In step S305, the first quantity of reference latent variables and the second quantity of latent variables to be processed are sampled to obtain a plurality of sampled latent variables.

[0141] In the embodiments of the present disclosure, after extracting the first quantity of reference latent variables from the first quantity of reference images and extracting the second quantity of latent variables to be processed from the second quantity of images to be processed, the first quantity of reference latent variables and the second quantity of latent variables to be processed can be randomly sampled to sample a plurality of latent variables, which can be called sampled latent variables.

[0142] In step S306, the reference form attribute values are determined according to the plurality of sampled latent variables.

[0143] After extracting the reference latent variables corresponding to the reference morphological entity in the reference image and the to-be-processed latent variables corresponding to the to-be-processed morphological entity in the to-be-processed image in the embodiments of the present disclosure, the first number of reference latent variables and the second number of to-be-processed latent variables can be sampled to obtain a plurality of sampled latent variables. After obtaining a plurality of sampled latent variables, the reference morphological attribute values can be determined according to the plurality of sampled latent variables. Since the reference latent variables corresponding to the reference image and the to-be-processed latent variables corresponding to the to-be-processed image are extracted in advance, relatively rich latent variables can be obtained, so that when sampling the reference latent variables and the to-be-processed latent variables, a rich sampling basis can be provided for the execution of the sampling process. In addition, by sampling the reference latent variables and the to-be-processed latent variables, the sampled latent variables can be obtained, so that the sampled latent variables can accurately represent the distribution of the reference latent variables and the to-be-processed latent variables. Therefore, when determining the reference morphological attribute values according to the plurality of sampled latent variables, the data processing amount can be effectively reduced to a certain extent while effectively improving the determination efficiency of the reference morphological attribute values.

[0144] In some embodiments, to determine the reference morphological attribute values according to the plurality of sampled latent variables, the plurality of sampled latent variables can be input into a pre-trained three-dimensional face statistical model (Three Dimensional Morphable Model, 3DMM) to obtain the reference morphological attribute values output by the 3DMM model.

[0145] Alternatively, any other possible method can also be used to determine the reference morphological attribute values according to the plurality of sampled latent variables. For example, methods such as algorithms and engineering methods are not limited thereto.

[0146] Optionally, in some embodiments, to determine the reference morphological attribute values according to the plurality of sampled latent variables, the sampled images paired with the sampled latent variables can be determined, where the sampled images are the reference images or the to-be-processed images, and the virtual morphological attribute values of the corresponding paired sampled images can be determined according to the sampled latent variables. Then, the plurality of virtual morphological attribute values are sorted, and a set number ratio of virtual morphological attribute values are selected from the sorted plurality of virtual morphological attribute values as the reference morphological attribute values. Since the virtual morphological attribute values of the sampled images are sorted, a clearer arrangement of the virtual morphological attribute values can be realized. Therefore, when a set number ratio of virtual morphological attribute values are selected from the sorted plurality of virtual morphological attribute values as the reference morphological attribute values, the occurrence of repeated selection can be avoided, and the flexible selection of the required virtual morphological attribute values can also be supported, so that the determination effect of the reference morphological attribute values can be effectively improved.

[0147] In the embodiments of the present disclosure, since multiple sampled latent variables are sampled from the reference latent variables corresponding to the reference image and the to-be-processed latent variables corresponding to the to-be-processed image, that is to say, for any sampled latent variable, there may be a corresponding reference image or to-be-processed image, and the reference image or to-be-processed image can be referred to as the sampled image. Correspondingly, the morphological attribute value corresponding to the sampled image can be referred to as the virtual morphological attribute value.

[0148] That is to say, in the embodiments of the present disclosure, after determining the sampled latent variable, the sampled image paired with the latent variable can be determined. For example, according to the sampled latent variable, the image corresponding to the sampled latent variable can be determined from the reference image and the to-be-processed image, and the image can be used as the sampled image. Or, it can also be to generate an image paired with the sampled latent variable according to the sampled latent variable in combination with the pre-trained StyleGAN network, and use the image as the sampled image, and there is no limitation on this.

[0149] After determining the sampled image paired with the sampled latent variable in the embodiments of the present disclosure, the virtual morphological attribute value of the corresponding paired sampled image can be determined according to the sampled latent variable, and then the multiple virtual morphological attribute values are sorted, so as to select a set number ratio (the set number ratio can be adaptively configured according to the business requirements of the actual sample image generation scenario, and there is no limitation on this) of the virtual morphological attribute values from the sorted multiple virtual morphological attribute values as the reference morphological attribute values. Then, subsequent sample image generation methods can be executed in combination with the reference morphological attribute values. For details, please refer to the subsequent embodiments.

[0150] For example, the multiple virtual morphological attribute values determined above can be sorted from small to large, and a set number ratio (such as 10%, and there is no limitation on this) of the smallest virtual morphological attribute values are determined from the sorted multiple virtual morphological attribute values and used as the reference morphological attribute values, and there is no limitation on this.

[0151] Optionally, in some embodiments, a set number proportion of virtual form attribute values are selected from the multiple virtual form attribute values after sorting as reference form attribute values. It can be to select the first set number proportion of virtual form attribute values with the frontmost sorting from the multiple virtual form attribute values after sorting as reference form attribute values, and / or to select the second set number proportion of virtual form attribute values with the rearmost sorting from the multiple virtual form attribute values after sorting as reference form attribute values. Since the first set number proportion of virtual form attribute values with the frontmost sorting, and / or the second set number proportion of virtual form attribute values with the rearmost sorting are selected from the multiple virtual form attribute values after sorting as reference form attribute values, a clear selection logic for virtual form values is provided, and based on this selection logic, efficient selection of virtual form values can be achieved. In addition, since the virtual form attribute values with the frontmost sorting and / or the rearmost sorting are selected as reference form attribute values, the reference form attribute values can represent the distribution of virtual form attribute values, and based on this reference form attribute value, the smooth execution of the subsequent sample image generation method can be effectively ensured.

[0152] Among them, for the multiple virtual form attribute values after sorting, the pre-set number proportion of the virtual form attribute values with the frontmost sorting can be referred to as the first set number proportion, and the first set number proportion can be adaptively configured according to the business requirements of the actual sample image generation scenario, and there is no limitation thereto.

[0153] Among them, for the multiple virtual form attribute values after sorting, the pre-set number proportion of the virtual form attribute values with the rearmost sorting can be referred to as the second set number proportion, and the second set number proportion can be adaptively configured according to the business requirements of the actual sample image generation scenario, and there is no limitation thereto.

[0154] That is to say, in the embodiments of the present disclosure, after sorting the multiple virtual form attribute values, the first set number proportion of virtual form attribute values with the frontmost sorting can be selected from the multiple virtual form attribute values after sorting as reference form attribute values, and / or the second set number proportion of virtual form attribute values with the rearmost sorting can be selected as reference form attribute values, and there is no limitation thereto.

[0155] For example, taking the multiple virtual form attribute values as the face left deflection angle values, the face left deflection angle values can be sorted from largest to smallest, and 10% of the face left deflection angle values with the frontmost sorting can be determined from the sorted face left deflection angle values as reference form attribute values, and / or 10% of the face left deflection angle values with the rearmost sorting can be selected as reference form attribute values, and there is no limitation thereto.

[0156] In step S307, the morphological attribute type and the reference morphological attribute value are jointly used as the reference morphological attribute.

[0157] For the description of step S307, reference can be made to the above embodiments, which will not be elaborated here.

[0158] In step S308, a plurality of sampled latent variables corresponding to the plurality of reference morphological attributes are determined respectively.

[0159] In the embodiments of the present disclosure, after determining the reference morphological attribute value and jointly using the morphological attribute type and the reference morphological attribute value as the reference morphological attribute, a plurality of sampled latent variables corresponding to the plurality of reference morphological attributes can be determined from the plurality of sampled latent variables obtained by the foregoing sampling, and then subsequent sample image generation methods can be executed based on the plurality of sampled latent variables determined above.

[0160] In step S309, each sampled latent variable is used to edit the latent variable to be processed, and the corresponding edited latent variable is obtained.

[0161] In the embodiments of the present disclosure, after determining a plurality of sampled latent variables corresponding to the plurality of reference morphological attributes respectively, each sampled latent variable can be used to edit the latent variable to be processed, and the latent variable obtained by the foregoing editing process is used as the edited latent variable.

[0162] Optionally, in some embodiments, using each sampled latent variable to edit the latent variable to be processed may be inputting the latent variable to be processed into a binary classification model to obtain the corresponding edited latent variable output by the binary classification model. Since the latent variable to be processed is edited by the binary classification model, the editing logic of the latent variable can be effectively simplified, the editing efficiency of the latent variable can be effectively improved, and in addition, a clear attribute editing direction can be provided for the execution of the subsequent sample image generation method, so that the subsequent sample image generation method can be assisted to be smoothly executed based on this attribute editing direction.

[0163] Among them, the binary classification model is trained by a plurality of sampled latent variables. That is to say, after sampling the first quantity of reference latent variables and the second quantity of latent variables to be processed to obtain a plurality of sampled latent variables, the binary classification model can be trained according to the plurality of sampled latent variables until the binary classification model converges, and then subsequent sample image generation methods can be executed based on the converged binary classification model.

[0164] In the embodiments of the present disclosure, the latent variable to be processed can be input into the binary classification model, and the binary classification model processes the latent variable to be processed to determine the corresponding attribute editing direction, and the attribute editing direction and the latent variable to be processed are jointly used as the edited latent variable.

[0165] Among them, the attribute editing direction can be used to further specifically describe the attributes of the morphological entity. Taking the morphological attribute type as the pose attribute as an example, the attribute editing direction can be the direction in which the morphological entity deflects to the left or the direction in which the morphological entity deflects to the right, and there is no limitation on this.

[0166] In step S310, according to the edited latent variable, the morphological attributes corresponding to the morphological entities to be processed in the image to be processed are adjusted to obtain a sample image corresponding to the image to be processed.

[0167] After determining the attribute editing direction of the latent variable to be processed corresponding to the image to be processed in the embodiment of the present disclosure, the latent variable to be processed in the image to be processed can be edited and processed according to a plurality of sampled latent variables in this attribute editing direction. For example, a generative adversarial network for semantic face editing (Inter Face Generative Adversarial Network, InterFaceGAN) can be used to edit and process the corresponding latent variable to be processed in the image to be processed, so as to realize the adjustment of the morphological attributes corresponding to the morphological entities to be processed in the image to be processed according to the edited latent variable, and obtain a sample image corresponding to the image to be processed, and there is no limitation on this.

[0168] In this embodiment, by obtaining a reference image and an image to be processed, determining the type of morphological attribute of the reference image, extracting a reference latent variable corresponding to the reference morphological subject in the reference image, and extracting a to-be-processed latent variable corresponding to the to-be-processed morphological subject in the image to be processed, then sampling the first number of reference latent variables and the second number of to-be-processed latent variables to obtain a plurality of sampled latent variables, and determining a reference morphological attribute value according to the plurality of sampled latent variables, it is possible to provide a rich sampling basis for the execution of the sampling process when sampling the reference latent variable and the to-be-processed latent variable. In addition, by sampling the reference latent variable and the to-be-processed latent variable, sampled latent variables are obtained, so that the sampled latent variables can accurately represent the distribution of the reference latent variable and the to-be-processed latent variable. Therefore, when determining the reference morphological attribute value according to the plurality of sampled latent variables, the amount of data processing can be effectively reduced to a certain extent while effectively improving the determination efficiency of the reference morphological attribute value. Then, the morphological attribute type and the reference morphological attribute value are jointly used as the reference morphological attribute, and a plurality of sampled latent variables corresponding to the plurality of reference morphological attributes are determined respectively. Then, each sampled latent variable is used to edit the to-be-processed latent variable to obtain a corresponding edited latent variable, and according to the edited latent variable, the morphological attribute corresponding to the to-be-processed morphological subject in the image to be processed is adjusted to obtain a sample image corresponding to the image to be processed. Since the to-be-processed latent variable is edited according to the plurality of sampled latent variables corresponding to the plurality of reference morphological attributes respectively, the processing logic for editing the image to be processed can be effectively simplified, and the reference morphological attribute of the reference morphological subject in the reference image can be migrated to the image to be processed, so that the generated sample image can fully represent the reference morphological attribute of the reference morphological subject, and a sample image containing the reference morphological attribute can be obtained by expansion, which can effectively assist in expanding the sample image, so that the sample image can effectively meet the personalized morphological attribute processing requirements in the actual image processing scenario.

[0169] In the embodiment of the present disclosure, taking the morphological attribute type as the pose attribute as an example, the sample image generation method described in the embodiment of the present disclosure can process the image data of a child with a frontal face attribute based on the image data of an adult with a large face angle deflection attribute to realize the migration of the large face angle deflection attribute to the image data of the child, and obtain the image data of the child with a large face angle deflection attribute.

[0170] For example, as Figure 4 shown, Figure 4It is a flowchart of a sample image generation method shown according to another exemplary embodiment. Adult image data (reference image) with a large-angle deflection attribute and three-year-old child image data (image to be processed) with a frontal face attribute can be obtained, and a Style Generative Adversarial Network (StyleGAN) is used to extract the reference latent variable corresponding to the reference image and the latent variable to be processed corresponding to the image to be processed respectively. Then, sampling processing can be performed on the determined reference latent variable and latent variable to be processed to obtain a plurality of sampled latent variables, and the plurality of sampled latent variables can have paired sampled images. Then, a set number ratio of reference morphological attribute values can be determined from the sampled latent variables corresponding to the sampled images, and a binary classification model can be trained according to the sampled latent variables corresponding to the reference morphological attribute values. Then, the image to be processed can be input into the binary classification model trained above, and combined with the Inter Face Generative Adversarial Network (InterFaceGAN) for semantic face editing to perform editing processing on the three-year-old child image data (image to be processed) to obtain child image data with a large-angle deflection attribute corresponding to the image to be processed. Then, the obtained child image data with a large-angle deflection attribute and the initially obtained three-year-old child image data (image to be processed) are jointly used for subsequent tasks to achieve sample amplification of the child image data with a large-angle deflection attribute.

[0171] In summary, after processing the child image data with a frontal face attribute based on the adult image data with a large-angle deflection attribute of the face, the following beneficial effects can be achieved: Figure 5 It is a schematic diagram of the distribution of the face deflection angles of a reference image and an image to be processed shown according to an exemplary embodiment. As Figure 5 shown, the richness and maximum range of the face deflection angles of the initially obtained reference image (adult image data) are better than those of the image to be processed (child image data). By executing the sample image generation method described in the embodiments of the present disclosure, the distribution of the face deflection angles in the generated sample image data can be as Figure 6 shown. Figure 6 It is a schematic diagram of the distribution of the face deflection angles in sample image data shown according to an exemplary embodiment. As Figure 6 shown, by executing the sample image generation method described in the embodiments of the present disclosure, the richness and maximum range of the face deflection angles of the adult image data and the child image data in the generated sample image data are basically the same, which indicates that the large-angle deflection attribute of the adult image data is well transferred to the child image data. In addition, Figure 7It is a schematic diagram of the error of the average horizontal angle of paired image data of an adult and a child shown according to an exemplary embodiment. As Figure 7 shown, by executing the sample image generation method described in the disclosed embodiment, the error of the average horizontal angle of the paired image data of the adult and the child in the generated sample image data is much smaller than the error of the average horizontal angle of the paired image data of the adult and the child in the initially obtained image to be processed and the reference image.

[0172] Figure 8 It is a block diagram of a sample image generation device shown according to an exemplary embodiment. Referring to Figure 8 , the device includes an acquisition module 801, a determination module 802, and an adjustment module 803.

[0173] The acquisition module 801 is configured to acquire a reference image and an image to be processed, where the reference image includes: a reference form subject, and the image to be processed includes: a form subject to be processed, and the reference form subject and the form subject to be processed are different;

[0174] The determination module 802 is configured to determine the reference form attribute of the reference form subject;

[0175] The adjustment module 803 is configured to adjust the form attribute corresponding to the form subject to be processed in the image to be processed according to the reference form attribute to obtain a sample image corresponding to the image to be processed.

[0176] In some embodiments of the present disclosure, as Figure 9 shown, Figure 9 It is a block diagram of a sample image generation device shown according to another exemplary embodiment. The determination module 802 includes:

[0177] A first determination sub-module 8021, configured to determine the type of form attribute of the reference image;

[0178] A second determination sub-module 8022, configured to determine the reference form attribute value corresponding to the form attribute type according to the reference form subject;

[0179] A first processing sub-module 8023, configured to use the form attribute type and the reference form attribute value together as the reference form attribute.

[0180] In some embodiments of the present disclosure, as Figure 9 shown, the number of reference images is a first number, and the number of images to be processed is a second number, and the first number is greater than the second number;

[0181] Among them, the second determination sub-module 8022 is configured to execute:

[0182] Extract the reference latent variables corresponding to the reference morphological entity in the reference image;

[0183] Extract the latent variables to be processed corresponding to the morphological entity to be processed in the image to be processed;

[0184] Sample the first quantity of reference latent variables and the second quantity of latent variables to be processed to obtain a plurality of sampled latent variables, where the sampled latent variable is a reference latent variable or a latent variable to be processed;

[0185] Determine the reference morphological attribute values according to the plurality of sampled latent variables.

[0186] In some embodiments of the present disclosure, as Figure 9 shown, the second determination sub-module 8022 is configured to execute:

[0187] Determine the sampled image paired with the sampled latent variable, where the sampled image is a reference image or an image to be processed;

[0188] Determine the virtual morphological attribute values of the corresponding paired sampled images according to the sampled latent variables;

[0189] Perform sorting processing on the plurality of virtual morphological attribute values;

[0190] Select a set number ratio of the virtual morphological attribute values from the sorted plurality of virtual morphological attribute values as the reference morphological attribute values.

[0191] In some embodiments of the present disclosure, as Figure 9 shown, the second determination sub-module 8022 is configured to execute:

[0192] Select the first set number ratio of virtual morphological attribute values sorted in the front from the sorted plurality of virtual morphological attribute values as the reference morphological attribute values; and / or

[0193] Select the second set number ratio of virtual morphological attribute values sorted in the back from the sorted plurality of virtual morphological attribute values as the reference morphological attribute values.

[0194] In some embodiments of the present disclosure, as Figure 9 shown, the adjustment module 803 includes:

[0195] The third determination sub-module 8031 is configured to execute determining a plurality of sampled latent variables corresponding to the plurality of reference morphological attributes respectively;

[0196] The second processing sub-module 8032 is configured to execute editing the latent variables to be processed with each sampled latent variable to obtain the corresponding edited latent variables;

[0197] The adjustment sub-module 8033 is configured to adjust the morphological attributes corresponding to the to-be-processed morphological entity in the to-be-processed image according to the edited latent variable, so as to obtain a sample image corresponding to the to-be-processed image.

[0198] In some embodiments of the present disclosure, as Figure 9 shown, the second processing sub-module 8032 is configured to perform:

[0199] Input the to-be-processed latent variable into a binary classification model to obtain the corresponding edited latent variable output by the binary classification model, where the binary classification model is trained by a plurality of sampled latent variables.

[0200] In some embodiments of the present disclosure, as Figure 9 shown, the morphological attribute type includes any one or a combination of the following:

[0201] Age attribute, gender attribute, pose attribute.

[0202] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0203] In this embodiment, by obtaining a reference image and a to-be-processed image, where the reference image includes a reference morphological entity, the to-be-processed image includes a to-be-processed morphological entity, the reference morphological entity and the to-be-processed morphological entity are different, determining the reference morphological attributes of the reference morphological entity, and then adjusting the morphological attributes corresponding to the to-be-processed morphological entity in the to-be-processed image according to the reference morphological attributes, a sample image corresponding to the to-be-processed image is obtained, so as to realize migrating the reference morphological attributes of the reference morphological entity in the reference image to the to-be-processed image, so that the generated sample image can fully represent the reference morphological attributes of the reference morphological entity, realize expanding to obtain a sample image including the reference morphological attributes, and can effectively assist in expanding the sample image, so that the sample image can effectively meet the personalized morphological attribute processing requirements in the actual image processing scenario.

[0204] The embodiments of the present disclosure further provide an electronic device, Figure 10 which is a block diagram of an electronic device shown according to an exemplary embodiment. For example, the electronic device 1000 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0205] Referring to Figure 10, the electronic device 1000 may include one or more of the following components: a processing component 1002, a memory 1004, a power component 1006, a multimedia component 1008, an audio component 1010, an input / output (I / O) interface 1012, a sensor component 1014, and a communication component 1016.

[0206] The processing component 1002 generally controls the overall operation of the electronic device 1000, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 1020 to execute instructions to complete all or part of the steps of the above methods. In addition, the processing component 1002 may include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.

[0207] The memory 1004 is configured to store various types of data to support the operation of the electronic device 1000. Examples of such data include instructions for any application or method operating on the electronic device 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 1004 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0208] The power component 1006 provides power to the various components of the electronic device 1000. The power component 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 1000.

[0209] The multimedia component 1008 includes a touch display screen that provides an output interface between the electronic device 1000 and the user account. In some embodiments, the touch display screen may include a liquid crystal display (LCD) and a touch panel (TP). The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. When the electronic device 1000 is in an operation mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0210] The audio component 1010 is configured to output and / or input audio signals. For example, the audio component 1010 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 1000 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 1004 or transmitted via the communication component 1016.

[0211] In some embodiments, the audio component 1010 further includes a speaker for outputting audio signals.

[0212] The I / O interface 1012 provides an interface between the processing component 1002 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include but are not limited to: a home button, a volume button, a power button, and a lock button.

[0213] The sensor component 1014 includes one or more sensors for providing status assessments of various aspects of the electronic device 1000. For example, the sensor component 1014 can detect the on / off state of the electronic device 1000, the relative positioning of components, such as the display and the keypad of the electronic device 1000. The sensor component 1014 can also detect a change in the position of the electronic device 1000 or a component of the electronic device 1000, the presence or absence of contact between the user account and the electronic device 1000, the orientation or acceleration / deceleration of the electronic device 1000, and the temperature change of the electronic device 1000. The sensor component 1014 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 1014 can also include a light sensor, such as a CMOS or a CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 1014 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0214] The communication component 1016 is configured to facilitate communication between the electronic device 1000 and other devices in a wired or wireless manner. The electronic device 1000 can access a communication standard-based wireless network, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0215] In an exemplary embodiment, the electronic device 1000 can be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described sample image generation method.

[0216] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1004 including instructions, and the above instructions can be executed by a processor 1020 of the electronic device 1000 to complete the above method. Optionally, the computer-readable storage medium can be a ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0217] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, it implements the sample image generation method as described above.

[0218] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0219] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A method for generating a sample image, characterized in that, Including: Obtain a reference image and an image to be processed. Among them, the reference image includes a reference morphological object, and the image to be processed includes a morphological object to be processed. The reference morphological object and the morphological object to be processed are different. The number of the reference images is a first number, and the number of the images to be processed is a second number, and the first number is greater than the second number; Determine the reference morphological attribute of the reference morphological object; Among them, the determining the reference morphological attribute of the reference morphological object includes: Determine the type of morphological attribute of the reference image; Extract the reference latent variable corresponding to the reference morphological object in the reference image; Extract the latent variable to be processed corresponding to the morphological object to be processed in the image to be processed; Sample the first number of the reference latent variables and the second number of the latent variables to be processed to obtain a plurality of sampled latent variables, where the sampled latent variable is the reference latent variable or the latent variable to be processed; Determine the reference morphological attribute value according to the plurality of sampled latent variables; Use the type of morphological attribute and the reference morphological attribute value together as the reference morphological attribute; Adjust the morphological attribute corresponding to the morphological object to be processed in the image to be processed according to the reference morphological attribute to obtain a sample image corresponding to the image to be processed; The adjusting the morphological attribute corresponding to the morphological object to be processed in the image to be processed according to the reference morphological attribute to obtain a sample image corresponding to the image to be processed includes: Determine a plurality of the sampled latent variables corresponding to a plurality of the reference morphological attributes respectively; Input the latent variable to be processed into a binary classification model to obtain a corresponding edited latent variable output by the binary classification model, where the binary classification model is trained by the plurality of the sampled latent variables; Adjust the morphological attribute corresponding to the morphological object to be processed in the image to be processed according to the edited latent variable to obtain the sample image corresponding to the image to be processed.

2. The sample image generation method according to claim 1, wherein The determining the reference morphological attribute value according to the plurality of sampled latent variables includes: Determine the sampled image paired with the sampled latent variable, where the sampled image is the reference image or the image to be processed; Determine the virtual morphological attribute value of the corresponding paired sampled image according to the sampled latent variable; Perform a sorting process on a plurality of the virtual morphological attribute values; Select a set number ratio of the virtual morphological attribute values from the sorted plurality of the virtual morphological attribute values as the reference morphological attribute value.

3. The sample image generation method according to claim 2, wherein The selecting a set number ratio of the virtual morphological attribute values from the sorted plurality of the virtual morphological attribute values as the reference morphological attribute value includes: Select the first set number ratio of the virtual morphological attribute values ranked at the front from the sorted plurality of the virtual morphological attribute values as the reference morphological attribute value; and / or Select the second set number ratio of the virtual morphological attribute values ranked at the back from the sorted plurality of the virtual morphological attribute values as the reference morphological attribute value.

4. The method for generating a sample image according to any one of claims 2-3, characterized in that The morphological attribute type includes any one or a combination of the following: Age attribute, gender attribute, posture attribute.

5. A sample image generation device, characterized in that, Including: An acquisition module, configured to acquire a reference image and an image to be processed, wherein the reference image includes a reference morphological object, and the image to be processed includes a morphological object to be processed. The reference morphological object and the morphological object to be processed are different. The number of the reference images is a first number, and the number of the images to be processed is a second number. The first number is greater than the second number; A determination module, configured to determine a reference morphological attribute of the reference morphological object; The determination module includes: A first determination sub-module, configured to determine the morphological attribute type of the reference image; A second determination sub-module, configured to extract a reference latent variable corresponding to the reference morphological object in the reference image; extract a latent variable to be processed corresponding to the morphological object to be processed in the image to be processed; sample the first number of the reference latent variables and the second number of the latent variables to be processed to obtain a plurality of sampled latent variables, wherein the sampled latent variable is the reference latent variable or the latent variable to be processed; determine a reference morphological attribute value according to the plurality of sampled latent variables; A first processing sub-module, configured to use the morphological attribute type and the reference morphological attribute value together as the reference morphological attribute; An adjustment module, configured to adjust the morphological attribute corresponding to the morphological object to be processed in the image to be processed according to the reference morphological attribute to obtain a sample image corresponding to the image to be processed; The adjustment module includes: A third determination sub-module, configured to determine a plurality of the sampled latent variables respectively corresponding to the plurality of the reference morphological attributes; A second processing sub-module, configured to input the latent variable to be processed into a binary classification model to obtain a corresponding edited latent variable output by the binary classification model, wherein the binary classification model is trained by the plurality of the sampled latent variables; An adjustment sub-module, configured to adjust the morphological attribute corresponding to the morphological object to be processed in the image to be processed according to the edited latent variable to obtain the sample image corresponding to the image to be processed.

6. The sample image generation device according to claim 5, characterized in that, The second determination sub-module is configured to: Determine a sampled image paired with the sampled latent variable, wherein the sampled image is the reference image or the image to be processed; Determine a virtual morphological attribute value of the corresponding paired sampled image according to the sampled latent variable; Perform a sorting process on the plurality of the virtual morphological attribute values; Select a virtual morphological attribute value with a set quantity ratio from the plurality of the virtual morphological attribute values after the sorting process as the reference morphological attribute value.

7. The sample image generation device according to claim 6, wherein, The second determination sub-module is configured to: Select the first set quantity ratio of the virtual morphological attribute values ranked at the front from the plurality of the virtual morphological attribute values after the sorting process as the reference morphological attribute value; and / or From the multiple virtual form attribute values after sorting processing, select the second set number proportion of the virtual form attribute values that are sorted later as the reference form attribute values.

8. The sample image generation device according to any one of claims 6-7, characterized in that, The form attribute types include any one or a combination of the following: Age attribute, gender attribute, posture attribute.

9. An electronic device, characterized in that, Comprising: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the instructions to implement the method according to any one of claims 1-4.

10. A computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enabling the electronic device to execute the method according to any one of claims 1-4.

11. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Generation method of age transformation face image and generative adversarial network model

    CN112883756A

  • Processing method of image generator and image generation method and device

    CN113822953A