WO2024088100A1 - 特效处理方法、装置、电子设备和存储介质 - Google Patents
特效处理方法、装置、电子设备和存储介质 Download PDFInfo
- Publication number
- WO2024088100A1 WO2024088100A1 PCT/CN2023/124826 CN2023124826W WO2024088100A1 WO 2024088100 A1 WO2024088100 A1 WO 2024088100A1 CN 2023124826 W CN2023124826 W CN 2023124826W WO 2024088100 A1 WO2024088100 A1 WO 2024088100A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- special effect
- rendering
- sample
- subject
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—Three-dimensional [3D] image rendering
- G06T15/005—General purpose rendering architectures
Definitions
- the embodiments of the present disclosure relate to special effect processing technology, and more particularly to a special effect processing method, device, electronic device and storage medium.
- the existing rendering methods have the following problems: the amount of hair rendering calculations is huge, and due to performance limitations it is difficult to achieve effective rendering of long hair special effects, which reduces the hair rendering performance; at the same time, due to the relatively diverse growth forms and materials of hair, the production cost is high, and it is difficult to achieve any designed effect; in addition, the rendering method is relatively rough, and it is impossible to achieve intricate rendering of special effect materials, which reduces the rendering effect.
- the present disclosure provides a special effect processing method, device, electronic device and storage medium to achieve fast and refined rendering of filamentary objects in special effects.
- an embodiment of the present disclosure provides a special effect processing method, the special effect processing method comprising:
- the special effect guide map includes a basic model of the special effect subject and key guide lines representing the filamentary object
- the special effect guide map is rendered to obtain and display a target special effect picture of the target special effect, wherein the target special effect picture includes a filamentous object formed after rendering the key guide line.
- the embodiments of the present disclosure further provide a special effect processing device, the special effect processing device comprising:
- a response module used to respond to a special effect triggering operation for a target special effect
- a guide map determining module used for determining a special effect guide map of the special effect subject when there is a filamentary object rendering in the special effect subject corresponding to the target special effect, wherein the special effect guide map includes a basic model of the special effect subject and key guide lines representing the filamentary object;
- a processing and display module is used to render the special effect guide map, obtain a target special effect picture of the target special effect and display it, wherein the target special effect picture includes a filamentous object formed after rendering the key guide line.
- an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
- processors one or more processors
- a storage device for storing one or more programs
- the one or more A processor implements the special effects processing method as described in any embodiment of the present disclosure.
- an embodiment of the present disclosure further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the special effects processing method as described in any embodiment of the present disclosure.
- the technical solution of the disclosed embodiment first responds to a special effect triggering operation for a target special effect; when a filamentous object is rendered in the special effect subject corresponding to the target special effect, a special effect guide map of the special effect subject is determined, the special effect guide map includes a basic model of the special effect subject and key guide lines that characterize the filamentous object; then the special effect guide map is rendered to obtain and display a target special effect screen of the target special effect, wherein the target special effect screen includes the filamentous object formed after the key guide lines are rendered.
- the technical solution of the disclosed embodiment introduces a special effect guide map, and when the triggered special effect includes the rendering of a filamentous object, a special effect guide map including the basic model information of the special effect subject and the key information of the filamentous object is first determined as a rough rendering of the special effect, and the special effect guide map can be directly rendered later to obtain a target special effect screen that realizes precise rendering of the filamentous object.
- the above-mentioned technical scheme is different from the existing rendering implementation of filamentary objects in special effects. It simplifies the rendering of filamentary objects into refined rendering based on the key guide lines of filamentary objects. While ensuring the rendering accuracy of filamentary objects, it effectively reduces the amount of rendering calculations and ensures the rendering speed of filamentary objects.
- the rendering of filamentary objects in this technical scheme mainly relies on the special effects guide map that contains the key guide lines that represent the filamentary objects.
- the process of determining the special effects guide map is simple and easy to implement, which also effectively reduces the production cost of filamentary object design and reduces the difficulty of implementing diversified designs of filamentary objects.
- FIG1 is a schematic flow chart of a special effect processing method provided by an embodiment of the present disclosure.
- FIG2a is an example diagram of effect presentation of a special effect subject including rough rendering information in a special effect processing method provided by an embodiment of the present disclosure
- FIG2b is an example diagram showing the rendering effect of a basic model and key guide lines of a special effect subject in a special effect processing method provided by an embodiment of the present disclosure
- FIG2c is an example diagram of a target special effect picture of a special effect subject in a special effect processing method provided by an embodiment of the present disclosure
- FIG3 is a schematic flow chart of another special effect processing method provided by an embodiment of the present disclosure.
- FIG4 is a schematic diagram of the structure of a special effect processing device provided by an embodiment of the present disclosure.
- FIG5 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure.
- a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information.
- the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
- the prompt information in response to receiving the user's active request, may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form.
- the pop-up window may also carry a message for the user to choose "agree” or “disagree” to send to the phone.
- Sub-devices provide selection controls for personal information.
- Figure 1 is a flow chart of a special effects processing method provided by an embodiment of the present disclosure.
- the embodiment of the present disclosure is applicable to situations where special effects processing and rendering of filamentous objects exist.
- the method can be executed by a special effects processing device, which can be implemented in the form of software and/or hardware.
- a special effects processing device which can be implemented in the form of software and/or hardware.
- an electronic device which can be a mobile terminal, a personal computer (PC) or a server, etc.
- the method of the embodiment of the present disclosure may specifically include:
- the special effects rendering processing method can be integrated in electronic devices such as mobile terminals and PC terminals.
- the electronic device can display the special effects screen accordingly.
- the special effects trigger operation can be understood as an operation for starting the special effects processing function after triggering.
- the target special effect can be understood as the special effect to be applied.
- the special effects screen in this embodiment is a three-dimensional image special effect.
- the target special effect can be a special effect to be applied and includes a special effect subject.
- the receiving of the special effect triggering operation may include but is not limited to: receiving a special effect triggering operation acting on a preset special effect triggering control, wherein the special effect triggering control may be a virtual control element provided on the application interface, for example, the virtual control element includes at least one of a special effect triggering button, a special effect triggering selection menu and a special effect triggering slider; or, receiving sound information for enabling special effects collected by a sound collection device; or, receiving action information for enabling special effects (such as hand action information, head action information or limb action information, etc.); or, receiving a special effect enabling command for enabling special effects, etc.
- the special subject of the target special effect to be applied is determined. For example, if the special effect picture of the wolf is to be displayed, the special effect picture of the wolf can be recorded as the target special effect.
- some target special effects include hair, and due to the limitations of the large number and small size of hair, real-time rendering of filamentous objects such as hair is relatively difficult.
- the technical solution provided in this embodiment is mainly used to realize how to performaki rendering of filamentous objects to obtain the special effects picture of the target special effect.
- the target special effect needs to be determined first, and then the special effect to be presented is determined based on the special effect trigger operation received for the target special effect, which should include information such as the special effect subject.
- the special effect trigger operation it is known what special effect screen is about to be presented, that is, there is a prediction of the target special effect, and based on this prediction, it is possible to extract what the special effect subject is.
- After determining the special effect subject it can be determined that the special effect subject should be based on the target special effect.
- the special effects subject is to be displayed as a target special effect, what objects are displayed and whether there are filamentary objects.
- the special effect subject can be understood as the object of the target special effect.
- the target special effect must have a special effect subject to realize or display the special effect.
- the target special effect can include but is not limited to the special effect subject.
- the target special effect can also include other special effect elements besides the special effect subject. Whether there will be a filamentary object used to constitute the special effect subject in the target special effect.
- the specific content of the target special effect is not limited.
- the target special effect includes a special effect subject, and the special effect subject includes a filamentous object.
- the target special effect can be a special effect of virtual hair composed of multiple hair strands, a special effect of a whisk composed of multiple whisk strands, or a tassel composed of multiple silk threads.
- the filamentous object is hair.
- the special effect guide map of the special effect subject needs to be further determined.
- the final effect to be achieved can be understood as the target special effect, wherein the wolf can be used as the special effect subject corresponding to the target special effect, and the wolf's hair can be understood as the special effect subject having a filamentary object that needs to be rendered, and it can be considered that the special effect subject corresponding to the target special effect has a filamentary object rendering.
- the special effect guide map includes a basic model of the special effect subject and key guide lines representing the filamentary object.
- the basic model of the special effect subject can be understood as a model of the special effect subject obtained by representing the basic parameters of the special effect subject.
- the basic model can include the contour and structure of the special effect subject. Since the special effect subject renders the filamentary object, it is necessary to have key guide lines representing the filamentary object.
- the key guide lines can be understood as the key hair, lines, etc. of the special effect subject.
- the basic model can be roughly rendered based on the rough rendering parameters to obtain the special effect guide map. According to the basic model and key guide lines and the pre-configured rough rendering parameters for the special effect body, the special effect body is roughly rendered to obtain the special effect guide map.
- the process of generating the special effect guide map of the special effect subject is equivalent to the process of rough rendering of the special effect subject, and the special effect guide map can be obtained by rough rendering of the special effect subject.
- the special effect guide map can be obtained by rough rendering of the special effect subject.
- the special effect guide map can be input into the pre-trained filamentous object rendering model to output the target special effect picture.
- a special effect guide map needs to be obtained as input information.
- the special effect guide map includes a hair guide map and a segmentation guide map.
- the hair guide map can be obtained based on the pre-set hair key guide line information combined with the basic model.
- the segmentation guide map can be obtained based on the deformation parameters, light parameters, and simulation parameters combined with the basic model.
- the deformation parameters can be the special effect subject opening its mouth and eyes wide.
- the hair guide map and the segmentation guide map together constitute the special effect guide map as the input information of the model.
- the terminal device when it performs special effect rendering, it can obtain the three-dimensional basic model of the special effect subject from the material library. For example, to achieve realistic rendering of a wolf, you must first have a three-dimensional model of a wolf. On the premise of the three-dimensional model of the wolf, combine simple materials, such as some line information, and then render the line information and the three-dimensional model to form a hair guide map.
- a segmentation map refers to the appearance of different regional features such as eyes, contours, and teeth in different colors and shapes after having the most basic model. This map is called a segmentation guide map.
- the segmentation guide map is obtained by rendering on the basic model based on some parameters.
- deformation parameters are combined with the 3D model to form a segmentation guidance map.
- the model may be a wolf model with a closed mouth.
- the deformation parameters of the wolf with an open mouth are given to the 3D model.
- the model is adjusted through these deformation parameters to achieve the wolf presenting in the form of an open mouth.
- the resulting map can be recorded as a segmentation guidance map.
- the special effect subject corresponding to the target special effect After receiving the special effect trigger operation for the target special effect, it is necessary to determine the special effect subject corresponding to the target special effect, and further determine whether there is a filamentary object rendering on the special effect subject. If there is a filamentary object rendering on the special effect subject corresponding to the target special effect, a rough rendering is performed according to parameter information, basic model, etc. to determine the special effect guide map of the special effect subject.
- this step is equivalent to accurately rendering the special effect subject on the basis of the special effect guide map.
- the original special effect guide map already contains the basic model and key guide line information, based on which the filamentous object is enriched, which can be specifically reflected in the rendering of more finer and more delicate wool on the special effect subject.
- the special effect guide map can be understood as an image obtained by roughly rendering the basic model according to the key guide line information
- the target special effect picture can be understood as a filamentous object formed by further accurately rendering the key guide lines of the special effect subject on the basis of the special effect guide map.
- the special effect guide map can reflect the display color, display form and display position of the special effect subject and the key guide lines that characterize the filamentous object. Further rendering of the special effect guide map can be understood as further rendering of the key guide lines to make the key guide lines richer and more detailed.
- the special effect guide map is rendered to obtain a target special effect screen of the target special effect.
- One implementation method may be: based on a pre-trained filament object rendering model, the special effect guide map is rendered. Input the filament object rendering model and output the target special effect screen.
- the rendering time is short and the rendering effect is good
- the original offline rendering effect is reflected in the form of a model, and the model is continuously trained to train a model that can vividly realize rendering, and the model is directly applied to the terminal.
- the trained model can be a neural network model, which needs to be obtained through training in advance, and the trained neural network model is recorded as the filamentous object rendering model.
- the specific model structure and training method of the filamentous object rendering model there is no specific restriction on the specific model structure and training method of the filamentous object rendering model. It can be understood that other objects in the special effects picture except the filamentous object can be directly reflected in the special effects guide map, and the filamentous object needs to be combined with the filamentous object rendering model to be more realistically reflected. After obtaining the target special effects picture, the target special effects picture can be displayed.
- the technical solution of the disclosed embodiment first responds to a special effect triggering operation for a target special effect; when a filamentary object is rendered in the special effect subject corresponding to the target special effect, a special effect guide map of the special effect subject is determined, the special effect guide map includes a basic model of the special effect subject and key guide lines that characterize the filamentary object; then the special effect guide map is rendered to obtain and display a target special effect screen of the target special effect, wherein the target special effect screen includes the filamentary object formed after the key guide lines are rendered.
- the technical solution of the disclosed embodiment introduces a special effect guide map, and when the triggered special effect includes the rendering of a filamentary object, a special effect guide map including the basic model information of the special effect subject and the key information of the filamentary object is first determined as a rough rendering of the special effect, and the special effect guide map can be directly rendered later to obtain a target special effect screen that realizes the precise rendering of the filamentary object.
- the above technical solution is different from the existing rendering implementation of filamentary objects in special effects, and simplifies the rendering of filamentary objects into rendering based on the key guide lines of the filamentary objects.
- the filamentary object rendering is performed reasonably, which effectively reduces the amount of rendering calculation while ensuring the rendering accuracy of the filamentary object, thereby ensuring the rendering speed of the filamentary object.
- the filamentary object rendering of the present technical solution mainly relies on the special effect guide map containing the key guide lines representing the filamentary object, and the determination process of the special effect guide map is simple and easy to implement, which also effectively reduces the production cost of the filamentary object design and reduces the difficulty of realizing the diversified design of the filamentary object.
- FIG2a is an example diagram of the effect presentation of a special effects subject including rough rendering information in a special effects processing method provided by an embodiment of the present disclosure.
- FIG2a shows the rough rendering presentation effect of the special effects subject being a wolf, which is mainly reflected in the display of morphological parameters, such as the outline of the special effects subject, the rendering of the eyes open state, the outline of the teeth outline, and the rough rendering information such as the nose shape.
- FIG2b is an example diagram of the rendering effect of the basic model and key guide lines of the special effect subject in a special effect processing method provided by an embodiment of the present disclosure.
- the figure includes a rendering composed of the basic model of the special effect subject and the key guide lines.
- the rendering can be considered to be formed by combining the rendering of the basic model and the key guide lines.
- the figure mainly includes key guide line information, which is specifically reflected in the location, length, shape and other information of the key guide lines. Combining the relevant information shown in FIG2a and FIG2b, an initial rendering can be performed to obtain a special effect guide map.
- FIG2c is an example diagram of a target special effect screen of a special effect subject in a special effect processing method provided by an embodiment of the present disclosure.
- the effect display diagram is formed after further rendering processing based on the special effect guide diagram. It can be seen that the final special effect screen not only includes the shape, hair and other effects of the special effect subject, but also enriches the hair, making the hair dense and diverse, and the effect presented is more realistic.
- FIG3 is a flow chart of another special effect processing method provided by an embodiment of the present disclosure.
- the embodiment of the present disclosure further illustrates the steps of determining the special effect guide map of the special effect subject and the steps of determining the target special effect screen.
- the method includes:
- the target special effect needs to be determined first, and the special effect to be presented is determined according to the special effect trigger operation of the received target special effect, which should include information such as the special effect subject.
- the special effect trigger operation it can be known what special effect screen is about to be presented, that is, there is a prediction of the target special effect, and based on the prediction, it can be extracted. To achieve this prediction, it is necessary to first know what the special effect subject is. After determining the special effect subject, it can be determined that the special effect subject should be displayed in the form of the target special effect.
- the special effect subject when the special effect subject is to be displayed with the target special effect, it is necessary to determine which objects are displayed and whether there are filamentary objects.
- the special effect subject is a wolf
- the current form of the special effect subject wolf can be determined, such as opening its mouth, opening its eyes, etc.
- the special effect subject when it is determined that the special effect subject is a wolf, it can be clearly known that the material properties configured for the wolf include the item of hair. That is, when the target special effect corresponding to the special effect subject is to be displayed, it is known whether the special effect displayed includes the special effect of filamentary objects.
- one of the special effects includes the special effect of filamentary objects, it is determined that there is filamentary object rendering on the special effect subject, that is, there is a special effect rendering requirement on the special effect subject.
- S340 Generate a special effect guide map of the special effect body according to key guide line information of the special effect body and a basic model, wherein the key guide line information includes a position and/or length of the key guide line.
- the key guide line information means that if there is a filamentary rendering later, it is necessary to obtain the basic or key guide line information as the filamentary information based on the filamentary rendering, that is, the line information.
- the information of the key guide line can include the length of the filamentary object presentation, the position information to be presented on the special effect subject, etc.
- the special effect guide map can be understood as an image obtained by roughly rendering the basic model according to the guide line information, which can reflect the display color, display form and display position of the special effect subject.
- generating a special effect guide map of the special effect subject according to the basic model of the special effect subject and the key guide line information includes:
- the special effect guide map is an image obtained by rough rendering. If you want to generate a special effect guide map of the special effect subject, you need to first obtain the basic model and rough rendering parameters used for three-dimensional modeling of the special effect subject.
- the rough rendering parameters include key guide line information, as well as rough rendering parameters related to attributes such as material parameters, deformation parameters, and lighting parameters.
- the key guide line information may include the presentation length of the line, the position information to be presented on the special effect subject, etc.
- the specific content of extracting key guide line information, rough rendering parameters, and basic models is related to the actual application scenario to be presented.
- these parameters required before the effect is presented are in the design stage, which can also be understood as in the special effect material collection or creation stage.
- This information can be stored in advance as known information. After determining the target special effect and the special effect subject, the data information required for this special effect can be obtained.
- these parameters can be rendered in the form of patches on the base model.
- a segmentation guide map can be obtained.
- the hair guide map can be understood as an image containing a preliminary rough rendering of a filamentous object.
- the segmentation guide map and the hair guide map are combined as the special effect guide map of the special effect body.
- the above technical solution specifies the steps of generating a special effect guide map of the special effect subject according to the basic model and key guide line information of the special effect subject.
- the basic model used for three-dimensional modeling of the special effect subject is first obtained, and the key guide line information and rough rendering parameters of the special effect subject are extracted; then the basic model is patch rendered through the rough rendering parameters and the key guide line information to obtain the special effect guide map of the special effect subject.
- the segmentation guide map is obtained by patch rendering the basic model through the rough rendering parameters
- the hair guide map is obtained by patch rendering the basic model through the key guide line information.
- the special effect guide map obtained by fusion of the segmentation guide map and the hair guide map has a better rendering effect.
- the guide line combined with the illumination white model combined with the semantic segmentation map is used as the model input.
- the key guide line information can be used as the supervision information to guide the basic model to generate hair.
- the illumination white film can introduce the information of illumination and contour, and the semantic segmentation map can improve the generation effect of edges and details. And based on the filamentous object rendering model, a more realistic embodiment of the filamentous object is realized. Support hair jitter and illumination transformation based on physical simulation. Compared with other methods of obtaining guide images, the special effect guide image in this technical solution has better rendering quality and more realistic effect, and provides a more accurate input image for the subsequent rendering of the target special effect picture.
- the filamentous object rendering model is obtained by training a predetermined guide image-rendering image sample image pair.
- the rendering time required is short and the rendering effect is good
- the model that can vividly realize rendering is trained, and the model is directly applied to the terminal.
- the trained model can be a neural network model, which needs to be obtained in advance through training, and the trained neural network model is recorded as a filamentary object rendering model.
- the filamentary object rendering model is obtained by training a predetermined guide map-rendering map sample image pair.
- the guide map-rendering map sample image pair includes a guide map sample and a rendering map sample.
- the rendering map sample can be understood as a realistic image.
- the filamentary object rendering model can be obtained.
- the target special effect screen of the target special effect generated in the above steps is displayed.
- the steps of determining the special effect guide map of the special effect subject are concretized.
- the special effect subject corresponding to the target special effect is first determined, and then it is determined whether the display object on the special effect subject contains a filamentary object. If it does, it can be determined that there is a need to render a filamentary object on the special effect subject, and further based on the key guide line information and basic model of the special effect subject, Generate a special effect guide map of the special effect subject.
- the technical solution provided by this embodiment can quickly realize the rendering of the special effect guide map, thereby improving the real-time performance of the special effect rendering.
- the training step of further optimizing the filamentous object rendering model includes:
- conditional generative adversarial network model includes: a generator and a multi-scale discriminator.
- the adversarial network concept is used to train the filamentous object rendering model.
- the initial conditional generative adversarial network model is first constructed.
- the conditional generative adversarial network model includes a generator and a discriminator.
- the generator can generate a picture based on some pre-existing information, and the discriminator determines whether the picture is a real picture or a fake picture.
- the parameters of the generator are adjusted according to the discriminated results, so that the output results of the generator are more and more realistic, and the discriminator parameters are continuously adjusted, so that the input picture can be judged more and more accurately as fake.
- the conditional generative adversarial network model in this step is an improved model, and its input information is not a multi-dimensional number, but an image.
- the discriminator of image translation is used for training.
- the strategy adopted by the discriminator of image translation is to use reconstruction to solve low-frequency components, and the generative adversarial network is used to solve high-frequency components.
- the traditional loss value is used to make the generated image as similar as possible to the training image, and the generative adversarial network is used to construct the details of the high-frequency part.
- the idea is that since the generative adversarial network is only used to construct high-frequency information, there is no need to input the entire image into the discriminator. First, it is randomly cropped within the range of the image to obtain several image blocks of different sizes to discriminate the authenticity of the image.
- a multi-scale discriminator is used, which is constructed based on three scales.
- the discriminators of the three scales are each an independent discriminator, which together constitute the multi-scale discriminator.
- the discriminator can be understood as performing three discriminations.
- the original image is input into the discriminator, it is first randomly cropped within the image range to obtain several image blocks of different sizes, and three discriminators with 3, 2, and 1 layers are maintained.
- the image will be downsampled. For example, the image is downsampled using a downsampling function.
- the 3-layer discriminator directly inputs the original image, the 2-layer discriminator inputs a 1/2-sized image, and the 1-layer discriminator inputs a 1/4-sized image.
- each layer of the discriminator has an output
- the mean of the output results corresponding to all scales of a picture is taken as the output result, and the corresponding loss value can be calculated.
- the loss value calculation can be similar to the implementation of the exchange encoder, and no specific restrictions are made here.
- the training sample set includes at least one group of sample image pairs, and each group of sample image pairs includes a sample guide image and a sample rendering image.
- the conditional generative adversarial network model can be trained based on the training sample set.
- the conditional adversarial training sample set is not random, and the sample image pairs included in the training sample set are composed of sample guide maps and sample renderings.
- the sample guide map and sample rendering in a sample image pair are rendered for the same subject.
- the sample guide map and the sample rendering can be understood as rendering the same subject to different degrees.
- the sample guide map is obtained by rough rendering, and the sample rendering is obtained by fine rendering with better effects using other engine tools.
- the sample rendering can be understood as a real image.
- the sample image pair includes a sample guidance map and a sample rendering map.
- the sample guidance map is input into the generator to obtain the output of the generator.
- the output of the generator, the sample guidance map, and the sample rendering map are then used as the input of the discriminator.
- the generated image is adjusted according to the output of the discriminator.
- the parameters of the generator and the discriminator are used to train the generator and the discriminator so that the generator and the discriminator meet the accuracy requirements, and the generator that meets the accuracy requirements after training is used as the filamentous object rendering model.
- This optional embodiment introduces a multi-scale discriminator based on the structural similarity index loss and the generative adversarial network loss, and trains the discriminator based on the above three types of scales to make the discriminator more accurate.
- the performance of hair details is improved because the input dimension is greatly reduced, so the number of parameters is small, the operation speed is faster than directly inputting one image, and it can calculate images of any size.
- step of training the generator and the multi-scale discriminator according to the sample image pair to obtain the filamentous object rendering model can be expressed as:
- the sample guidance map in the sample image pair is used as input data of the generator, and the generator can render the sample guidance map to obtain the output result of the generator.
- the output result of the generator and the sample guidance map are taken as one set of data
- the sample rendering image and the sample guidance map in the sample image pair are taken as another set of data
- the two sets of data together constitute two sets of input data of the multi-scale discriminator, which are respectively input into the multi-scale discriminator.
- the above two sets of input data are used as the input of the discriminator. As long as it runs, there will be output results. These parameters can be adjusted according to the loss results of the loss function.
- the pre-given loss function will adjust the generator parameters and the multi-scale discriminator parameters.
- the purpose of the adversarial idea in the conditional generative adversarial network model is to make the rendering generated by the generator closer to the real image, so that The discriminator will more accurately judge the authenticity of the image.
- the pre-given loss function is applied to the generator and the discriminator. The goals to be achieved by the two are different, and the results achieved by the parameters are also different. In this step, multiple loss functions are used to intervene and adjust the parameters.
- the trained generator is used as the filamentous object rendering model.
- the iteration end condition can be understood as inputting information into the generator, the output image obtained reaches the set accuracy to obtain a realistic rendered image, and the rendered image and the special effect guide image are input into the discriminator, and the discriminant result reaches the set accuracy, which can accurately distinguish the authenticity of the rendered image. If the generator and the discriminator reach the set accuracy respectively, the trained generator can be used as a filamentary object rendering model for subsequent rendering of filamentary objects.
- This optional embodiment specifies the training steps of the filament object rendering model.
- group normalization is introduced to enhance the stability of the model performance and reduce the flickering phenomenon in high-frequency scenarios such as hair rendering.
- the generator is represented by a given first network structure
- the multi-scale discriminator is represented by a given second network structure
- the loss function includes: a generative adversarial loss function, a learning-perceptual image block similarity loss function, and a random image block loss function.
- the high-resolution network structure proposed for the two-dimensional human posture estimation task is called the HRNet structure
- the U-shaped network structure is called the UNet structure.
- the first network structure can be a HRNet structure or a UNet structure. In different scenarios, these two different network structures are used respectively.
- the two structures have different characteristics.
- HRNet has a larger amount of calculation and better effect. It is suitable for scenes such as accelerated rendering and instant interaction on computers.
- the Hdnet structure is relatively complex and has more guaranteed accuracy and better authenticity, but it is not suitable for mobile terminals; UNet can be compressed to a smaller amount of calculation, which is suitable for deploying real-time versions on mobile phones.
- the model uses an image translation mode, which is essentially a conditional generative adversarial network model.
- the specific principle is as follows: Train a conditional generative adversarial network model to map the contour map to a photo.
- the discriminator learns to classify fake pictures (synthesized by the generator) and real picture groups.
- the generator learns to deceive the discriminator.
- both the generator and the discriminator observe the input contour map and the generated picture or the real picture.
- the ordinary generative adversarial network model directly inputs the generated picture or the real picture.
- This optional embodiment specifies the training steps of the filamentous object rendering model. Based on the structural similarity index loss and the generative adversarial network loss, a multi-scale discriminator is introduced, and the discriminator is trained based on the above three types of scale graphs to make the discriminator more accurate. The performance of hair details is improved. In the HRNet scenario, group normalization is introduced to enhance the stability of the model performance and reduce the flickering phenomenon in high-frequency scenarios such as hair rendering.
- sample guide image and the sample rendering image in the sample image pair are respectively determined by rendering using a predetermined rendering engine tool based on the same rendering parameters.
- rendering is performed on an offline rendering engine tool to obtain a more accurate rendering.
- the rendering parameters may include camera parameters, lighting parameters, physical parameters, etc.
- the sample guide map and the sample rendering map corresponding to the same parameters form a sample image pair.
- the wolf has its mouth open in the special effects rendering of the wolf
- the wolf in the sample guide map and the sample rendering map also has its mouth open, and the open shape is the same.
- the step of determining the sample guide image and the sample rendering image in the sample image pair includes:
- sample rendering parameters include camera parameters, lighting parameters and physical simulation deformation parameters.
- sample rendering parameters include camera parameters, lighting parameters, and physical simulation deformation parameters.
- the sample guide map and the sample rendering map in a sample image are obtained by rendering the same sample subject under the same requirements.
- the presentation forms of the two images are different, but the rendered morphological attributes are the same.
- the sample modeling model of the sample subject is patch rendered by combining the sample key guide line information of the sample subject with the sample rendering parameters, and the sample hair guide map and the sample segmentation guide map are obtained to form the sample guide map together.
- the hair guide map mainly reflects the characteristics of the filamentous objects of the sample subject in the image.
- the segmentation guide map presents the morphology, deformation, regional position, light parameters and other contents of the sample subject.
- offline rendering is performed on the sample modeling model using the sample rendering parameters to obtain a sample rendering image of the sample body.
- the given offline rendering engine tool can be a rendering engine function.
- the sample modeling model is rendered offline through the sample rendering parameters, and rendered on the offline rendering engine tool. Some parameters are configured on the offline rendering engine tool.
- the special effects based on the tool rendering can achieve a more realistic and lifelike rendering image as the sample rendering image of the sample body.
- the above technical solution takes a relatively long time to implement in order to achieve accurate image rendering. It is relatively long and cannot be achieved in real time. In this step, time is exchanged for rendering effect, and a traditional graphics rendering algorithm is used to generate an accurate sample rendering image.
- the sample image pairs generated based on this technical solution are used to train a neural network model to obtain a filamentary object rendering model, which can be directly applied to the terminal device to achieve a real-time filamentary object rendering function with better rendering effect, thereby improving the performance of special effects rendering involving filamentary objects.
- FIG4 is a schematic diagram of the structure of a special effect processing device provided by an embodiment of the present disclosure. As shown in FIG4 , the device includes: a response module 410 , a guide map determination module 420 , and a processing and display module 430 .
- the response module 410 is used to respond to the special effect trigger operation for the target special effect;
- the guide map determination module 420 is used to determine the special effect guide map of the special effect body when there is a filamentary object rendering in the special effect body corresponding to the target special effect, and the special effect guide map includes the basic model of the special effect body and the key guide lines representing the filamentary objects;
- the processing and display module 430 is used to render the special effect guide map, obtain the target special effect picture of the target special effect and display it, wherein the target special effect picture includes the filamentary objects formed after rendering the key guide lines.
- the technical solution of the disclosed embodiment first responds to a special effect triggering operation for a target special effect; when a filamentous object is rendered in the special effect subject corresponding to the target special effect, a special effect guide map of the special effect subject is determined, wherein the special effect guide map includes a basic model of the special effect subject and key guide lines representing the filamentous object; the special effect guide map is then rendered to obtain and display a target special effect screen of the target special effect, wherein the target special effect screen includes the filamentous object formed after the key guide lines are rendered.
- the technical solution of the disclosed embodiment introduces a special effect guide map, which can first determine a special effect guide map including basic model information of the special effect subject and key information of the filamentous object as a rough rendering of the special effect when the triggered special effect includes rendering of a filamentous object.
- the special effect guide map can then be directly rendered to obtain a real special effect.
- the target special effects screen with precise rendering of filamentary objects is realized.
- the rendering of filamentary objects in this technical solution mainly depends on the special effects guide map containing the key guide lines representing the filamentary objects.
- the determination process of the special effects guide map is simple and easy to implement, which also effectively reduces the production cost of filamentary object design and reduces the difficulty of implementing diversified design of filamentary objects.
- the guide map determination module 420 specifically includes:
- a first determining unit used to determine a special effect subject corresponding to the target special effect
- a second determining unit configured to determine whether a filamentary object is rendered on the special effect body if the display object of the special effect body includes a filamentary object
- the guide map generating unit is used to generate a special effect guide map of the special effect body according to the key guide line information and the basic model of the special effect body.
- the guide graph generating unit is specifically used for:
- the basic model is subjected to patch rendering through the rough rendering parameters and key guide line information to obtain a special effect guide map of the special effect subject.
- processing and display module 430 is specifically configured to:
- a target special effect screen of the target special effect is displayed.
- the device further includes a model training module, and the model training module specifically includes:
- An initial construction unit used to construct an initial conditional generative adversarial network model, wherein the conditional generative adversarial network model includes: a generator and a multi-scale discriminator;
- a sample acquisition unit used to acquire a training sample set, wherein the training sample set includes at least one group of sample image pairs, each group of sample image pairs includes a sample guide image and a sample rendering image;
- a training unit is used to train the generator and the multi-scale discriminator according to the sample image pair to obtain the filamentous object rendering model.
- training unit specifically can be used for:
- the trained generator is used as the filamentous object rendering model.
- the generator is represented by a given first network structure
- the multi-scale discriminator is represented by a given second network structure
- the loss functions include: generating adversarial loss function, learning perceptual image block similarity loss function and random image block loss function.
- sample guide image and the sample rendering image in the sample image pair are respectively determined by rendering using a predetermined rendering engine tool based on the same rendering parameters.
- the filamentous object is hair.
- the special effects processing device provided in the embodiments of the present disclosure can execute the special effects processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
- FIG5 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure.
- a schematic diagram of the structure of an electronic device e.g., a terminal device or server in FIG5
- the terminal device in the embodiment 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), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc.
- the electronic device shown in FIG5 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
- the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503.
- a processing device 501 e.g., a central processing unit, a graphics processing unit, etc.
- RAM random access memory
- Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503.
- the processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504.
- An edit/output (I/O) interface 505 is also connected to the bus 504.
- an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.
- an input device 506 including, for example, an LCD
- Output device 507 such as display (LCD), speaker, vibrator, etc.
- storage device 508 such as magnetic tape, hard disk, etc.
- communication device 509 can allow electronic device 500 to communicate with other devices wirelessly or by wire to exchange data.
- FIG. 5 shows electronic device 500 with various devices, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or provided instead.
- 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 contains program code for executing the method shown in the flowchart.
- the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502.
- the processing device 501 the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
- the electronic device provided by the embodiment of the present disclosure and the special effects processing method provided by the above embodiment belong to the same inventive concept.
- the technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
- the embodiments of the present disclosure provide a computer storage medium on which a computer program is stored.
- the program is executed by a processor, the special effect processing method provided by the above embodiments is implemented.
- the computer-readable medium of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two.
- More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
- a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device or device.
- a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof.
- a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program used by or in conjunction with an instruction execution system, device, or device.
- the program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
- the client and server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network).
- HTTP HyperText Transfer Protocol
- 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.
- the computer readable medium may be included in the electronic device or may exist independently. It is not installed in the electronic device.
- the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: responds to a special effect triggering operation for a target special effect;
- the special effect guide map includes a basic model of the special effect subject and key guide lines representing the filamentary object
- the special effect guide map is rendered to obtain and display a target special effect picture of the target special effect, wherein the target special effect picture includes a filamentous object formed after rendering the key guide line.
- 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 separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server.
- 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).
- LAN local area network
- WAN wide area network
- Internet service provider e.g., AT&T, MCI, Sprint, EarthLink, MSN, GTE, etc.
- each box in the flowchart or block diagram may represent a module, a program segment, or a portion of code, which contains one or more executable instructions for implementing the specified logical functions.
- the functions marked in the boxes may also be different from those in the accompanying drawings. For example, two boxes shown in succession may actually be executed substantially in parallel, or they may sometimes be executed in the opposite order, depending on the functions involved.
- each box in the block diagram and/or flow chart, and the combination of boxes in the block diagram and/or flow chart may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
- the units involved in the embodiments described in the present disclosure may be implemented by software or hardware.
- the name of a unit does not limit the unit itself in some cases.
- the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
- exemplary types of hardware logic components 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.
- FPGAs field programmable gate arrays
- ASICs application specific integrated circuits
- ASSPs application specific standard products
- SOCs systems on chip
- CPLDs complex programmable logic devices
- 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, device, or equipment.
- 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, device, or equipment, or any suitable combination of the foregoing.
- a more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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.
- RAM random access memory
- ROM read-only memory
- EPROM or flash memory erasable programmable read-only memory
- CD-ROM portable compact disk read-only memory
- CD-ROM compact disk read-only memory
- magnetic storage device or any suitable combination of the foregoing.
- Example 1 provides a special effect processing method, the method comprising:
- the special effect guide map includes a basic model of the special effect subject and key guide lines representing the filamentary object
- the special effect guide map is rendered to obtain and display a target special effect picture of the target special effect, wherein the target special effect picture includes a filamentous object formed after rendering the key guide line.
- Example 2 provides a special effect processing method, the method comprising:
- determining the special effect guide graph of the special effect body includes:
- the display object of the special effect body includes a filamentary object, determining that there is a filamentary object rendering on the special effect body;
- a special effect guide map of the special effect body is generated according to the key guide line information of the special effect body and the basic model, wherein the key guide line information includes the position and/or length of the key guide line.
- Example 3 provides a special effect processing method, the method comprising:
- generating a special effect guide map of the special effect subject according to the basic model and key guide line information of the special effect subject includes:
- the basic model is subjected to patch rendering through the rough rendering parameters and key guide line information to obtain a special effect guide map of the special effect subject.
- Example 4 provides a special effect processing method, the method comprising:
- the rendering of the special effect guide graph to obtain and display a target special effect picture of the target special effect includes:
- a target special effect screen of the target special effect is displayed.
- Example 5 provides a special effect processing method, the method comprising:
- the training step of the filamentous object rendering model includes:
- conditional generative adversarial network model includes: a generator and a multi-scale discriminator
- the training sample set includes at least one group of sample image pairs, and each group of sample image pairs includes a sample guide image and a sample rendering image;
- the generator and the multi-scale discriminator are trained according to the sample image pairs to obtain the filamentous object rendering model.
- Example 6 provides a special effect processing method, the method comprising:
- the generator and the multi-scale discriminator are trained according to the sample image pair to obtain Obtaining the filamentous object rendering model, comprising:
- the trained generator is used as the filamentous object rendering model.
- Example 7 provides a special effect processing method, the method comprising:
- the generator is represented by a given first network structure
- the multi-scale discriminator is represented by a given second network structure
- the loss functions include: generating adversarial loss function, learning perceptual image block similarity loss function and random image block loss function.
- Example 8 provides a special effect processing method, the method comprising:
- sample guide image and the sample rendering image in the sample image pair are respectively determined by rendering using a predetermined rendering engine tool based on the same rendering parameters.
- Example 9 provides a special effect processing method, the method comprising:
- the step of determining the sample guide image and the sample rendering image in the sample image pair includes:
- sample rendering parameters include Camera parameters, lighting parameters, and physical simulation deformation parameters
- sample key guide line information of the sample body By combining the sample key guide line information of the sample body with the sample rendering parameters, performing patch rendering on the sample modeling model of the sample body to obtain a sample guide map of the sample body;
- the sample modeling model is rendered offline using the sample rendering parameters to obtain a sample rendering image of the sample body.
- Example 10 provides a special effect processing method, the method comprising:
- the filamentous object is hair.
- Example 11 provides a special effect processing device, the device comprising:
- a response module used to respond to a special effect triggering operation for a target special effect
- a guide map determining module used for determining a special effect guide map of the special effect subject when there is a filamentary object rendering in the special effect subject corresponding to the target special effect, wherein the special effect guide map includes a basic model of the special effect subject and key guide lines representing the filamentary object;
- a processing and display module is used to render the special effect guide map, obtain a target special effect picture of the target special effect and display it, wherein the target special effect picture includes a filamentous object formed after rendering the key guide line.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
本公开实施例提供了一种特效处理方法、装置、电子设备和存储介质。该方法包括:响应于针对目标特效的特效触发操作;当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线;对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。利用该方法,将对丝状对象的渲染简化为基于丝状对象的关键引导线进行精致渲染,在保证丝状对象渲染精度的同时,有效减少了渲染计算量,保证了丝状对象的渲染速度;同时,也有效降低了制作成本,降低了丝状对象多样化设计的实现难度。
Description
相关申请的交叉引用
本申请要求于2022年10月25日提交的申请号202211314027.9的中国专利的权益。以上申请的全部教导通过引用并入本文。
本公开实施例涉及特效处理技术,尤其涉及一种特效处理方法、装置、电子设备和存储介质。
在当今社会中,越来越多的用户采用图像特效来展示图像,以通过图像特效可以生动形象的展示图像内容,提高图像的表现能力,使图像更加逼真。
在实际应用中,因为受限于毛发数量多、体积小等特点,进行毛发等丝状对象的实时渲染相对困难,现有采用的多面片渲染形式,需要保证多个面片距离足够近。
然而,现有渲染方式存在下述问题:毛发渲染计算量巨大,由于性能限制很难实现长毛特效的有效渲染,降低了毛发渲染性能;同时,由于毛发的生长形态、材质相对多样化,使得制作成本较高,很难达到任意设计的效果;此外渲染手段较为粗糙,无法实现特效材质的精致渲染,降低了渲染效果。
发明内容
本公开提供一种特效处理方法、装置、电子设备和存储介质,以实现对特效中丝状对象的快速精致渲染。
第一方面,本公开实施例提供了一种特效处理方法,该特效处理方法包括:
响应于针对目标特效的特效触发操作;
当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线;
对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。
第二方面,本公开实施例还提供了一种特效处理装置,该特效处理装置包括:
响应模块,用于响应于针对目标特效的特效触发操作;
引导图确定模块,用于当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线;
处理显示模块,用于对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。
第三方面,本公开实施例还提供了一种电子设备,所述电子设备包括:
一个或多个处理器;
存储装置,用于存储一个或多个程序,
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多
个处理器实现如本公开任一实施例所述的特效处理方法。
第四方面,本公开实施例还提供了一种包含计算机可执行指令的存储介质,其特征在于,所述计算机可执行指令在由计算机处理器执行时用于执行如本公开任一实施例所述的特效处理方法。
本公开实施例的技术方案,先响应于针对目标特效的特效触发操作;当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线;然后对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。本公开实施例的技术方案,引入了特效引导图,可以在所触发的特效包含丝状对象渲染时,首先确定出包含特效主体基础模型信息以及丝状对象关键信息的特效引导图,作为特效的粗渲染,后续可直接对特效引导图进行渲染,获得实现丝状对象精确渲染的目标特效画面。上述技术方案,区别于现有对特效中丝状对象的渲染实现,将对丝状对象的渲染简化为基于丝状对象的关键引导线进行精致渲染,在保证丝状对象渲染精度的同时,有效减少了渲染计算量,保证了丝状对象的渲染速度;同时,本技术方案的丝状对象渲染主要依赖于包含表征丝状对象关键引导线的特效引导图,而特效引导图的确定过程简单易实现,也有效降低了丝状对象设计的制作成本,降低了丝状对象多样化设计的实现难度。
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、
优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。
图1为本公开实施例所提供的一种特效处理方法的流程示意图;
图2a为本公开实施例所提供的一种特效处理方法中关于特效主体包含粗渲染信息的效果呈现示例图;
图2b为本公开实施例所提供的一种特效处理方法中关于特效主体的基础模型和关键引导线渲染的效果呈现示例图;
图2c为本公开实施例所提供的一种特效处理方法中关于特效主体的目标特效画面的示例图;
图3为本公开实施例所提供的另一种特效处理方法的流程示意图;
图4为本公开实施例所提供的一种特效处理装置结构示意图;
图5为本公开实施例所提供的一种电子设备的结构示意图。
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
可以理解的是,在使用本公开各实施例公开的技术方案之前,均应当依据相关法律法规通过恰当的方式对本公开所涉及个人信息的类型、使用范围、使用场景等告知用户并获得用户的授权。
例如,在响应于接收到用户的主动请求时,向用户发送提示信息,以明确地提示用户,其请求执行的操作将需要获取和使用到用户的个人信息。从而,使得用户可以根据提示信息来自主地选择是否向执行本公开技术方案的操作的电子设备、应用程序、服务器或存储介质等软件或硬件提供个人信息。
作为一种可选的但非限定性的实现方式,响应于接收到用户的主动请求,向用户发送提示信息的方式例如可以是弹窗的方式,弹窗中可以以文字的方式呈现提示信息。此外,弹窗中还可以承载供用户选择“同意”或者“不同意”向电
子设备提供个人信息的选择控件。
可以理解的是,上述通知和获取用户授权过程仅是示意性的,不对本公开的实现方式构成限定,其它满足相关法律法规的方式也可应用于本公开的实现方式中。
可以理解的是,本技术方案所涉及的数据(包括但不限于数据本身、数据的获取或使用)应当遵循相应法律法规及相关规定的要求。
图1为本公开实施例所提供的一种特效处理方法流程示意图,本公开实施例适用于存在丝状对象特效处理渲染的情形,该方法可以由特效处理装置来执行,该装置可以通过软件和/或硬件的形式实现,可选的,通过电子设备来实现,该电子设备可以是移动终端、个人计算机(Personal Computer,PC)端或服务器等。
如图1所示,本公开实施例的方法具体可包括:
S110、响应于针对目标特效的特效触发操作。
可以清楚的是,越来越多的用户采用图像特效来展示图像,以通过图像特效可以生动形象的展示图像内容,提高图像的表现能力,使图像更加逼真。特效渲染处理方法可以集成在移动终端、PC端等电子设备中,当接收到特效触发操作时,电子设备可以将特效画面进行相应的展示。其中,特效触发操作可以理解为用于触发后启动特效处理这一功能的操作。目标特效可以理解为待应用的特效。优选的,本实施例中的特效画面为三维图像特效。具体的,目标特效可以是待应用的且包括特效主体的特效。
在本公开实施例中,响应于特效处理操作之前,还可以包括:接收针对目
标特效的特效触发操作。特效触发操作的触发方式可以有多种。可选地,所述接收特效触发操作可以包括但不仅限于:接收作用于预设的特效触发控件的特效触发操作,其中,特效触发控件可以是设置于应用程序界面上的虚拟控制元件,例如虚拟控制元件至少包括特效触发按钮、特效触发选择菜单和特效触发滑块至少一种;或者,接收基于声音采集装置采集的用于启用特效的声音信息;又或者,接收用于启用特效的动作信息(如手部动作信息、头部动作信息或肢体动作信息等);亦或者,接收用于启用特效的特效启用命令等。
具体的,响应于针对目标特效的特效触发操作,确定待应用目标特效的特主体。示例性的,想要实现狼的特效画面的展示,则狼的特效画面可以记为目标特效。
S120、当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线。
考虑到在实际应用中,有的目标特效中包含有毛发,因为受限于毛发数量多、体积小等特点,进行毛发等丝状对象的实时渲染相对困难,本实施例提供的技术方案主要用来实现如何对丝状对象进行精致渲染,以得到目标特效的特效画面。
在本实施例中,需要先确定出目标特效,根据接收到的目标特效的特效触发操作,确定想要呈现的特效到底是怎样的,其中应该包含特效主体等信息。当进行特效触发操作时,可以知道即将要呈现的是一个什么特效画面,也就是对目标特效是有一个预判的,基于该预判能够提取出来要达到这个预判需要先清楚特效主体是什么。确定特效主体之后,可以确定特效主体要以目标特效的
形式进行展示。同样,根据特效主体要以目标特效进行展示时,展示的对象都包括哪些,是否存在丝状对象。
其中,特效主体可以理解为目标特效作用的对象。目标特效中得有一个要实现或者要展示特效的特效主体,换言之,目标特效可以包括但不仅限于包括特效主体。目标特效还可以包括除特效主体之外的其他特效元素。目标特效中是否将存在用于组成特效主体的丝状对象。
需要说明的是,在本公开实施例中,并不对目标特效的具体内容进行限定。只要目标特效中包括特效主体,且特效主体包括丝状对象即可。示例性地,目标特效可以是包含有多根发丝组成的虚拟头发的特效、包含有多根拂尘丝组成的拂尘的特效或者包含有多根丝线组成的流苏等。优选的,所述丝状对象为毛发。
需要知道的是,在响应于针对目标特效的特效触发操作之后,还需要确定特效主体上是否存在丝状对象渲染。当存在丝状对象渲染需求时,要进一步确定特效主体的特效引导图。示例性的,若渲染后的画面中需要呈现狼的逼真三维渲染图,则该想要实现的最终效果可以理解为目标特效,其中,狼可以作为目标特效所对应的特效主体,狼的毛发可以理解为是特效主体存在丝状对象需要渲染,可以认为目标特效所对应特效主体存在丝状对象渲染。
在本实施例中,特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线。其中,特效主体的基础模型可以理解为由表征特效主体基础参数获得的特效主体的模型,例如,基础模型可以包括特效主体的轮廓、结构等。由于特效主体存在对丝状对象的渲染,因此,需要有表征丝状对象的关键引导线,示例性的,关键引导线可以理解为特效主体的关键毛发、线条等粗渲染得
到的引导线。在获取基础模型和关键引导线的情况下,可以在此基础上结合粗渲染参数对基础模型进行粗渲染,得到特效引导图。根据基础模型和关键引导线以及对特效主体预先配置的粗渲染参数,对特效主体进行了粗渲染,获得了特效引导图。
其中,生成特效主体的特效引导图的过程相当于对特效主体进行粗渲染的过程,通过对特效主体的粗渲染可以得到特效引导图。需要知道的是,当接收到特效触发操作时,在终端设备上是能够快速实时对特效主体进行粗渲染,可以快速得到特效引导图。在本实施例中,当目标特效中存在丝状对象渲染需求时,可以将特效引导图输入预先训练的丝状对象渲染模型,输出目标特效画面。在对模型输入之前,需要先得到一个特效引导图作为输入信息。特效引导图包括毛发引导图和分割引导图。其中,毛发引导图可以根据预先设置好的毛发关键引导线信息结合基础模型得到。分割引导图可以基于形变参数、光参数、仿真参数结合基础模型得到。示例性的,假设特效主体是狼,形变参数可以是特效主体张大嘴巴,睁大眼睛等。毛发引导图和分割引导图共同构成特效引导图,作为模型的输入信息。
本实施例中,当终端设备进行特效渲染的时候,能够从素材库中获取特效主体的三维基础模型。例如,要实现一个狼的真实渲染,先要有一个狼的三维模型,在狼的三维模型的前提下结合简单的材质,如一些线条的信息,然后将线条信息和三维模型渲染后形成毛发引导图。同样的,分割图是指在有了最基础的模型后,眼睛、轮廓、牙齿等不同区域特征以不同颜色、形态呈现出来,该图称为分割引导图。该分割引导图是基于一些参数在基础模型上进行渲染得到的。在获取三维模型后,还可以根据其他参数信息,比如要知道牙的位置在
哪里,牙以什么样的形态呈现,将这些形变参数结合三维模型,形成分割引导图。假设想要形成狼张着嘴巴的画面,模型可能是闭着嘴巴的狼模型,将狼张着嘴巴的形变参数给到三维模型,通过这些形变参数对模型进行调整,实现狼以张着嘴巴的形式呈现,形成的图可以记为分割引导图。
具体的,在接收到针对目标特效的特效触发操作后,需要确定目标特效对应的特效主体,并进一步确定特效主体是否存在丝状对象渲染。若目标特效所对应特效主体上存在丝状对象渲染时,根据参数信息、基础模型等进行粗渲染确定特效主体的特效引导图。
S130、对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。
在本实施例中,本步骤相当于在特效引导图的基础上对特效主体进行精确渲染。原始特效引导图中已经包含了基础模型以及关键引导线信息,基于此再对丝状对象进行丰富化,具体可以体现以更多更细密更细致的毛线在特效主体上进行渲染。特效引导图可以理解为根据关键引导线信息对基础模型进行粗渲染得到的图像,目标特效画面可以理解为在特效引导图的基础上,包含对特效主体的关键引导线进行进一步精确渲染形成的丝状对象。示例性的,特效引导图可以体现特效主体的显示颜色、显示形态和显示位置以及表征丝状对象的关键引导线。对特效引导图进行进一步渲染,可以理解为对关键引导线进一步渲染,使关键引导线更加丰富细密。
示例性的,对所述特效引导图进行渲染处理,获得目标特效的目标特效画面一种实现方式可以是:基于预先训练好的丝状对象渲染模型,将特效引导图
输入丝状对象渲染模型,输出目标特效画面。当有目标特效中存在丝状对象渲染需求时,为了能够实时快速的渲染出特效画面,渲染所需时间短、渲染效果好,通过将原本离线做到的渲染效果很好的方式,以一个模型的形式进行体现,通过对该模型进行不断的训练,训练出能够很生动实现渲染的模型,将该模型直接应用在终端上。
示例性的,当有丝状对象渲染需求时将一些信息直接输入该训练好的模型中,就可以得到想要的特效画面。本实施例中,该训练的模型可以为神经网络模型,需要预先通过训练得到,将训练好的神经网络模型记为丝状对象渲染模型。本实施例中,对丝状对象渲染模型的具体模型结构以及训练方式不作具体限制。可以理解的是,特效画面中除丝状对象外的其他对象是可以通过直接在特效引导图中体现的,对于丝状对象需要结合丝状对象渲染模型更真实的体现出来。在获取目标特效画面后,可以将目标特效画面进行显示。
本公开实施例的技术方案,先响应于针对目标特效的特效触发操作;当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线;然后对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。本公开实施例的技术方案,引入了特效引导图,可以在所触发的特效包含丝状对象渲染时,首先确定出包含特效主体基础模型信息以及丝状对象关键信息的特效引导图,作为特效的粗渲染,后续可直接对特效引导图进行渲染,获得实现丝状对象精确渲染的目标特效画面。上述技术方案,区别于现有对特效中丝状对象的渲染实现,将对丝状对象的渲染简化为基于丝状对象的关键引导线进
行精致渲染,在保证丝状对象渲染精度的同时,有效减少了渲染计算量,保证了丝状对象的渲染速度;同时,本技术方案的丝状对象渲染主要依赖于包含表征丝状对象关键引导线的特效引导图,而特效引导图的确定过程简单易实现,也有效降低了丝状对象设计的制作成本,降低了丝状对象多样化设计的实现难度。
示例性的,为了更清楚的表述本公开实施例提供的特效处理方法,下述为特效处理流程的具体实现。图2a为本公开实施例所提供的一种特效处理方法中关于特效主体包含粗渲染信息的效果呈现示例图。如图2a所示,可以看出,图2a中展示了特效主体为狼的粗渲染呈现效果,主要体现在形态参数的展示,如特效主体的轮廓、眼睛睁开状态的渲染,牙齿轮廓的勾勒以及鼻子形态等粗渲染信息。
图2b为本公开实施例所提供的一种特效处理方法中关于特效主体的基础模型和关键引导线渲染的效果呈现示例图。如图2b所示,图中包含了特效主体的基础模型和关键引导线所构成的效果图,该效果图可以认为是结合基础模型和关键引导线的渲染就可以形成的。该图中主要包含了关键引导线信息,具体体现为关键引导线所在位置、长度、形状等信息。结合图2a和2b所示包含的相关信息可以进行初渲染获得一个特效引导图,
图2c为本公开实施例所提供的一种特效处理方法中关于特效主体的目标特效画面的示例图。如图2c所示,在特效引导图的基础上再进一步渲染处理后所形成的效果展示图。可以看出,最终形成的特效画面中不仅包含特效主体的形态、毛发等效果,还对毛发进行了丰富,毛发浓密且多样,所呈现的效果更为逼真。
图3为本公开实施例所提供的另一种特效处理方法流程示意图,本公开实施例对所述特效主体的特效引导图的确定步骤以及目标特效画面的确定步骤进一步说明,如图3所示,所述方法包括:
S310、响应于针对目标特效的特效触发操作。
S320、确定所述目标特效对应的特效主体。
在本实施例中,需要先确定出目标特效,根据接收到的目标特效的特效触发操作,确定想要呈现的特效到底是怎样的,其中应该包含特效主体等信息。当进行特效触发操作时,可以知道即将要呈现的是一个什么特效画面,也就是对目标特效是有一个预判的,基于该预判能够提取出来要达到这个预判需要先清楚特效主体是什么。确定特效主体之后,可以确定特效主体要以目标特效的形式进行展示。
S330、如果所述特效主体的展示对象中包括丝状对象,则确定所述特效主体上存在丝状对象渲染。
本步骤中,根据特效主体要以目标特效进行展示时,需要确定展示的对象都包括哪些,是否存在丝状对象。示例性的,若特效主体是狼,就可以确定特效主体狼呈现出来的当前形态,如张开嘴巴、睁大眼睛等。另外,当确定特效主体是狼时,就可以清楚的知道对狼所配置的材质属性里面就有毛发这一项。即,要展示特效主体所对应的目标特效时,就知道展示的特效中是否包含丝状对象这一特效,当其中一个特效包含丝状对象这一特效时,确定特效主体上存在丝状对象渲染,即特效主体上存在特效渲染需求。
S340、根据所述特效主体的关键引导线信息及基础模型,生成所述特效主体的特效引导图,所述关键引导线信息包括所述关键引导线的位置和/或长度。
在本实施例中,当确定特效主体上存在丝状对象渲染时,即当存在丝状对象渲染需求时,需要根据特效主体的关键引导线信息及基础模型,生成特效主体的特效引导图。要得到特效引导图,就需要获取关键引导线信息和基础模型。其中,基础模型是指不同的特效主体进行渲染时需要以三维的形式进行呈现的模型,此处需要一个基础的三维模型。关键引导线信息是指后续要有丝状渲染的话,需要获取基础的或关键的引导线信息作为丝状渲染的基础的丝状信息,即线的信息。关键引导线的信息可以包括丝状对象呈现长度,要呈现在特效主体上位置信息等。特效引导图可以理解为根据引导线信息对基础模型进行粗渲染得到的图像,可以体现特效主体的显示颜色、显示形态和显示位置等信息。
进一步的,根据所述特效主体的基础模型及关键引导线信息,生成所述特效主体的特效引导图,包括:
a1)获取所述特效主体用于三维建模的基础模型,并提取相对所述特效主体预先设定的关键引导线信息以及粗渲染参数。
可以理解的是,特效引导图是粗渲染得到的图像,想要生成特效主体的特效引导图,需要先获取特效主体用于三维建模的基础模型和粗渲染参数。粗渲染参数包括关键引导线信息,以及材质参数、形变参数、光照参数等属性相关的粗渲染参数。关键引导线信息可以包括线的呈现长度,要呈现在特效主体上位置信息等。提取关键引导线信息以及粗渲染参数、基础模型的具体内容与实际要展现的应用场景有关。例如,在移动端或者用户端想要进行特效效果的呈现,效果呈现之前所需的这些参数在设计阶段,也可以理解为在特效素材收集或者创建阶段,这些信息可以作为一个已知信息预先存储起来。当确定目标特效以及特效主体后,可以获取针对于这个特效所需要的数据信息。
b1)通过所述粗渲染参数及关键引导线信息,对所述基础模型进行贴片渲染,获得所述特效主体的特效引导图。
具体的,当有了上述参数之后,可以在基础模型上以贴片的形式把这些参数进行渲染出来。根据粗渲染参数以及基础模型,可以得到分割引导图。例如,粗渲染里有一个形变,可以基于形变的位置信息实现模型位置的调整。根据关键引导线信息以及基础模型,可以得到毛发引导图。毛发引导图可以理解为包含对丝状对象进行初步粗渲染的图像。将分割引导图和毛发引导图组合作为特效主体的特效引导图。
上述技术方案具体化了根据所述特效主体的基础模型及关键引导线信息,生成特效主体的特效引导图的步骤。当确定存在丝状对象渲染需求时,先获取特效主体用于三维建模的基础模型,并提取特效主体的关键引导线信息以及粗渲染参数;然后通过粗渲染参数及关键引导线信息,对基础模型进行贴片渲染,获得特效主体的特效引导图。通过粗渲染参数对基础模型进行贴片渲染得到分割引导图,通过关键引导线信息对基础模型进行贴片渲染得到毛发引导图,利用分割引导图和毛发引导图融合得到的特效引导图渲染效果较好,采用引导线结合光照白模结合语义分割图作为模型输入,关键引导线信息可以作为监督信息引导基础模型进行发丝的生成,光照白膜可以引入光照和轮廓的信息,语义分割图可以提升边缘和细节的生成效果。并基于丝状对象渲染模型实现丝状对象的更真实的体现。支持基于物理仿真的毛发抖动和光照变换。相比于其他方式得到引导图,本技术方案中的特效引导图渲染质量更佳、效果更逼真。为后续目标特效画面的渲染提供的更为精准的输入图像。
S350、将所述特效引导图输入预先训练的丝状对象渲染模型,输出目标特
效画面,所述丝状对象渲染模型通过预先确定的引导图-渲染图样本图像对训练获得。
在本实施例中,当有目标特效中存在丝状对象渲染需求时,为了能够实时快速的渲染出特效画面,渲染所需时间短、渲染效果好,通过将原本离线做到的渲染效果很好的方式,以一个模型的形式进行体现,通过对该模型进行不断的训练,训练出能够很生动实现渲染的模型,将该模型直接应用在终端上。当有丝状对象渲染需求时将一些信息直接输入该训练好的模型中,就可以得到想要的特效画面。本实施例中,该训练的模型可以为神经网络模型,需要预先通过训练得到,将训练好的神经网络模型记为丝状对象渲染模型。
需要知道的是,丝状对象渲染模型通过预先确定的引导图-渲染图样本图像对训练获得。引导图-渲染图样本图像对中包括引导图样本和渲染图样本,渲染图样本可以理解为逼真图,通过将引导图样本输入至神经网络模型中,并结合渲染图样本,可以得到丝状对象渲染模型。本实施例中,对丝状对象渲染模型的训练方式不作具体限制。可以理解的是,特效画面中除丝状对象外的其他对象是可以通过直接在特效引导图中体现的,对于丝状对象需要结合丝状对象渲染模型更真实的体现出来。
S360、显示所述目标特效的目标特效画面。
具体的,将上述步骤生成的目标特效的目标特效画面进行显示。
在本公开实施例中,具体化了特效主体的特效引导图的确定步骤。当接收到针对目标特效的特效触发操作时,先确定目标特效对应的特效主体,然后确定特效主体上的展示对象是否包含丝状对象,若包含则可以确定特效主体上存在丝状对象渲染需求,并进一步根据特效主体的关键引导线信息及基础模型,
生成所述特效主体的特效引导图。本实施例提供的技术方案可以快速实现特效引导图的渲染,提高了特效渲染的实时性。
作为本公开实施例的可选实施例,在上述实施例的基础上,进一步优化所述丝状对象渲染模型的训练步骤包括:
a2)构建初始的条件生成对抗网络模型,所述条件生成对抗网络模型包括:生成器以及多尺度判别器。
在本实施例中,利用对抗网络思想,在对丝状对象渲染模型进行训练的时候采用的是条件生成对抗网络思想,先构建出初始的条件生成对抗网络模型。条件生成对抗网络模型包括生成器和判别器。生成器是基于预先已有的一些信息能够生成一张图,判别器判断这个图是真图还是假图。通过判别出来的结果调整生成器的参数,使得生成器的输出结果越来越逼真,不断调整判别器参数,能够使输入的图越来越精准判断出来是假。
可以理解的是,本步骤中条件生成对抗网络模型是改进后的模型,其输入信息不是多维度数字,而是图像。在本实施例中,利用图像翻译的判别器进行训练,图像翻译的判别器采用的策略是,用重建来解决低频成分,生成式对抗网络用来解决高频成分。一方面,使用传统的损失值来让生成的图片跟训练的图片尽量相似,用生成式对抗网络来构建高频部分的细节。其思想是,既然生成式对抗网络只用于构建高频信息,那么就不需要将整张图片输入到判别器中,先随机在图片范围内进行裁剪,得到若干个大小不同的图片块,判别器图片的真假。
本实施例中采用多尺度判别器,该多尺度判别器是基于三个尺度构建的。三个尺度的判别器分别为一个独立判别器,共同构成多尺度判别器。多尺度判
别器可以理解为进行了三次判别。原图在输入到判别器之前,先随机在图片范围内进行裁剪,得到若干个大小不同的图片块,维护三个层数分别为3,2,1的判别器。每输入到一个层数更少的判别器中时,图片会进行降采样,示例性的,使用降采样函数函数对图片进行降采样。3层判别器直接输入原图,2层判别器输入1/2大小的图片,1层判别器输入1/4大小的图片。将各尺寸图片下输入到判别器中,每一层的判别器都有一个输出,并将一张图片的所有尺度对应的输出结果的均值作为输出结果,并可以计算对应的损失值。示例性的,损失值计算可以与交换编码器的实现类似,此处不做具体限制。
b2)获取训练样本集,所述训练样本集中包括至少一组样本图像对,每组样本图像对中包括样本引导图和样本渲染图。
本在步骤中,基于训练样本集才能对条件生成对抗网络模型进行训练。其中,条件对抗训练样本集并不是随机的,训练样本集中包括的样本图像对是由样本引导图和样本渲染图构成的。一个样本图像对中的样本引导图和样本渲染图是针对相同主体进行渲染的。其中样本引导图与样本渲染图可以理解为对同一主体进行不同程度的渲染得到的。样本引导图是粗渲染得到的,样本渲染图是采用其他引擎工具进行更好效果的精渲染得到的,样本渲染图可以理解为真实图。
c2)根据所述样本图像对,训练所述生成器和多尺度判别器,获得所述丝状对象渲染模型。
在本步骤中,样本图像对包含样本引导图和样本渲染图,将样本引导图输入至生成器中,可以得到生成器的输出结果。再将生成器的输出结果和样本引导图以及样本渲染图共同作为判别器的输入,根据判别器的输出结果调整生成
器和判别器的参数,实现对生成器和判别器的训练,以使生成器和判别器满足精度要求,将训练后满足精度要求的生成器作为丝状对象渲染模型。
本可选实施例,在结构相似性指标损失和生成对抗网络损失的基础上,引入了多尺度判别器,基于以上三种类型尺度的图对判别器进行训练使判别器更为精准。对于毛发的细节表现有提升,因为输入的维度大大降低,所以参数量少,运算速度也比直接输入一张快,并且可以计算任意大小的图。
进一步的,所述根据所述样本图像对,训练所述生成器和多尺度判别器,获得所述丝状对象渲染模型的步骤可以表述为:
c21)将所述样本图像对中的样本引导图作为所述生成器的输入数据。
具体的,把样本图像对中的样本引导图作为生成器的输入数据,生成器可以对样本引导图进行渲染,得到生成器的输出结果。
c22)基于所述生成器的输出结果及所述样本图像对中的样本引导图和样本渲染图构成所述多尺度判别器的两组输入数据。
具体的,将生成器的输出结果与样本引导图作为一组数据,将样本图像对中的样本渲染图以及样本引导图作为另一组数据,将两组数据共同构成多尺度判别器的两组输入数据,分别输入至多尺度判别器中。
c23)根据所述多尺度判别器相对所述两组输入数据的输出结果,结合预先给定的损失函数,分别对所述生成器和多尺度判别器进行参数调整。
具体的,把上述两组输入数据作为判别器的输入,只要运行之后就会有输出结果,根据损失函数的损失结果能够对这些参数进行调整。需要知道的是,预先给定的损失函数是会调整生成器参数和多尺度判别器参数的。条件生成对抗网络模型中对抗思想的目的是,使生成器生成的渲染图更逼近真实图,使得
判别器将判别出来的图的真假更准确。预先给定的损失函数是应用到生成器和判别器中的,两者要达到的目标不一样,参数达到的结果也不一样。本步骤中,采用多个损失函数去介入进行参数调整。
c24)在满足训练迭代结束条件后,将训练后的生成器作为所述丝状对象渲染模型。
其中,迭代结束条件可以理解为将信息输入至生成器中,得到的输出图片达到设定精度以得到逼真的渲染图像,将渲染图像和特效引导图输入到判别器中判别结果达到设定精度,可以精准的判别出渲染图像的真假。若生成器和判别器分别达到设定精度,就可以将训练好的生成器作为丝状对象渲染模型,用于后续对丝状对象的渲染。
本可选实施例,具体化了丝状对象渲染模型的训练步骤。在高分辨率网络结构的场景下,引入群组归一化,增强了模型表现的稳定性,减少发丝渲染这种高频场景下的闪烁现象。
进一步的,所述生成器以给定第一网络结构表示,所述多尺度判别器以给定的第二网络结构表示;所述损失函数包括:生成对抗损失函数、学习感知图像块相似度损失函数和随机图像块损失函数。
其中,针对二维人体姿态估计任务提出的高分辨率网络结构称为HRNet结构,U型网络结构称为UNet结构。第一网络结构可以是HRNet结构,也可以是UNet结构。在不同场景下,分别采用这两类不同的网络结构。两种结构具有不同的特点,HRNet计算量较大,效果更好,适用于电脑上加速渲染即时交互等场景,Hdnet结构相对复杂精度更有保证,真实性更好,对移动终端就不太适合;UNet可以压缩到较小的计算量,适用于手机端上部署实时版本。
本实施例中,模型采用了图像翻译模式,该模式本质为条件生成对抗网络模型,具体的原理如下:训练一个条件生成对抗网络模型将轮廓图映射为照片。鉴别器学习对假图片(由生成器合成)和真实图片组进行分类。生成器,学会欺骗鉴别器。与普通生成对抗网络模型不同,生成器和鉴别器都观察输入的轮廓图与生成图片或真实图片,普通生成对抗网络模型直接输入生成图片或真实图片。
本可选实施例,具体化了丝状对象渲染模型的训练步骤。在结构相似性指标损失和生成对抗网络损失的基础上,引入了多尺度判别器,基于以上三种类型尺度的图对判别器进行训练使判别器更为精准。对于毛发的细节表现有提升。在HRNet场景下,引入群组归一化,增强了模型表现的稳定性,减少发丝渲染这种高频场景下的闪烁现象。
可选的,所述样本图像对中的样本引导图和样本渲染图基于相同的渲染参数分别通过预先给定的渲染引擎工具渲染确定。
本步骤中,在离线的渲染引擎工具上进行渲染得到更精准的渲染。其中,渲染参数可以包括相机参数、光照参数、物理参数等。为了保证渲染一致性,需要对基础模型基于相同的渲染参数进行渲染,分别得到样本引导图和样本渲染图。采用相同的参数,即属性、形态、光等的呈现上要保证一致,实现样本引导图和样本渲染图是对齐的。将相同参数对应的样本引导图和样本渲染图组成样本图像对。示例性的,假设狼的特效渲染中狼是张着嘴巴的,则样本引导图和样本渲染图上狼也是张着嘴巴的,且张开的形态是相同的。
考虑到想要实现图像的精准渲染,其实现的过程时间相对较长,不是实时能达到的。本步骤中以时间换取渲染效果,从而得到精准的样本渲染图。由于特效引导图可以快速实时的生成,不占用太多时间,基于特效引导图直接输入
至预先训练的丝状对象渲染模型中,不用耗费太长时间就可以直接得到一个目标特效画面,可以实现丝状对象的快速实时渲染,提高了特效渲染性能。
进一步的,所述样本图像对中样本引导图和样本渲染图的确定步骤包括:
a3)获取包含丝状对象的样本主体以及样本渲染参数,所述样本渲染参数包括相机参数、光照参数以及物理仿真形变参数。
具体的,找到关于包含丝状对象的样本主体,并获取样本渲染参数,样本渲染参数包括相机参数、光照参数以及物理仿真形变参数等。
b3)通过所述样本主体的样本关键引导线信息结合所述样本渲染参数,对所述样本主体的样本建模模型进行贴片渲染,获得所述样本主体的样本引导图。
其中,一个样本图像中的样本引导图和样本渲染图是对同一样本主体,同一要求进行渲染得到的。两种图的呈现形式不同,但渲染出来的形态属性是一样的。具体的,通过所述样本主体的样本关键引导线信息结合样本渲染参数,对样本主体的样本建模模型进行贴片渲染,得到样本毛发引导图和样本分割引导图共同组成样本引导图。毛发引导图主要在图中体现样本主体的丝状对象的特征。分割引导图呈现样本主体的形态、形变、区域位置、光参数等内容。
c3)在给定的离线渲染引擎工具上,通过所述样本渲染参数对所述样本建模模型进行离线渲染,获得所述样本主体的样本渲染图。
其中,给定的离线渲染引擎工具可以是渲染引擎函数。通过样本渲染参数对样本建模模型进行离线渲染,在离线渲染引擎工具上进行渲染,将一些参数配置到离线渲染引擎工具上,基于工具渲染的特效可以实现更真实更逼真的一个渲染图,作为样本主体的样本渲染图。
上述技术方案,考虑到想要实现图像的精准渲染,其实现的过程时间相对
较长,不是实时能达到的。本步骤中以时间换取渲染效果,使用传统图形学渲染算法生成,从而得到精准的样本渲染图。基于本技术方案生成的样本图像对用来训练神经网络模型获得丝状对象渲染模型,可以直接将丝状对象渲染模型应用到终端设备上,从而实现渲染效果较好的实时丝状对象渲染功能,提高了包含丝状对象的特效渲染的性能。
图4为本公开实施例所提供的一种特效处理装置结构示意图,如图4所示,所述装置包括:响应模块410、引导图确定模块420以及处理显示模块430。
其中,响应模块410,用于响应于针对目标特效的特效触发操作;引导图确定模块420,用于当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线;处理显示模块430,用于对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。
本公开实施例的技术方案,先响应于针对目标特效的特效触发操作;当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线;然后对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。本公开实施例的技术方案,引入了特效引导图,可以在所触发的特效包含丝状对象渲染时,首先确定出包含特效主体基础模型信息以及丝状对象关键信息的特效引导图,作为特效的粗渲染,后续可直接对特效引导图进行渲染,获得实
现丝状对象精确渲染的目标特效画面。上述技术方案,区别于现有对特效中丝状对象的渲染实现,将对丝状对象的渲染简化为基于丝状对象的关键引导线进行精致渲染,在保证丝状对象渲染精度的同时,有效减少了渲染计算量,保证了丝状对象的渲染速度;同时,本技术方案的丝状对象渲染主要依赖于包含表征丝状对象关键引导线的特效引导图,而特效引导图的确定过程简单易实现,也有效降低了丝状对象设计的制作成本,降低了丝状对象多样化设计的实现难度。
可选的,引导图确定模块420,具体包括:
第一确定单元,用于确定所述目标特效对应的特效主体;
第二确定单元,用于如果所述特效主体的展示对象中包括丝状对象,则确定所述特效主体上存在丝状对象渲染;
引导图生成单元,用于根据所述特效主体的关键引导线信息及基础模型,生成所述特效主体的特效引导图。
可选的,引导图生成单元具体用于:
获取所述特效主体用于三维建模的基础模型,并提取相对所述特效主体预先设定的关键引导线信息以及粗渲染参数;
通过所述粗渲染参数及关键引导线信息,对所述基础模型进行贴片渲染,获得所述特效主体的特效引导图。
可选的,处理显示模块430,具体用于:
将所述特效引导图输入预先训练的丝状对象渲染模型,输出目标特效画面,所述丝状对象渲染模型通过预先确定的引导图-渲染图样本图像对训练获得;
显示所述目标特效的目标特效画面。
可选的,该装置还包括模型训练模块,所述模型训练模块具体包括:
初始构建单元,用于构建初始的条件生成对抗网络模型,所述条件生成对抗网络模型包括:生成器以及多尺度判别器;
样本获取单元,用于获取训练样本集,所述训练样本集中包括至少一组样本图像对,每组样本图像对中包括样本引导图和样本渲染图;
训练单元,用于根据所述样本图像对,训练所述生成器和多尺度判别器,获得所述丝状对象渲染模型。
可选的,训练单元,具体可以用于:
将所述样本图像对中的样本引导图作为所述生成器的输入数据;
基于所述生成器的输出结果及所述样本图像对中的样本引导图和样本渲染图构成所述多尺度判别器的两组输入数据;
根据所述多尺度判别器相对所述两组输入数据的输出结果,结合预先给定的损失函数,分别对所述生成器和多尺度判别器进行参数调整;
在满足训练迭代结束条件后,将训练后的生成器作为所述丝状对象渲染模型。
可选的,所述生成器以给定第一网络结构表示,所述多尺度判别器以给定的第二网络结构表示;
所述损失函数包括:生成对抗损失函数、学习感知图像块相似度损失函数和随机图像块损失函数。
可选的,所述样本图像对中的样本引导图和样本渲染图基于相同的渲染参数分别通过预先给定的渲染引擎工具渲染确定。
可选的,所述丝状对象为毛发。
本公开实施例所提供的特效处理装置可执行本公开任意实施例所提供的特效处理方法,具备执行方法相应的功能模块和有益效果。
值得注意的是,上述装置所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本公开实施例的保护范围。
图5为本公开实施例所提供的一种电子设备的结构示意图。下面参考图5,其示出了适于用来实现本公开实施例的电子设备(例如图5中的终端设备或服务器)500的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图5示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图5所示,电子设备500可以包括处理装置(例如中央处理器、图形处理器等)501,其可以根据存储在只读存储器(ROM)502中的程序或者从存储装置508加载到随机访问存储器(RAM)503中的程序而执行各种适当的动作和处理。在RAM 503中,还存储有电子设备500操作所需的各种程序和数据。处理装置501、ROM 502以及RAM 503通过总线504彼此相连。编辑/输出(I/O)接口505也连接至总线504。
通常,以下装置可以连接至I/O接口505:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置506;包括例如液晶
显示器(LCD)、扬声器、振动器等的输出装置507;包括例如磁带、硬盘等的存储装置508;以及通信装置509。通信装置509可以允许电子设备500与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备500,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置509从网络上被下载和安装,或者从存储装置508被安装,或者从ROM 502被安装。在该计算机程序被处理装置501执行时,执行本公开实施例的方法中限定的上述功能。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
本公开实施例提供的电子设备与上述实施例提供的特效处理方法属于同一发明构思,未在本实施例中详尽描述的技术细节可参见上述实施例,并且本实施例与上述实施例具有相同的有益效果。
本公开实施例提供了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述实施例所提供的特效处理方法。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例
如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,
而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:响应于针对目标特效的特效触发操作;
当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线;
对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图
中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取至少两个网际协议地址的单元”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,【示例一】提供了一种特效处理方法,该方法包括:
响应于针对目标特效的特效触发操作;
当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线;
对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。
根据本公开的一个或多个实施例,【示例二】提供了一种特效处理方法,该方法包括:
可选的,所述当所述目标特效所对应特效主体上存在丝状渲染对象时,确定所述特效主体的特效引导图,包括:
确定所述目标特效对应的特效主体;
如果所述特效主体的展示对象中包括丝状对象,则确定所述特效主体上存在丝状对象渲染;
根据所述特效主体的关键引导线信息及基础模型,生成所述特效主体的特效引导图,所述关键引导线信息包括所述关键引导线的位置和/或长度。
根据本公开的一个或多个实施例,【示例三】提供了一种特效处理方法,该方法包括:
可选的,所述根据所述特效主体的基础模型及关键引导线信息,生成所述特效主体的特效引导图,包括:
获取所述特效主体用于三维建模的基础模型,并提取相对所述特效主体预
先设定的关键引导线信息以及粗渲染参数;
通过所述粗渲染参数及关键引导线信息,对所述基础模型进行贴片渲染,获得所述特效主体的特效引导图。
根据本公开的一个或多个实施例,【示例四】提供了一种特效处理方法,该方法包括:
可选的,所述对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,包括:
将所述特效引导图输入预先训练的丝状对象渲染模型,输出目标特效画面,所述丝状对象渲染模型通过预先确定的引导图-渲染图样本图像对训练获得;
显示所述目标特效的目标特效画面。
根据本公开的一个或多个实施例,【示例五】提供了一种特效处理方法,该方法包括:
可选的,所述丝状对象渲染模型的训练步骤包括,包括:
构建初始的条件生成对抗网络模型,所述条件生成对抗网络模型包括:生成器以及多尺度判别器;
获取训练样本集,所述训练样本集中包括至少一组样本图像对,每组样本图像对中包括样本引导图和样本渲染图;
根据所述样本图像对,训练所述生成器和多尺度判别器,获得所述丝状对象渲染模型。
根据本公开的一个或多个实施例,【示例六】提供了一种特效处理方法,该方法包括:
可选的,所述根据所述样本图像对,训练所述生成器和多尺度判别器,获
得所述丝状对象渲染模型,包括:
将所述样本图像对中的样本引导图作为所述生成器的输入数据;
基于所述生成器的输出结果及所述样本图像对中的样本引导图和样本渲染图构成所述多尺度判别器的两组输入数据;
根据所述多尺度判别器相对所述两组输入数据的输出结果,结合预先给定的损失函数,分别对所述生成器和多尺度判别器进行参数调整;
在满足训练迭代结束条件后,将训练后的生成器作为所述丝状对象渲染模型。
根据本公开的一个或多个实施例,【示例七】提供了一种特效处理方法,该方法包括:
可选的,所述生成器以给定第一网络结构表示,所述多尺度判别器以给定的第二网络结构表示;
所述损失函数包括:生成对抗损失函数、学习感知图像块相似度损失函数和随机图像块损失函数。
根据本公开的一个或多个实施例,【示例八】提供了一种特效处理方法,该方法包括:
可选的,所述样本图像对中的样本引导图和样本渲染图基于相同的渲染参数分别通过预先给定的渲染引擎工具渲染确定。
根据本公开的一个或多个实施例,【示例九】提供了一种特效处理方法,该方法包括:
可选的,所述样本图像对中样本引导图和样本渲染图的确定步骤包括:
获取包含丝状对象的样本主体以及样本渲染参数,所述样本渲染参数包括
相机参数、光照参数以及物理仿真形变参数;
通过所述样本主体的样本关键引导线信息结合所述样本渲染参数,对所述样本主体的样本建模模型进行贴片渲染,获得所述样本主体的样本引导图;
在给定的离线渲染引擎工具上,通过所述样本渲染参数对所述样本建模模型进行离线渲染,获得所述样本主体的样本渲染图。
根据本公开的一个或多个实施例,【示例十】提供了一种特效处理方法,该方法包括:
可选的,所述丝状对象为毛发。
根据本公开的一个或多个实施例,【示例十一】提供了一种特效处理装置,该装置包括:
响应模块,用于响应于针对目标特效的特效触发操作;
引导图确定模块,用于当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线;
处理显示模块,用于对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成
的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。
Claims (12)
- 一种特效处理方法,其特征在于,包括:响应于针对目标特效的特效触发操作;当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线;对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。
- 根据权利要求1所述的方法,其特征在于,所述当所述目标特效所对应特效主体上存在丝状渲染对象时,确定所述特效主体的特效引导图,包括:确定所述目标特效对应的特效主体;如果所述特效主体的展示对象中包括丝状对象,则确定所述特效主体上存在丝状对象渲染;根据所述特效主体的关键引导线信息及基础模型,生成所述特效主体的特效引导图,所述关键引导线信息包括所述关键引导线的位置和/或长度。
- 根据权利要求2所述的方法,其特征在于,所述根据所述特效主体的基础模型及关键引导线信息,生成所述特效主体的特效引导图,包括:获取所述特效主体用于三维建模的基础模型,并提取相对所述特效主体预先设定的关键引导线信息以及粗渲染参数;通过所述粗渲染参数及关键引导线信息,对所述基础模型进行贴片渲染,获得所述特效主体的特效引导图。
- 根据权利要求1所述的方法,其特征在于,所述对所述特效引导图进行 渲染处理,获得所述目标特效的目标特效画面并显示,包括:将所述特效引导图输入预先训练的丝状对象渲染模型,输出目标特效画面,所述丝状对象渲染模型通过预先确定的引导图-渲染图样本图像对训练获得;显示所述目标特效的目标特效画面。
- 根据权利要求4所述的方法,其特征在于,所述丝状对象渲染模型的训练步骤包括:构建初始的条件生成对抗网络模型,所述条件生成对抗网络模型包括:生成器以及多尺度判别器;获取训练样本集,所述训练样本集中包括至少一组样本图像对,每组样本图像对中包括样本引导图和样本渲染图;根据所述样本图像对,训练所述生成器和多尺度判别器,获得所述丝状对象渲染模型。
- 根据权利要求5所述的方法,其特征在于,所述根据所述样本图像对,训练所述生成器和多尺度判别器,获得所述丝状对象渲染模型,包括:将所述样本图像对中的样本引导图作为所述生成器的输入数据;基于所述生成器的输出结果及所述样本图像对中的样本引导图和样本渲染图构成所述多尺度判别器的两组输入数据;根据所述多尺度判别器相对所述两组输入数据的输出结果,结合预先给定的损失函数,分别对所述生成器和多尺度判别器进行参数调整;在满足训练迭代结束条件后,将训练后的生成器作为所述丝状对象渲染模型。
- 根据权利要求6所述的方法,其特征在于,所述生成器以给定第一网络 结构表示,所述多尺度判别器以给定的第二网络结构表示;所述损失函数包括:生成对抗损失函数、学习感知图像块相似度损失函数和随机图像块损失函数。
- 根据权利要求5所述的方法,其特征在于,所述样本图像对中的样本引导图和样本渲染图基于相同的渲染参数分别通过预先给定的渲染引擎工具渲染确定。
- 根据权利要求1-8任一项所述的方法,其特征在于,所述丝状对象为毛发。
- 一种特效处理装置,其特征在于,包括:响应模块,用于响应于针对目标特效的特效触发操作;引导图确定模块,用于当所述目标特效所对应特效主体存在丝状对象渲染时,确定所述特效主体的特效引导图,所述特效引导图包括特效主体的基础模型以及表征丝状对象的关键引导线;处理显示模块,用于对所述特效引导图进行渲染处理,获得所述目标特效的目标特效画面并显示,其中,所述目标特效画面中包含对关键引导线渲染后形成的丝状对象。
- 一种电子设备,其特征在于,所述电子设备包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-9中任一所述的特效处理方法。
- 一种包含计算机可执行指令的存储介质,其特征在于,所述计算机可 执行指令在由计算机处理器执行时用于执行如权利要求1-9中任一所述的特效处理方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211314027.9A CN115601487A (zh) | 2022-10-25 | 2022-10-25 | 特效处理方法、装置、电子设备和存储介质 |
| CN202211314027.9 | 2022-10-25 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024088100A1 true WO2024088100A1 (zh) | 2024-05-02 |
Family
ID=84849884
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/124826 Ceased WO2024088100A1 (zh) | 2022-10-25 | 2023-10-16 | 特效处理方法、装置、电子设备和存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN115601487A (zh) |
| WO (1) | WO2024088100A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115601487A (zh) * | 2022-10-25 | 2023-01-13 | 北京字跳网络技术有限公司(Cn) | 特效处理方法、装置、电子设备和存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160247308A1 (en) * | 2014-09-24 | 2016-08-25 | Intel Corporation | Furry avatar animation |
| CN113888688A (zh) * | 2021-08-20 | 2022-01-04 | 完美世界互娱(北京)科技有限公司 | 毛发渲染方法、设备及存储介质 |
| CN114549722A (zh) * | 2022-02-25 | 2022-05-27 | 北京字跳网络技术有限公司 | 3d素材的渲染方法、装置、设备及存储介质 |
| CN114627222A (zh) * | 2021-12-31 | 2022-06-14 | 网易(杭州)网络有限公司 | 羽毛贴图及羽毛效果模型的生成方法、装置及电子设备 |
| CN115601487A (zh) * | 2022-10-25 | 2023-01-13 | 北京字跳网络技术有限公司(Cn) | 特效处理方法、装置、电子设备和存储介质 |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110659727B (zh) * | 2019-09-24 | 2022-05-13 | 中国科学技术大学 | 一种基于草图的图像生成方法 |
| CN113850746B (zh) * | 2021-09-29 | 2024-11-22 | 北京字跳网络技术有限公司 | 图像处理方法、装置、电子设备及存储介质 |
| CN114697568B (zh) * | 2022-04-07 | 2024-02-20 | 脸萌有限公司 | 特效视频确定方法、装置、电子设备及存储介质 |
| CN115100346A (zh) * | 2022-06-17 | 2022-09-23 | 北京字跳网络技术有限公司 | 头发光照渲染方法、图像处理模型训练方法、装置及设备 |
-
2022
- 2022-10-25 CN CN202211314027.9A patent/CN115601487A/zh active Pending
-
2023
- 2023-10-16 WO PCT/CN2023/124826 patent/WO2024088100A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160247308A1 (en) * | 2014-09-24 | 2016-08-25 | Intel Corporation | Furry avatar animation |
| CN113888688A (zh) * | 2021-08-20 | 2022-01-04 | 完美世界互娱(北京)科技有限公司 | 毛发渲染方法、设备及存储介质 |
| CN114627222A (zh) * | 2021-12-31 | 2022-06-14 | 网易(杭州)网络有限公司 | 羽毛贴图及羽毛效果模型的生成方法、装置及电子设备 |
| CN114549722A (zh) * | 2022-02-25 | 2022-05-27 | 北京字跳网络技术有限公司 | 3d素材的渲染方法、装置、设备及存储介质 |
| CN115601487A (zh) * | 2022-10-25 | 2023-01-13 | 北京字跳网络技术有限公司(Cn) | 特效处理方法、装置、电子设备和存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115601487A (zh) | 2023-01-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12002160B2 (en) | Avatar generation method, apparatus and device, and medium | |
| JP7104683B2 (ja) | 情報を生成する方法および装置 | |
| US20230071661A1 (en) | Method for training image editing model and method for editing image | |
| CN113705316B (zh) | 获取虚拟图像的方法、装置、设备及存储介质 | |
| CN113362263B (zh) | 变换虚拟偶像的形象的方法、设备、介质及程序产品 | |
| CN110827379A (zh) | 虚拟形象的生成方法、装置、终端及存储介质 | |
| CN114792359B (zh) | 渲染网络训练和虚拟对象渲染方法、装置、设备及介质 | |
| WO2017129149A1 (zh) | 基于多模态输入进行交互的方法和设备 | |
| CN112652041B (zh) | 虚拟形象的生成方法、装置、存储介质及电子设备 | |
| CN111369428A (zh) | 虚拟头像生成方法和装置 | |
| CN109271018A (zh) | 基于虚拟人行为标准的交互方法及系统 | |
| CN117370605A (zh) | 一种虚拟数字人驱动方法、装置、设备和介质 | |
| US20230368461A1 (en) | Method and apparatus for processing action of virtual object, and storage medium | |
| CN111739134B (zh) | 虚拟角色的模型处理方法、装置及可读存储介质 | |
| CN109920016A (zh) | 图像生成方法及装置、电子设备和存储介质 | |
| CN109343695A (zh) | 基于虚拟人行为标准的交互方法及系统 | |
| WO2024088100A1 (zh) | 特效处理方法、装置、电子设备和存储介质 | |
| US12293477B2 (en) | Adjusting audible area of avatar's voice | |
| WO2024152659A9 (zh) | 一种图像处理方法、装置、设备、介质及程序产品 | |
| WO2021155666A1 (zh) | 用于生成图像的方法和装置 | |
| CN116030185A (zh) | 三维发丝生成方法和模型的训练方法 | |
| CN109445573A (zh) | 一种用于虚拟化身形象互动的方法与装置 | |
| WO2025098269A1 (zh) | 视频处理方法、装置、电子设备及存储介质 | |
| CN114998554A (zh) | 三维卡通人脸建模方法及装置 | |
| CN114170070B (zh) | 对象属性编辑方法、装置、电子设备及可读存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23881679 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 07.08.2025) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 23881679 Country of ref document: EP Kind code of ref document: A1 |