Special effect image generation method, device, electronic device and storage medium
By constructing paired training data and generating a target special effects image conversion model, the problems of inconvenience and poor quality of paired data in the existing technology are solved, and the accuracy of image processing is improved.
Patent Information
- Application Number
- CN202210023138.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-10
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-01-10
AI Technical Summary
In existing technologies, generating paired training data requires a large amount of manual collection and hand-drawing of images, resulting in poor data quality and affecting the accuracy of the model.
By constructing paired training data in training samples, including original images and style images, assigning target stylized material parameters based on the same acquisition conditions, and generating a target special effects image conversion model, the problems of inconvenience and poor quality of paired data are solved.
The quality and richness of paired data are improved, which in turn improves the image processing accuracy of the target special effect image conversion model.
Smart Images

Figure CN114387158B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of image processing technology, and in particular to a special effect image generation method, device, electronic device, and storage medium. Background Art
[0002] Currently, the corresponding images can be generated based on the neural network. Before the neural network is processed, the corresponding training samples can be constructed to train the model based on the training samples.
[0003] The constructed training samples include original data collected in a real environment. After a series of processing, data with similar size and clarity are obtained, and the data are annotated to obtain the original data set.
[0004] To generate paired data of a certain style theme corresponding to the original dataset, it is often necessary to manually hand-draw hundreds or thousands of images of a certain style theme based on the original dataset, and each style type also requires hundreds or thousands of images, so as to obtain a paired dataset corresponding to the original dataset.
[0005] However, the above method requires manual collection of a large number of original images and manual drawing of a large amount of style data associated with the original data, which leads to the difficulty and high cost of generating paired data. Furthermore, drawing images of the same style requires thousands of images, and the quality of the drawn images is uneven, which in turn leads to the problem of low accuracy of the trained model. Summary of the Invention
[0006] The present invention provides a special effect image generation method, device, electronic device and storage medium to achieve the quality of generating paired training data, thereby optimizing the target special effect image generation model.
[0007] In a first aspect, an embodiment of the present invention provides a method for generating a special effect image, the method comprising:
[0008] When the special effect display control is detected to be triggered, an image to be processed including the part to be processed is acquired;
[0009] Performing special effects processing on the image to be processed based on a target special effects graph conversion model to obtain a target special effects graph;
[0010] Among them, the part to be processed in the target special effect image is displayed as a target special effect, and the target special effect image is determined based on a pre-constructed training sample, and the training sample includes paired training data, and the paired training data includes an original image and a style image, and the style image is determined after assigning target stylized material parameters to the part to be rendered under the same acquisition conditions; the part to be rendered is adapted to the part to be processed.
[0011] In a second aspect, an embodiment of the present invention further provides a special effect image generating device, the device comprising:
[0012] The image acquisition module to be processed is used to obtain the image to be processed including the part to be processed when the triggering of the special effect display control is detected;
[0013] A special effects image generation module is used to perform special effects processing on the image to be processed based on a target special effects image conversion model to obtain a target special effects image;
[0014] Among them, the part to be processed in the target special effect image is displayed as a target special effect, and the target special effect image is determined based on a pre-constructed training sample set, the training samples in the training sample set include paired training data, and the paired training data include original images and style images, and the style image is determined after assigning target stylized material parameters to the part to be rendered under the same acquisition conditions; the part to be rendered is adapted to the part to be processed.
[0015] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0016] one or more processors;
[0017] a storage device for storing one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the special effect image generation method as described in any one of the embodiments of the present invention.
[0019] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the special effect image generation method as described in any one of the embodiments of the present disclosure.
[0020] The technical solution of the embodiment of the present disclosure obtains a to-be-processed image including a to-be-processed part when a triggering special effect display control is detected, processes the to-be-processed image special effects based on a target special effect image conversion model, and obtains a target special effect image. The training of the target special effect image conversion model is based on the constructed paired data, which solves the problems in the prior art of the inconvenience of constructing paired data and the poor quality of paired data, resulting in poor processing effect of the to-be-processed image by the target special effect image conversion model, and achieves the technical effect of improving the quality and richness of paired data, thereby improving the accuracy of image processing by the target special effect image conversion model. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0022] Figure 1 A schematic flow chart of a method for generating special effects images provided in the first embodiment of the present disclosure;
[0023] Figure 2 A schematic structural diagram of a special effects image generating device provided in the second embodiment of the present disclosure;
[0024] Figure 3 This is a schematic diagram of the structure of an electronic device provided in Example 3 of the present disclosure. DETAILED DESCRIPTION
[0025] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0026] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0027] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0028] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifications of "one" and "a plurality of" mentioned in this disclosure are illustrative and not restrictive. Those skilled in the art should understand that unless the context clearly indicates otherwise, they should be understood as "one or more".
[0029] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0030] Example 1
[0031] Figure 1 This is a flow chart of a special effects image generation method provided in the first embodiment of the present disclosure. The embodiment of the present disclosure is applicable to any special effects display or special effects processing scenario supported by the Internet, and is used for the situation where multiple animation special effects are superimposed and played simultaneously. The method can be executed by a special effects image generation device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, PC or server, etc.
[0032] like Figure 1 As shown, the method includes:
[0033] S110: Determine paired training data in each training sample.
[0034] The samples used to train the target special effects conversion model are used as training samples. The training samples include original data and special effects data. The original data and configuration data are used as paired training data.
[0035] In this embodiment, determining the paired training data in each training sample includes: determining at least one type of training sample construction model corresponding to the part to be rendered; and determining the paired training data in each training sample based on the construction model of each training sample and pre-set target stylized material parameters.
[0036] The part to be rendered can be any part of the limb, optionally including the hands, feet, arms, legs, or joints. The at least one type can be two or more types, each of which can correspond to a gender, optionally male or female. It can also correspond to age levels, with the step size for each age level being five or ten years. Models corresponding to at least one gender type and different age levels can be downloaded online. Accordingly, the training sample construction model is a realistic model that is consistent with the part to be rendered. In this case, the training sample construction model is a basic model without any special effects added. The target stylized material parameters can be understood as the model corresponding to the training sample construction model after adding special effects. The target stylized material parameters can be parameters that correspond to the part to be rendered wearing a hat, gloves, or some stylized clothing. It should be noted that various wearable items have certain aesthetic qualities and textures. Paired data is training samples constructed based on the training sample construction model and the corresponding target stylized material parameters assigned to the training sample construction model. This data primarily serves as data for model training. Specifically, the part to be rendered can be a hand. A male hand model, a female hand model, or hand models of different age groups can be constructed. If only male and female hands are required, the hand model is primarily a generic one. Optionally, an adult male or female hand model can be constructed. The constructed hand models are used as training samples to construct the model.
[0037] To obtain the corresponding paired data, the training sample construction model must be assigned the corresponding target stylized material parameters based on the corresponding training sample construction model. Optionally, the target stylized material parameters are material parameters corresponding to furry gloves. Based on the training sample construction model and the training sample construction model assigned the target stylized material parameters, the paired training data for each training sample can be determined.
[0038] On the basis of the above technical solution, a training sample construction model of at least one type corresponding to the part to be rendered is determined, including: obtaining at least one type of to-be-processed basic model corresponding to the part to be rendered, and attaching mapping information to the basic model to obtain at least one basic model to be used; wherein at least one type matches the gender in the user attributes; based on at least one basic model to be used and preset skin material parameters, at least one training sample construction model is determined.
[0039] The base model to be processed is consistent with the part to be rendered. In this case, it primarily refers to a model that matches the underlying skeletal information of the part to be rendered. The texture information can be understood as adding corresponding skin information, such as skin of different skin tones, to the base part to be processed. The base model to which the corresponding texture information is attached is used as the base model to be used. The skin material parameters can be more detailed texture information, vascular information, and other information added to the base model to be used. The model corresponding to the above operations is used as the training sample to construct the model.
[0040] Specifically, a schematic diagram of the part to be rendered, including skeletal muscle and skin information, can be collected from the Internet or actual scenes. Optionally, for example, a model corresponding to a laser scanner or CT image of the part to be rendered can be obtained as the basic model to be used; or a 3D model of the part to be rendered can be downloaded from the Internet as the basic model to be processed. After obtaining the basic model to be processed, a texture can be attached to the basic model to obtain the basic model to be used. At the same time, the basic model to be used is corrected based on the preset skin parameters to obtain a training sample construction model. It can be understood that each training sample construction model includes the basic model to be used and a model obtained by adding the corresponding preset skin parameters to the basic model to be used. In this embodiment, based on at least one basic model to be used and preset skin material parameters, at least one training sample construction model is determined, including: for each basic model to be used, the basic model to be used is bound to the skeleton information, and at least one set of joint display parameters is bound to the skeleton information, so as to retrieve the corresponding joint display parameters based on the operation information of the basic model to be used to obtain a first model; wherein the joint display parameters correspond to the posture information of the basic model to be used; at least one set of preset skin material parameters is assigned to the first model respectively, and at least one sample construction model to be trained is determined; wherein each set of preset skin material parameters matches the age in the user attributes, and each set of preset skin material parameters includes at least one of vascular parameters, skin quality parameters and spot information.
[0041] In order to obtain a training sample construction model for the part to be rendered in various poses, thereby building a richer training sample, the base model to be used can be further processed to obtain a model of the part to be rendered in various poses, and then obtain a training sample construction model.
[0042] The part to be rendered can be a hand, which includes five fingers, each with at least three joints. Weights can be assigned to each of the three joints on each finger. Different hand postures correspond to different joint display parameters, and each set of key display parameters corresponds to the hand posture. For example, a clenched fist corresponds to the first set of joint display parameters, while an open-fingered hand corresponds to the second set of joint display parameters. The joint display parameters primarily modify the texture information corresponding to different hand postures. Therefore, corresponding joint display parameters can be added to the base model to be used, allowing for subtle adjustments to the corresponding hand posture based on the joint display parameters. The resulting model, after assigning the joint display parameters to the base model to be used, serves as the first model. At least one set of preset skin material parameters is provided to enrich the texture features of the first model. Each set of skin material parameters matches the user's age in the user attributes. For example, starting at two years old, a set of skin material parameters is assigned every ten years, as skin quality parameters vary with age. The to-be-trained sample construction model is a model that participates in determining the training sample. By assigning different skin material parameters to different first models, a plurality of to-be-trained sample construction models can be obtained.
[0043] Typically, the skin material parameters mainly include at least one of vascular parameters, skin quality parameters, and spot information. The vascular parameters may be the thickness of the blood vessels, and the degree of visibility of the blood vessels. The vascular parameters corresponding to different age groups are different. The skin quality parameters may be skin color parameters, for example, the skin color parameters may be at least one of yellow skin, white skin, and dark skin. The spot information may be whether there are spots, moles, etc. on the hands, which can be added to the first model. Adjusting the first model based on the skin parameters can improve the matching degree between the model constructed by the sample to be trained and an actual part, that is, the authenticity of the first model is improved.
[0044] In this embodiment, by adding the corresponding preset skin quality parameters to each first model, a number of training sample construction models with different hand postures and skin quality parameters can be obtained. However, the paired training data includes not only the data corresponding to the original image, but also the data corresponding to the style image after adding the corresponding special effects. Therefore, the training sample construction model obtained at this time is used as the model for determining the original image in the paired training data. To determine the style image in the paired data, the corresponding paired sample construction model can be constructed based on the corresponding training sample construction model.
[0045] The paired sample construction model is the model that results from adding special effect parameters. The added special effects can be one or more superimposed effects, and users can set them based on their specific needs. Accordingly, the style material parameters can be the parameters corresponding to the superposition of multiple special effects. For example, if the desired superimposed special effect is gloves, then the target stylized material parameters can be those for gloves; if the desired special effect is a skeleton hand, then the target stylized material parameters can be those corresponding to a skeleton hand. Of course, the material parameters corresponding to the superimposed special effects are the parameters corresponding to the superposition of various special effects.
[0046] Optionally, determining the paired sample construction model may be: determining the paired sample construction model corresponding to each training sample based on each training sample construction model and preset target stylized material parameters.
[0047] Specifically, the parameters corresponding to the determined target special effects are used as target stylized material parameters, and the target stylized material parameters are assigned to the corresponding training sample construction models to obtain paired sample construction models corresponding to the training sample construction models.
[0048] Optionally, the method of determining a paired sample construction model corresponding to each training sample based on each training sample construction model and a pre-set target stylized material parameter includes: for each training sample construction model, assigning a target stylized material parameter of at least one style type to the current training sample construction model to obtain a paired sample construction model corresponding to the current training sample construction model.
[0049] To increase the richness and quantity of paired training data, each training sample construction model can be processed in the above manner. That is, at least one target stylized material parameter of a style type is added to each training sample construction model to obtain a paired sample construction model that is consistent with each training sample construction model.
[0050] Among them, at least one style type can be a pre-set special effect style type, or a special effect type, and accordingly, the target stylized material parameters are the superposition of material parameters of all special effects.
[0051] On the basis of the above technical solution, after obtaining the training sample construction model and the corresponding paired sample construction model, the paired training data in each training sample can be determined. Optionally, the acquisition parameters are adjusted in sequence to obtain the original image corresponding to the current training sample construction model, and the style image of the paired sample construction model corresponding to the current training sample construction model under the same acquisition parameters is obtained; wherein the acquisition parameters include the acquisition angle and the light amount information of the environment to which the current training sample belongs; based on the original image and style image corresponding to the same acquisition parameters, the paired training data is determined.
[0052] The acquisition parameters primarily include the acquisition angle and the amount of light in the model's environment. The image determined by the model constructed based on the training samples is used as the original image, and the image determined by the model constructed based on the paired samples is used as the style image. The images of the training sample model and the paired sample model constructed under the same acquisition parameters and for the same hand posture are used as paired training data. The paired training data is used to train the corresponding model. This approach improves the convenience and effectiveness of acquiring training sample data, while also ensuring the quality of the paired data. The amount of light primarily simulates the light field information in a real environment. That is, images of real hands under natural light.
[0053] It's also important to note that the light intensity information in this technical solution primarily simulates the light intensity in a natural environment, specifically the image of the actual part to be rendered, optionally the hand, in a real-world environment. This approach addresses the existing problem of using virtual light sources to illuminate objects, resulting in artificial images that differ significantly from the real world, and also resulting in low fidelity in the special effects images output by the trained model.
[0054] Based on this, the method adopted can be: construct a spherical grid with the current training sample construction model as the sphere center; wherein the spherical grid includes multiple grid points; based on the acquisition device deployed on at least one target grid point and the light field covering the spherical grid, obtain the original image corresponding to the current training sample construction model; wherein, at least one target grid point is a predetermined acquisition angle, and when the current training sample construction model is illuminated based on the light field, a random rotation value is superimposed on the light field.
[0055] It should be noted that the data collection method for each training sample construction model and the corresponding paired sample construction model is the same. Here, the processing of one set of training sample construction models and the corresponding paired sample construction models is used as an example to introduce.
[0056] Specifically, a spherical mesh and a light field covering the spherical mesh can be constructed with the current training sample construction model as the sphere center. That is, the light field is also a sphere that covers the spherical mesh and the current training sample construction model, and the center of the sphere is consistent with the center of the spherical mesh. The light intensity information of the light field can be adjusted, that is, the lighting information can be produced based on real-world environment acquisition (High-dynamic-range imaging (HDRI), randomly using an HDRI and adding a random rotation value to ensure realism while maximizing diversity, that is, at this time, information about a certain part in the real environment can be collected. The spherical mesh includes multiple grid points, and a virtual camera can be deployed at each grid point to collect training sample construction models from different perspectives based on the virtual camera to obtain original images. At the same time, the training sample construction model can be replaced with a paired sample construction model, and style images can be collected under the same acquisition conditions. The original image and style image corresponding to the same acquisition conditions are used as paired training data.
[0057] Superimposing random rotation values on the light field can be understood as the light field being rotated relative to the training sample construction model or the paired sample construction model. The advantage of this setting is that original images and style images with different lighting and perspectives can be collected.
[0058] In practical applications, the original and style images collected at certain grid points may not be relevant. To improve the efficiency of paired training data acquisition, we can predetermine which visual angles are unsuitable for training the model. Accordingly, when collecting original and style images, we can omit these images. Alternatively, we can obtain the original and style images at each grid point and delete the corresponding images according to pre-set filtering criteria.
[0059] It should also be noted that the methods for determining the original image and the style image are the same, and here, the method of determining the original image is used as an example.
[0060] Optionally, based on the acquisition device deployed on each target grid and the light field, the original image to be screened of the current training sample construction model is obtained; the original image is determined from the original image to be screened; the acquisition angle corresponding to the original image is determined, and at least the grid point corresponding to the acquisition angle is marked, so as to acquire the original image of each training sample construction model based on the marked target grid point.
[0061] Specifically, the images captured at each grid point are used as the original images to be filtered. Based on a predetermined capture angle, the original images to be filtered at a larger angle are filtered to obtain the original images. While obtaining the original images, the capture conditions corresponding to each original image can be recorded, so that the style images corresponding to each original image can be obtained based on the same capture conditions.
[0062] In this embodiment, there are at least two ways to determine the style image, which can be:
[0063] The first method is: each time an original image is collected, the current training sample construction model is replaced by a model based on a corresponding paired sample construction model, and a style image is determined based on collection parameters corresponding to the original image.
[0064] This means that for every original image captured, a style image is also captured. Each time an original image is captured, the current training sample model at the center of the sphere grid is replaced with the paired sample training model. The paired sample training model is acquired using the same acquisition parameters, resulting in the original image and style image under the same acquisition conditions.
[0065] The second method is: after obtaining each original image, the current training sample construction model is replaced based on the corresponding paired sample construction model, and the style image corresponding to the corresponding original image is collected according to the collection parameters of each original image.
[0066] This can be understood as follows: while obtaining all original images corresponding to the current training sample construction model, the acquisition angle and light intensity information corresponding to each original image are recorded. The paired sample construction model corresponding to the current training sample construction model is used as the center point of the spherical grid. Based on the acquisition conditions of each original image, a style image corresponding to the training sample construction model is acquired. The original images and style images acquired under the same acquisition conditions are considered a set of paired training data.
[0067] It should also be noted that determining the paired training data may also involve determining a spherical mesh of a paired sample construction model corresponding to the current training sample construction model in the same manner, and acquiring the current training sample construction model and the paired sample construction model based on pre-set acquisition angles and light intensity information, respectively, to obtain an original image and a style image. The style image and original image under the same acquisition conditions are determined to obtain a set of paired training data. In this embodiment, the part to be processed includes any part of the limbs and torso, including at least one of the hands, head, arms, and legs; and the target stylized material parameters include decorative parameters corresponding to the rendered special effects.
[0068] It should be noted that, in order to clearly introduce the present technical solution, the hand is taken as an example for description, but the hand is not a limitation of the present solution and can be any part.
[0069] It should also be noted that any situation where training samples need to be obtained can be obtained using the method of this technical solution. This method improves the convenience, high quality and effectiveness of sample acquisition.
[0070] S120 , training the to-be-trained special effect image conversion model based on each training sample to obtain a target special effect image conversion model, so as to convert the to-be-processed part in the to-be-processed image into a target special effect based on the target special effect image conversion model.
[0071] The model parameters in the trained special effects image conversion model are default values. The target special effects image conversion model is a model obtained by processing the trained special effects image conversion model based on the training samples. Based on the target special effects image conversion model, the processed part of the processed image can be converted into the corresponding target special effects.
[0072] In other words, the special effects obtained by the target special effects image conversion model have a certain relationship with the training samples. The target special effects obtained can be determined by the target style material parameters corresponding to the style image in the training samples.
[0073] After obtaining the paired training data, the to-be-trained special effects image conversion model can be trained based on the original images and style images in each paired training data to obtain a target special effects image conversion model. The target special effects image conversion model can be deployed in a terminal device so that when an image to be processed is captured, special effects processing can be performed on the captured image to be processed.
[0074] It can be understood as: taking the original image as the input of the special effects image conversion model to be trained, and taking the style image corresponding to the original image as the corresponding model output, to train the target special effects image conversion model.
[0075] S130: When it is detected that the special effect display control is triggered, an image to be processed including the part to be processed is acquired.
[0076] Among them, the device for executing the video processing method provided by the embodiment of the present disclosure can be integrated into the application software that supports the video image processing function, and the software can be installed in an electronic device. Optionally, the electronic device can be a mobile terminal or a PC. The application software can be a type of software for image / video processing. The specific application software will not be described here one by one, as long as the image / video processing can be achieved. It can also be a specially developed application to implement the software for adding special effects and displaying special effects, or it can be integrated in the corresponding page, and the user can implement the special effect addition processing through the page integrated in the PC.
[0077] It should also be noted that this technical solution can be applied to any scenario that requires special effects display, for example, in short video shooting, during video calls, or by embedding its model into an image shooting software that can process images, or by embedding it into a certain software as a special effects prop. Specifically, a special effects prop can be triggered, and the implementation of the special effect can be generated by a target special effects graph conversion model trained based on paired sample data constructed in the above manner. After the special effects prop is triggered, the image to be processed including the part to be processed can be collected based on the built-in camera device. The part to be processed at this time is consistent with the part to be rendered during model training.
[0078] S140 , performing special effects processing on the image to be processed based on the target special effects graph conversion model to obtain a target special effects graph.
[0079] Specifically, the target special effect graph conversion model can perform special effect conversion processing on the part to be processed in the image to be processed, and obtain a target special effect graph that converts the part to be processed into the target special effect.
[0080] In addition to the above technical solutions, it should be noted that the parts to be rendered are mostly hands. Diverse combinations of hand data, such as diverse lighting, increase recognition rates in low-light environments; palm wrinkles enhance the effect of half-fist gestures. At the same time, improvements are mainly made to data distribution, such as filtering out large angles and controlling data ratios to keep it as close to the actual distribution as possible. This approach ensures high-quality and convenient paired data acquisition, thereby improving the accuracy of the trained special effects image conversion model.
[0081] The technical solution of the embodiment of the present disclosure obtains a to-be-processed image including a to-be-processed part when a triggering special effect display control is detected, processes the to-be-processed image special effects based on a target special effect image conversion model, and obtains a target special effect image. The training of the target special effect image conversion model is based on the constructed paired data, which solves the problems in the prior art of the inconvenience of constructing paired data and the poor quality of paired data, resulting in poor processing effect of the to-be-processed image by the target special effect image conversion model, and achieves the technical effect of improving the quality and richness of paired data, thereby improving the accuracy of image processing by the target special effect image conversion model.
[0082] Example 2
[0083] Figure 2 This is a structural diagram of a special effect image generation device provided in the second embodiment of the present disclosure. The device includes: a to-be-processed image acquisition module 210 and a special effect image generation module 220.
[0084] Among them, the image to be processed acquisition module 210 is used to obtain the image to be processed including the part to be processed when the triggering special effect display control is detected; the special effect map generation module 220 is used to perform special effect processing on the image to be processed based on the target special effect map conversion model to obtain a target special effect map; wherein, the part to be processed in the target special effect map is displayed as a target special effect, and the target special effect image is determined based on a pre-constructed training sample set, and the training samples in the training sample set include paired training data, and the paired training data include original images and style images, and the style image is determined after assigning target stylized material parameters to the part to be rendered based on the same acquisition conditions; the part to be rendered is adapted to the part to be processed.
[0085] On the basis of the above technical solution, the device includes:
[0086] A training sample determination module is used to determine paired training data in each training sample;
[0087] The model generation module is used to train the to-be-trained special effect image conversion model based on each training sample to obtain the target special effect image conversion model, so as to convert the to-be-processed part in the to-be-processed image into the target special effect based on the target special effect image conversion model.
[0088] Based on the above technical solution, the training sample determination module includes:
[0089] a sample construction model determining unit, configured to determine at least one type of training sample construction model corresponding to the part to be rendered;
[0090] a paired sample construction model determining unit, configured to determine, based on each training sample construction model and preset target stylized material parameters, a paired sample construction model corresponding to each training sample construction model;
[0091] The data determination unit is used to determine the paired training data in each training sample based on the training sample construction model and the corresponding paired sample construction model.
[0092] On the basis of the above technical solution, the sample construction model determination unit includes:
[0093] a base model determination subunit, configured to obtain at least one type of base model to be processed corresponding to the part to be rendered, and attach texture information to the base model to obtain at least one base model to be used; wherein the at least one type matches the gender in the user attribute;
[0094] The construction model determination subunit is used to determine at least one training sample construction model based on the at least one basic model to be used and preset skin material parameters.
[0095] On the basis of the above technical solution, the construction model determines the subunits, and is further used to:
[0096] For each basic model to be used, the basic model to be used is bound to the skeleton information, and at least one set of joint display parameters is bound to the skeleton information, so as to retrieve the corresponding joint display parameters based on the operation information of the basic model to be used to obtain a first model; wherein, the joint display parameters correspond to the posture information of the basic model to be used; at least one set of preset skin material parameters is assigned to the first model respectively, and at least one sample construction model to be trained is determined; wherein, each set of preset skin material parameters matches the age in the user attributes, and each set of preset skin material parameters includes at least one of blood vessel parameters, skin quality parameters and spot information.
[0097] On the basis of the above technical solution, the paired sample construction model determination unit is used to
[0098] For each training sample construction model, a target stylized material parameter of at least one style type is assigned to the current training sample construction model to obtain a paired sample construction model corresponding to the current training sample construction model.
[0099] On the basis of the above technical solution, the data determination unit is used to:
[0100] Adjust the acquisition parameters in sequence to obtain the original image corresponding to the current training sample construction model, and obtain the style image of the paired sample construction model corresponding to the current training sample construction model under the same acquisition parameters; wherein the acquisition parameters include the acquisition angle and the amount of light information of the environment to which the current training sample construction model belongs; determine the paired training data based on the original image and style image corresponding to the same acquisition parameters.
[0101] On the basis of the above technical solution, the data determination unit is used to:
[0102] Constructing a spherical grid with the current training sample construction model as the sphere center; wherein the spherical grid includes a plurality of grid points;
[0103] Acquire an original image corresponding to the current training sample construction model based on a collection device deployed on at least one target grid point and a light field covering the spherical grid;
[0104] The at least one target grid point is a predetermined acquisition angle, and when constructing a model based on the light field illuminating the current training sample, a random rotation value is superimposed on the light field.
[0105] On the basis of the above technical solution, the data determination unit is used to:
[0106] Based on the acquisition devices deployed on each target grid and the light field, obtaining the original image to be screened for the current training sample construction model;
[0107] Determining the original image from the original images to be screened;
[0108] The acquisition angle corresponding to the original image is determined, and at least the grid points corresponding to the acquisition angle are marked, so as to acquire the original image of each training sample construction model based on the marked target grid points.
[0109] On the basis of the above technical solution, the data determination unit is used to:
[0110] The step of assigning target stylized material parameters of at least one style type to the current training sample constructing model, and re-performing the step of sequentially adjusting acquisition parameters to obtain a style image corresponding to each original image, includes:
[0111] Each time an original image is collected, the current training sample construction model is replaced based on the corresponding paired sample construction model, and a style image is determined based on the collection parameters corresponding to the original image; or
[0112] After obtaining each original image, the current training sample construction model is replaced based on the corresponding paired sample construction model, and a style image corresponding to the corresponding original image is collected according to the collection parameters of each original image.
[0113] On the basis of the above technical solution, the model training module is also used to: for each training sample, use the original image in the current training sample, the edge pixel coordinates of the part to be rendered, and the joint point position information of the part to be rendered as the input of the special effects image conversion model to be trained, and use the corresponding style image as the output of the special effects image conversion model to be trained, so as to train and obtain the target special effects image conversion model.
[0114] Based on the above technical solutions, the part to be processed includes any part on the limbs and torso, and the arbitrary part includes at least one of the hand, head, arm and leg parts; the target stylized material parameters include decorative parameters corresponding to the rendered special effects.
[0115] The technical solution of the embodiment of the present disclosure obtains a to-be-processed image including a to-be-processed part when a triggering special effect display control is detected, processes the to-be-processed image special effects based on a target special effect image conversion model, and obtains a target special effect image. The training of the target special effect image conversion model is based on the constructed paired data, which solves the problems in the prior art of the inconvenience of constructing paired data and the poor quality of paired data, resulting in poor processing effect of the to-be-processed image by the target special effect image conversion model, and achieves the technical effect of improving the quality and richness of paired data, thereby improving the accuracy of image processing by the target special effect image conversion model.
[0116] The special effect image generation device provided in the embodiments of the present disclosure can execute the special effect image generation method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects for executing the special effect image generation method.
[0117] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0118] Example 3
[0119] Figure 3 This is a schematic diagram of the structure of an electronic device provided by the third embodiment of the present disclosure. Figure 3 , which shows an electronic device (eg Figure 3The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 3 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0120] like Figure 3 As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. Various programs and data required for the operation of the electronic device 300 are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An edit / output (I / O) interface 305 is also connected to the bus 304.
[0121] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Figure 3 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0122] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0123] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0124] The electronic device provided by the embodiment of the present disclosure and the special effect image generation method provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0125] Example 4
[0126] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the special effect image generation method provided in the above embodiment is implemented.
[0127] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0128] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0129] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0130] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0131] When the special effect display control is detected to be triggered, an image to be processed including the part to be processed is acquired;
[0132] Performing special effects processing on the image to be processed based on a target special effects graph conversion model to obtain a target special effects graph;
[0133] Among them, the part to be processed in the target special effect image is displayed as a target special effect, and the target special effect image is determined based on a pre-constructed training sample, and the training sample includes paired training data, and the paired training data includes an original image and a style image, and the style image is determined after assigning target stylized material parameters to the part to be rendered under the same acquisition conditions; the part to be rendered is adapted to the part to be processed.
[0134] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0135] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0136] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0137] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0138] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. According to one or more embodiments of the present disclosure, [Example 1] provides a method for generating a special effect image, the method comprising:
[0139] When a triggering of the special effect display control is detected, an image to be processed including the part to be processed is obtained; a special effect graph generation module is used to perform special effect processing on the image to be processed based on a target special effect graph conversion model to obtain a target special effect graph;
[0140] Among them, the part to be processed in the target special effect image is displayed as a target special effect, and the target special effect image is determined based on a pre-constructed training sample set, the training samples in the training sample set include paired training data, and the paired training data include original images and style images, and the style image is determined after assigning target stylized material parameters to the part to be rendered under the same acquisition conditions; the part to be rendered is adapted to the part to be processed.
[0141] According to one or more embodiments of the present disclosure, [Example 2] provides a method for generating a special effect image, the method comprising:
[0142] Optionally, determining paired training data in each training sample;
[0143] The to-be-trained special effect image conversion model is processed based on each training sample to obtain the target special effect image conversion model, so as to convert the to-be-processed part in the to-be-processed image into the target special effect based on the target special effect image conversion model.
[0144] According to one or more embodiments of the present disclosure, [Example 3] provides a method for generating a special effect image, the method comprising:
[0145] Optionally, determining the paired training data in each training sample includes:
[0146] Determine at least one type of training sample corresponding to the part to be rendered to construct a model;
[0147] Determining paired sample construction models corresponding to the training sample construction models based on the training sample construction models and pre-set target stylized material parameters;
[0148] Based on the training sample construction model and the corresponding paired sample construction model, paired training data in each training sample is determined.
[0149] According to one or more embodiments of the present disclosure, [Example 4] provides a method for generating a special effect image, the method comprising:
[0150] Optionally, determining at least one type of training sample corresponding to the part to be rendered to construct a model includes:
[0151] Obtaining at least one type of to-be-processed basic model corresponding to the part to be rendered, and attaching mapping information to the basic model to obtain at least one to-be-used basic model; wherein the at least one type matches the gender in the user attribute;
[0152] At least one training sample construction model is determined based on the at least one base model to be used and preset skin material parameters.
[0153] According to one or more embodiments of the present disclosure, [Example 5] provides a method for generating a special effect image, the method comprising:
[0154] Optionally, determining at least one training sample construction model based on the at least one base model to be used and preset skin material parameters includes:
[0155] For each base model to be used, binding the base model to be used with skeleton information, and binding at least one set of joint display parameters in the skeleton information, so as to retrieve corresponding joint display parameters based on operation information of the base model to be used, thereby obtaining a first model; wherein the joint display parameters correspond to the posture information of the base model to be used;
[0156] Assign at least one set of preset skin material parameters to each of the first models, and determine at least one sample to be trained to construct a model;
[0157] Each set of preset skin material parameters matches the age in the user attribute, and each set of preset skin material parameters includes at least one of blood vessel parameters, skin quality parameters, and spot information.
[0158] According to one or more embodiments of the present disclosure, [Example 6] provides a method for generating a special effect image, the method comprising:
[0159] Optionally, determining a paired sample construction model corresponding to each training sample based on the construction model of each training sample and preset target stylized material parameters includes:
[0160] For each training sample construction model, a target stylized material parameter of at least one style type is assigned to the current training sample construction model to obtain a paired sample construction model corresponding to the current training sample construction model.
[0161] According to one or more embodiments of the present disclosure, [Example 7] provides a method for generating a special effect image, the method comprising:
[0162] Optionally, determining paired training data in each training sample based on the training sample construction model and the corresponding paired sample construction model includes:
[0163] Adjusting acquisition parameters in sequence to obtain an original image corresponding to the current training sample construction model, and obtaining a style image of a paired sample construction model corresponding to the current training sample construction model under the same acquisition parameters; wherein the acquisition parameters include acquisition angle and light intensity information of the environment to which the current training sample construction model belongs;
[0164] The paired training data is determined based on the original image and the style image corresponding to the same acquisition parameters.
[0165] According to one or more embodiments of the present disclosure, [Example 8] provides a method for generating a special effect image, the method comprising:
[0166] Optionally, the step of sequentially adjusting acquisition parameters to obtain the original image corresponding to the current training sample construction model includes:
[0167] Constructing a spherical grid with the current training sample construction model as the sphere center; wherein the spherical grid includes a plurality of grid points;
[0168] Acquire an original image corresponding to the current training sample construction model based on a collection device deployed on at least one target grid point and a light field covering the spherical grid;
[0169] The at least one target grid point is a predetermined acquisition angle, and when constructing a model based on the light field illuminating the current training sample, a random rotation value is superimposed on the light field.
[0170] According to one or more embodiments of the present disclosure, [Example 9] provides a method for generating a special effect image, the method comprising:
[0171] Optionally, the at least one target grid includes all grids of the spherical grid, and the acquisition device deployed on the at least one target grid point and the light field covering the spherical grid, obtaining the original image corresponding to the current training sample construction model, includes:
[0172] Based on the acquisition devices deployed on each target grid and the light field, obtaining the original image to be screened for the current training sample construction model;
[0173] Determining the original image from the original images to be screened;
[0174] The acquisition angle corresponding to the original image is determined, and at least the grid points corresponding to the acquisition angle are marked, so as to acquire the original image of each training sample construction model based on the marked target grid points.
[0175] According to one or more embodiments of the present disclosure, [Example 10] provides a method for generating a special effect image, the method comprising:
[0176] Optionally, assigning target stylized material parameters of at least one style type to the current training sample construction model, and re-performing the sequential adjustment of acquisition parameters to obtain a style image corresponding to each original image, includes:
[0177] Each time an original image is collected, a target stylized material parameter of at least one style type is assigned to the current training sample construction model, and a style image is determined based on the collection parameters corresponding to the original image; or
[0178] After obtaining each original image, the target stylized material parameter of at least one style type is assigned to the current training sample construction model, and a style image corresponding to the corresponding original image is collected according to the collection parameters of each original image.
[0179] According to one or more embodiments of the present disclosure, [Example 11] provides a method for generating a special effect image, the method comprising:
[0180] Optionally, the processing of the to-be-trained special effects image conversion model based on each training sample to obtain the target special effects image conversion model includes:
[0181] For each training sample, the original image in the current training sample, the edge pixel coordinates of the part to be rendered, and the position information of the joint points of the part to be rendered are used as the input of the special effects image conversion model to be trained, and the corresponding style image is used as the output of the special effects image conversion model to be trained to obtain the target special effects image conversion model.
[0182] According to one or more embodiments of the present disclosure, [Example 12] provides a method for generating a special effect image, the method comprising:
[0183] Optionally, the part to be processed includes any part on the limbs and torso, and the any part includes at least one of the hand, head, arm and leg; the target stylized material parameters include decoration parameters corresponding to the rendered special effects.
[0184] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0185] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0186] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A method for generating special effects images, characterized in that: include: When the special effect display control is detected to be triggered, an image to be processed including the part to be processed is acquired; Performing special effects processing on the image to be processed based on a target special effects graph conversion model to obtain a target special effects graph; Wherein, the part to be processed in the target special effect image is displayed as a target special effect, and the target special effect image is determined based on a pre-constructed training sample, and the training sample includes paired training data, and the paired training data includes an original image and a style image, and the style image is determined after assigning target stylized material parameters to the part to be rendered under the same acquisition conditions; the part to be rendered is adapted to the part to be processed; the paired training data in each of the training samples is determined based on a training sample construction model of at least one type corresponding to the part to be rendered and the pre-set target stylized material parameters.
2. The method according to claim 1, characterized in that Also includes: Determining paired training data in each training sample; The to-be-trained special effect image conversion model is trained based on each training sample to obtain the target special effect image conversion model, so as to convert the to-be-processed part in the to-be-processed image into the target special effect based on the target special effect image conversion model.
3. The method according to claim 2, characterized in that Determining the paired training data in each training sample includes: Determine at least one type of training sample corresponding to the part to be rendered to construct a model; Determining paired sample construction models corresponding to the training sample construction models based on the training sample construction models and pre-set target stylized material parameters; Based on the training sample construction model and the corresponding paired sample construction model, paired training data in each training sample is determined.
4. The method according to claim 3, characterized in that The step of determining at least one type of training samples corresponding to the part to be rendered to construct a model includes: Obtaining at least one type of to-be-processed basic model corresponding to the part to be rendered, and attaching mapping information to the basic model to obtain at least one to-be-used basic model; wherein the at least one type matches the gender in the user attribute; At least one training sample construction model is determined based on the at least one base model to be used and preset skin material parameters.
5. The method according to claim 4, characterized in that The step of determining at least one training sample construction model based on the at least one base model to be used and preset skin material parameters includes: For each base model to be used, binding the base model to be used with skeleton information, and binding at least one set of joint display parameters in the skeleton information, so as to retrieve corresponding joint display parameters based on operation information of the base model to be used, thereby obtaining a first model; wherein the joint display parameters correspond to the posture information of the base model to be used; Assign at least one set of preset skin material parameters to each of the first models, and determine at least one sample to be trained to construct a model; Each set of preset skin material parameters matches the age in the user attribute, and each set of preset skin material parameters includes at least one of blood vessel parameters, skin quality parameters, and spot information.
6. The method according to claim 3, characterized in that The step of determining a paired sample construction model corresponding to each training sample based on the construction model of each training sample and the preset target stylized material parameters includes: For each training sample construction model, a target stylized material parameter of at least one style type is assigned to the current training sample construction model to obtain a paired sample construction model corresponding to the current training sample construction model.
7. The method according to claim 6, characterized in that The step of determining paired training data in each training sample based on the training sample construction model and the corresponding paired sample construction model includes: Adjusting acquisition parameters in sequence to obtain an original image corresponding to the current training sample construction model, and obtaining a style image of a paired sample construction model corresponding to the current training sample construction model under the same acquisition parameters; wherein the acquisition parameters include acquisition angle and light intensity information of the environment to which the current training sample construction model belongs; The paired training data is determined based on the original image and the style image corresponding to the same acquisition parameters.
8. The method according to claim 7, characterized in that The step of sequentially adjusting the acquisition parameters to obtain the original image corresponding to the current training sample construction model includes: Constructing a spherical grid with the current training sample construction model as the sphere center; wherein the spherical grid includes a plurality of grid points; Acquire an original image corresponding to the current training sample construction model based on a collection device deployed on at least one target grid point and a light field covering the spherical grid; The at least one target grid point is a predetermined acquisition angle, and when constructing a model based on the light field illuminating the current training sample, a random rotation value is superimposed on the light field.
9. The method according to claim 8, characterized in that The at least one target grid includes all grids of the spherical grid, and the acquisition device deployed on the at least one target grid point and the light field covering the spherical grid is used to obtain an original image corresponding to the current training sample construction model, including: Based on the acquisition devices deployed on each target grid and the light field, obtaining the original image to be screened for the current training sample construction model; Determining the original image from the original images to be screened; The acquisition angle corresponding to the original image is determined, and at least the grid points corresponding to the acquisition angle are marked, so as to acquire the original image of each training sample construction model based on the marked target grid points.
10. The method according to claim 6, characterized in that Also includes: Each time an original image is collected, the current training sample construction model is replaced based on the corresponding paired sample construction model, and a style image is determined based on the collection parameters corresponding to the original image; or, After obtaining each original image, the current training sample construction model is replaced based on the corresponding paired sample construction model, and a style image corresponding to the corresponding original image is collected according to the collection parameters of each original image.
11. The method according to claim 2, characterized in that The processing of the special effect image conversion model to be trained based on each training sample to obtain the target special effect image conversion model includes: For each training sample, the original image in the current training sample, the edge pixel coordinates of the part to be rendered, and the position information of the joint points of the part to be rendered are used as the input of the special effects image conversion model to be trained, and the corresponding style image is used as the output of the special effects image conversion model to be trained to obtain the target special effects image conversion model.
12. The method according to any one of claims 1 to 11, characterized in that: The part to be processed includes any part on the limbs and torso, and the any part includes at least one of the hand, head, arm and leg; the target stylized material parameters include decoration parameters corresponding to the rendered special effects.
13. A special effect image generating device, characterized in that: include: The image acquisition module to be processed is used to obtain the image to be processed including the part to be processed when the triggering of the special effect display control is detected; A special effects image generation module is used to perform special effects processing on the image to be processed based on a target special effects image conversion model to obtain a target special effects image; In which, the part to be processed in the target special effect image is displayed as a target special effect, and the target special effect image is determined based on a pre-constructed training sample set, and the training samples in the training sample set include paired training data, and the paired training data include original images and style images, and the style image is determined after assigning target stylized material parameters to the part to be rendered under the same acquisition conditions; the part to be rendered is adapted to the part to be processed; the paired training data in each of the training samples is determined based on at least one type of training sample construction model corresponding to the part to be rendered and the pre-set target stylized material parameters.
14. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the special effect image generating method according to any one of claims 1 to 12.
15. A storage medium comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to execute the special effect image generation method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Image processing method and device, equipment and medium
CN113222841A