Method and device for realizing image offline rendering based on diffusion and storage medium
By rapidly rendering the initial image and iteratively enhancing it using the Diffusion network model, the problem of long high-quality rendering time in existing technologies is solved, and efficient high-quality image generation is achieved.
Patent Information
- Application Number
- CN202310606898.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-26
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-05-26
AI Technical Summary
In existing technologies, obtaining high-quality images through offline rendering takes a considerable amount of time.
The Diffusion network model is used to quickly render the initial image using template rendering parameters, and to enhance image quality by predicting noise information through multiple rounds of iteration until the final rendering parameters are met.
To obtain high-quality rendered images that meet user needs without increasing rendering time.
Smart Images

Figure CN116777765B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a method and device for realizing image offline rendering based on Diffusion and a storage medium. BACKGROUND
[0002] Offline rendering refers to pre-computing various properties of an image on a computer, including resolution, sampling rate, light source, material, etc., and then rendering it into a final image. For example, existing CG software and 3D modeling software (such as Maya, 3ds Max, Houdini, Blender, etc.) are basically based on offline rendering solutions. Compared with real-time rendering, offline rendering can obtain higher quality images. In offline rendering, the better the image effect of the final image, the more time it takes in the rendering process. SUMMARY
[0003] Therefore, the present application aims to provide a method and device for realizing image offline rendering based on Diffusion and a storage medium to solve the problem that it takes a long time to render images, especially high-quality rendered images, by the offline rendering method in the prior art.
[0004] According to a first aspect of an embodiment of the present application, a method for realizing image offline rendering based on Diffusion is provided, which comprises:
[0005] obtaining a scene to be rendered and final rendering parameters, and adjusting the final rendering parameters to template rendering parameters;
[0006] rendering the scene to be rendered by using the template rendering parameters to obtain an initial rendered image;
[0007] inputting the final rendering parameters and the template rendering parameters into a pre-trained Diffusion network model to obtain a mapping relationship between the template rendering parameters and the final rendering parameters;
[0008] The pre-trained Diffusion network model predicts noise information in the initial rendered image according to the mapping relationship, enhances the initial rendered image by subtracting the noise information, and predicts noise information of the current image through multiple iterations until the enhanced image meets the final rendering parameters, and outputs a final rendered image.
[0009] Preferably,
[0010] The training process of the Diffusion network model comprises:
[0011] Step S201, based on the final rendering parameters of a user and a scene to be rendered, a target rendered image is obtained by using offline rendering.
[0012] Step S202, based on the template rendering parameters and the scene to be rendered, using offline rendering to obtain an initial rendering image;
[0013] Step S203, through different final rendering parameters and template rendering parameters, a plurality of groups of target rendering images and initial rendering images are obtained;
[0014] Step S204, randomly selecting a group of initial rendering images and target rendering images, based on a preset number n, randomly adding Gaussian noise information to the target rendering images to obtain a plurality of Gaussian noise images, the target rendering image randomly added with Gaussian noise for the first time is a first Gaussian noise image, and the image randomly added with Gaussian noise for the last time is an n-th Gaussian noise image;
[0015] Step S205, inputting the target rendering image into the unet network structure, outputting first noise point information existing in the target rendering image predicted by the unet network structure, calculating a loss value between the target rendering image added with the first noise point information and the first Gaussian noise image, and updating parameters of the unet network structure based on the minimum loss value;
[0016] Step S206, inputting the first Gaussian noise image into the updated unet network structure, outputting second noise point information existing in the first Gaussian noise image, calculating a loss value between the first Gaussian noise image added with the second noise point information and the second Gaussian noise image, and continuing to update the parameters of the unet network structure based on the minimum loss value;
[0017] Step S207, repeating step S206 until the n-th Gaussian noise image is input into the unet network structure updated last time, outputting n+1 noise point information existing in the n-th Gaussian noise image, calculating a loss value between the n-th Gaussian noise image added with the n+1 noise point information and the initial rendering image, and updating the parameters of the unet network structure based on the minimum loss value, to complete training of a group of initial rendering images and target rendering images;
[0018] Step S208, repeating steps S204 to S207 to complete training of a plurality of groups of initial rendering images and target rendering images until the unet network structure completely converges, and obtaining a pre-trained Diffusion network model.
[0019] Preferably, it further comprises:
[0020] The loss value is a similarity between an image obtained after inputting an image of the unet network structure into the image and adding noise point information and a Gaussian noise image obtained after randomly adding Gaussian noise to the input image.
[0021] Preferably,
[0022] The obtaining of the initial rendering image or the target rendering image comprises:
[0023] inputting the scene to be rendered and final rendering parameters into an offline renderer, and rendering the scene to be rendered by the final rendering parameters to obtain a target rendering image;
[0024] or,
[0025] inputting the scene to be rendered and template rendering parameters into an offline renderer, and rendering the scene to be rendered by the template rendering parameters to obtain an initial rendering image.
[0026] Preferably,
[0027] The final rendering image output by the pre-trained Diffusion network model comprises a JPEG format image, a PNG format image, a TIFF format image or an EXR format image.
[0028] Preferably,
[0029] The template rendering parameters or the final rendering parameters comprise a resolution, a sampling parameter, a light source and a material parameter.
[0030] According to a second aspect of the embodiment of the present application, an apparatus for realizing offline rendering of images based on Diffusion is provided, and the apparatus comprises:
[0031] a preprocessing module configured to obtain a scene to be rendered and final rendering parameters, and adjust the final rendering parameters to template rendering parameters;
[0032] an offline rendering module configured to render the scene to be rendered by the template rendering parameters to obtain an initial rendering image;
[0033] a mapping relationship obtaining module configured to input the final rendering parameters and the template rendering parameters into a pre-trained Diffusion network model to obtain a mapping relationship between the template rendering parameters and the final rendering parameters;
[0034] an image enhancement module configured to predict noise information in the initial rendering image according to the mapping relationship by the pre-trained Diffusion network model, enhance the initial rendering image by subtracting the noise information, predict noise information of a current image by multiple rounds of iteration until the enhanced image meets the final rendering parameters, and output a final rendering image.
[0035] According to a third aspect of the embodiments of the present application, a storage medium is provided, which stores a computer program, and when the computer program is executed by a host, each step of the above method is implemented.
[0036] The technical solutions provided by the embodiments of the present application can include the following beneficial effects:
[0037] The present application adjusts the final rendering parameter to the preset template rendering parameter after obtaining the rendering scene and the final rendering parameter of the user, the template rendering parameter can achieve fast rendering while retaining as much information in the 3D scene as possible, and then the scene is rendered through the template rendering parameter, so that an initial rendering image with low quality can be quickly obtained, then a pre-trained Diffusion network model is introduced, the initial rendering image is enhanced through the pre-trained Diffusion network model compared with the final rendering parameter, and the final rendering image is obtained through multiple iterations, so that a high-quality rendering image meeting the user's demand can be obtained, and a lot of time is not spent in the offline rendering process.
[0038] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0039] The accompanying drawings incorporated in and forming a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.
[0040] Figure 1 is a flowchart of a method for realizing image offline rendering based on Diffusion according to an exemplary embodiment;
[0041] Figure 2 is a schematic diagram of a unet network structure according to another exemplary embodiment;
[0042] Figure 3 is a system schematic diagram of an apparatus for realizing image offline rendering based on Diffusion according to an exemplary embodiment;
[0043] In the drawings: 1 - preprocessing module, 2 - offline rendering module, 3 - mapping relationship acquisition module, 4 - image enhancement module. DETAILED DESCRIPTION
[0044] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The description of the exemplary embodiments is intended to apply to various alternative embodiments as well. Unless otherwise noted, like elements in different drawings represent the same or similar elements. The following description of the exemplary embodiments is not representative of all possible embodiments consistent with the present application. Rather, it is merely an example of apparatus and methods consistent with some aspects of the present application as detailed in the appended claims.
[0045] Embodiment One
[0046] Figure 1 is a flowchart of a method for implementing image offline rendering based on Diffusion according to an exemplary embodiment, as shown in Figure 1 , the method comprises:
[0047] S1, obtaining a scene to be rendered and final rendering parameters, adjusting the final rendering parameters to template rendering parameters;
[0048] S2, rendering the scene to be rendered by the template rendering parameters to obtain an initial rendering image;
[0049] S3, inputting the final rendering parameters and the template rendering parameters into a pre-trained Diffusion network model to obtain a mapping relationship between the template rendering parameters and the final rendering parameters;
[0050] S4, the pre-trained Diffusion network model predicts the noise information in the initial rendering image according to the mapping relationship, enhances the initial rendering image by subtracting the noise information, and predicts the noise information of the current image through multiple iterations until the enhanced image meets the final rendering parameters, and outputs the final rendering image;
[0051] It can be understood that, in the present application, Diffusion is a deep learning algorithm based on neural network, which can perform inference calculation on gpu, and can also optimize the network, or provide special hardware such as TPU, which has the advantage of further accelerating the inference speed. In the present application, the final rendering parameters are obtained, and the final rendering parameters are adjusted to template rendering parameters. It should be noted that the template rendering parameters are preset values of each rendering parameter, and the template rendering parameters can retain as much information in the 3D scene as possible. The template rendering parameters are used to quickly render the to-be-rendered scene to obtain an initial rendering image, that is, a rendering image with low quality, which is used to save the time of offline rendering. After rendering is completed, the pre-trained Diffusion network model can be used to enhance the rendering result. Specifically, the diffusion algorithm can be used to process the image to increase the clarity, contrast and details of the image. Diffusion technology mainly predicts noise information in the current image through a neural network, and then subtracts the noise information from the image to achieve the purpose of image enhancement. Based on the parameters submitted by the user for the final rendering result, that is, the final rendering parameters are mapped to the inference process of the Diffusion network model, the noise information is predicted through multiple iterations, and the final rendering parameters required by the user are output. Different samplers, different random seed numbers and other parameters correspond to different effects. In the present application, after obtaining the rendering scene and the final rendering parameters of the user, the final rendering parameters are adjusted to preset template rendering parameters. The template rendering parameters can achieve fast rendering while retaining as much information in the 3D scene as possible. Then the scene is rendered by the template rendering parameters, so that a low-quality initial rendering image can be quickly obtained. Then the pre-trained Diffusion network model is introduced, and the initial rendering image is enhanced by the pre-trained Diffusion network model compared with the final rendering parameters. The final rendering image is obtained through multiple iterations. In this way, a high-quality rendering image meeting the user's requirements can be obtained, and a lot of time is not spent in the offline rendering process.
[0052] Preferably,
[0053] The training process of the Diffusion network model comprises:
[0054] In step S201, a target rendering image is obtained by using offline rendering based on the final rendering parameters of the user and the to-be-rendered scene.
[0055] In step S202, an initial rendering image is obtained by using offline rendering based on the template rendering parameters and the to-be-rendered scene.
[0056] Step S203, obtain a plurality of groups of target rendering images and initial rendering images through different final rendering parameters and template rendering parameters;
[0057] Step S204, randomly select a group of initial rendering images and target rendering images, based on a preset number n, randomly add Gaussian noise information to the target rendering images to obtain a plurality of Gaussian noise images, the target rendering image to which Gaussian noise is added for the first time is a first Gaussian noise image, and the image to which Gaussian noise is added for the last time is an n-th Gaussian noise image;
[0058] Step S205, input the target rendering image into the unet network structure, output the first noise point information existing in the target rendering image predicted by the unet network structure, calculate the loss value of the target rendering image to which the first noise point information is added and the first Gaussian noise image, and update the parameters of the unet network structure based on the minimum loss value;
[0059] Step S206, input the first Gaussian noise image into the updated unet network structure, output the second noise point information existing in the first Gaussian noise image, calculate the loss value of the first Gaussian noise image to which the second noise point information is added and the second Gaussian noise image, and continue to update the parameters of the unet network structure based on the minimum loss value;
[0060] Step S207, repeat step S206 until the n-th Gaussian noise image is input into the unet network structure updated last time, output the n+1-th noise point information existing in the n-th Gaussian noise image, calculate the loss value of the n-th Gaussian noise image to which the n+1-th noise point information is added and the initial rendering image, and update the parameters of the unet network structure based on the minimum loss value, complete the training of a group of initial rendering images and target rendering images;
[0061] Step S208, repeat steps S204 to S207 to complete the training of a plurality of groups of initial rendering images and target rendering images until the unet network structure converges completely, and obtain a pre-trained Diffusion network model;
[0062] It can be understood that the parameters determined when defining the neural network determine the size of the network and how many parameters, which are not interpretable, will be calculated with the input value, generally matrix operation, matrix multiplication or matrix addition, for example, the defined network model is f(x)=ax+b, then [a,b] is the parameter of the network, the parameter is a random value at the beginning, which will be adjusted automatically with the network training; in the embodiment, the unet network structure is created, and a structure diagram of the unet network structure is as shown in FIG. 1; Figure 2As shown, assuming that the above Diffusion network model is the calculation process of f(x) = ax + b, the initial target rendered image is the input x, and the network model parameters are (a, b); the image after the first random Gaussian noise is denoted by y_, and y represents the output of the target rendered image, which can be understood as noise information; here we further adjust y, y = x + y, which means the target rendered image + noise information, and the loss value is calculated with this y and y_, at this time our problem solving is to minimize the loss value, and we can write the function we want to solve, for example h(y, y_), or h(ax + b + y, y), in this solving function, x and y are known, and the parameters we need to optimize are (a, b), here we use the gradient descent method, first take the partial derivative of h with respect to a, set the derivative to 0, then bring in the current (x, y) to get a1, and update the parameter a as follows: a <- (a - n * a1), which means that the original a value becomes a minus n times a1, and the remaining parameters are adjusted in the same way. At this time, one round of parameter adjustment is completed. From the above process, it can be seen that a is actually the tangent of this equation, and the tangent direction represents the direction in which the loss value h decreases. After one round of parameter adjustment, h will become a little smaller, which means that the training is effective. Now assume that we have collected 500 sets of initial rendered images and target rendered images, and the target rendered image of each set of images is processed with 20 Gaussian noises, and then the above calculation process is adjusted to one parameter (a, b) each time. The adjustment of the parameters will affect y, and in turn affect the loss value h. With the training of a group of initial rendered images and target rendered images, the loss value h will become smaller and smaller. Then we can display h each time, or display the change of h in real time through a chart. The tool used is generally tensorboard. We can see a real-time changing curve. If the training is effective, we should see the curve going down more and more. When the decline tends to be flat or even no longer decreases, it means that the parameter adjustment has reached the limit. At this time, it means that the model has been trained to convergence, and the training of the model is completed. The trained model can be applied to the above image enhancement.
[0063] Preferably, further comprising:
[0064] The loss value is the similarity between the image obtained by adding noise information to the input image of the unet network structure and the Gaussian noise image obtained by randomly adding Gaussian noise to the input image.
[0065] It can be understood that in the embodiment, the loss value is measured by similarity, and the similarity can be calculated using the ssmi algorithm, which measures the similarity between any two images based on three dimensions of luminance, contrast and structure.
[0066] Preferably,
[0067] The obtaining of the initial rendering image or the target rendering image comprises:
[0068] inputting the scene to be rendered and final rendering parameters into an offline renderer, the offline renderer rendering the scene to be rendered through the final rendering parameters to obtain a target rendering image;
[0069] or,
[0070] inputting the scene to be rendered and template rendering parameters into an offline renderer, the offline renderer rendering the scene to be rendered through the template rendering parameters to obtain an initial rendering image;
[0071] It can be understood that after obtaining the template rendering parameters and the rendering scene, they can be input into the offline renderer together. The high-quality rendering image in the prior art and the target rendering image in the model training process of the present application are also completed in the offline renderer. However, the high-quality rendering image and the target rendering image require a lot of time. Therefore, in the scheme of the present application, the offline renderer is used to render the scene based on the template rendering parameters. The offline renderer usually supports multi-thread and distributed rendering, which can speed up the rendering. Through this step, a rendering image with lower quality, that is, an initial rendering image, can be quickly obtained.
[0072] Preferably,
[0073] The final rendering image output by the pre-trained Diffusion network model comprises a JPEG format image, a PNG format image, a TIFF format image or an EXR format image;
[0074] It can be understood that the enhanced image is output as the final rendering result. The output format can be selected according to needs, such as JPEG, PNG, TIFF, EXR, etc. At the same time, a fine-tuning interface can be provided for users to ensure that the final output result meets customer requirements.
[0075] Preferably,
[0076] The template rendering parameters or the final rendering parameters comprise a resolution, a sampling parameter, a light source and a material parameter;
[0077] It can be understood that first, the scene to be rendered needs to be preprocessed. This step is completed in a CG software. The parameters related to rendering are mainly adjusted, including material type, light quality, light source, reflection type, reflection quality, transparency, resolution, sampling frequency, etc. The specific parameters are shown in the following table:
[0078]
[0079] Embodiment Two
[0080] Figure 3 is a system schematic diagram of an apparatus for realizing image offline rendering based on Diffusion according to an exemplary embodiment, comprising:
[0081] A preprocessing module 1 is configured to acquire a scene to be rendered and final rendering parameters, and adjust the final rendering parameters to template rendering parameters.
[0082] An offline rendering module 2 is configured to render the scene to be rendered by using the template rendering parameters to obtain an initial rendering image.
[0083] A mapping relationship acquisition module 3 is configured to input the final rendering parameters and the template rendering parameters into a pre-trained Diffusion network model to obtain a mapping relationship between the template rendering parameters and the final rendering parameters.
[0084] An image enhancement module 4 is configured to predict noise information in the initial rendering image according to the mapping relationship by using the pre-trained Diffusion network model, enhance the initial rendering image by subtracting the noise information, and predict the noise information of the current image through multiple rounds of iteration until the enhanced image meets the final rendering parameters, and output a final rendering image.
[0085] It can be understood that in the present application, the pre-processing module 1 is used to obtain a to-be-rendered scene and final rendering parameters, the final rendering parameters are adjusted to template rendering parameters, the offline rendering module 2 is used to render the to-be-rendered scene according to the template rendering parameters to obtain an initial rendering image, the mapping relationship acquisition module 3 is used to input the final rendering parameters and the template rendering parameters into a pre-trained Diffusion network model to obtain a mapping relationship between the template rendering parameters and the final rendering parameters, the image enhancement module 4 is used to predict noise information in the initial rendering image according to the mapping relationship through the pre-trained Diffusion network model, enhance the initial rendering image by subtracting the noise information, and predict the noise information of the current image through multiple iterations until the enhanced image meets the final rendering parameters, and output a final rendering image. In the present application, after obtaining the rendering scene and the final rendering parameters of the user, the final rendering parameters are adjusted to the preset template rendering parameters, the template rendering parameters can achieve fast rendering while retaining as much information in the 3D scene as possible, and then the scene is rendered through the template rendering parameters. In this way, an initial rendering image with low quality can be quickly obtained. Then, the pre-trained Diffusion network model is introduced, the initial rendering image is enhanced through the pre-trained Diffusion network model compared with the final rendering parameters, and the final rendering image is obtained through multiple iterations. In this way, a high-quality rendering image meeting the user's requirements can be obtained, and a lot of time is not spent in the offline rendering process.
[0086] Embodiment three:
[0087] The present embodiment provides a storage medium, the storage medium stores a computer program, when the computer program is executed by a host, each step in the above method is realized;
[0088] It can be understood that the storage medium mentioned above can be a read-only memory, a disk or an optical disk, etc.
[0089] It can be understood that the same or similar parts in the above embodiments can be mutually referred to, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0090] It should be noted that in the description of the present application, the terms "first", "second", etc. are only used for the purpose of description, and cannot be understood as indicating or implying relative importance. In addition, in the description of the present application, unless otherwise specified, the meaning of "a plurality of" is at least two.
[0091] Any procedural or methodological descriptions in flow charts or otherwise described herein can be understood to represent modules, segments, or portions of code that include executable instructions for implementing the specific logical functions or steps, and the scope of preferred embodiments of the present application includes additional implementations in which the functions are performed in a different order, including substantially simultaneously, or in reverse order, as will be understood by those skilled in the art to which embodiments of the present application pertain.
[0092] It should be understood that portions of the present application can be realized with hardware, software, firmware or a combination thereof. In the above embodiments, a plurality of steps or methods can be realized as software or firmware to be executed by a suitable instruction-executing system and stored in a storage. For example, if realized with hardware, and as in another embodiment, any one or a combination of the following technologies known in the art can be used: discrete logic circuitry having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and the like.
[0093] Those skilled in the art can understand that all or part of the steps carried out by the above-mentioned embodiments can be completed by programs instructing relevant hardware, and the programs can be stored in a computer-readable storage medium, and when executed, include one or a combination of steps of the method embodiments.
[0094] In addition, each functional unit in each embodiment of the present application can be integrated into one processing module, or each unit can exist physically independently, or two or more units can be integrated into one module. The above-mentioned integrated module can be realized in the form of hardware or in the form of a software functional module. When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0095] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0096] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0097] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary and are not to be construed as limiting the present application, and that variations, modifications, substitutions and changes can be made by those skilled in the art without departing from the scope of the present application.
Claims
1. A method for implementing offline rendering of images based on Diffusion, characterized in that, The method comprises: acquiring a scene to be rendered and final rendering parameters, and adjusting the final rendering parameters to template rendering parameters; rendering the scene to be rendered through the template rendering parameters to obtain an initial rendering image; inputting the final rendering parameters and the template rendering parameters into a pre-trained Diffusion network model to obtain a mapping relationship between the template rendering parameters and the final rendering parameters; the pre-trained Diffusion network model predicts noise information in the initial rendering image according to the mapping relationship, enhances the initial rendering image by subtracting the noise information, and predicts noise information of a current image through multiple iterations until the enhanced image meets the final rendering parameters, and outputs a final rendering image.
2. The method of claim 1, wherein the training process of the Diffusion network model comprises: step S201, obtaining a target rendering image using offline rendering based on the final rendering parameters of the user and the scene to be rendered; step S202, obtaining an initial rendering image using offline rendering based on the template rendering parameters and the scene to be rendered; step S203, obtaining multiple sets of target rendering images and initial rendering images through different final rendering parameters and template rendering parameters; step S204, randomly selecting a set of initial rendering images and target rendering images, adding Gaussian noise information to the target rendering image based on a preset number n to obtain multiple Gaussian noise images, the target rendering image with Gaussian noise added for the first time being a first Gaussian noise image, and the image with Gaussian noise added for the last time being an n-th Gaussian noise image; step S205, inputting the target rendering image into a unet network structure, outputting first noise information predicted by the unet network structure to exist in the target rendering image, and calculating a loss value between the target rendering image with the first noise information added and the first Gaussian noise image, based on the minimum loss value, updating parameters of the unet network structure; step S206, inputting the first Gaussian noise image into the updated unet network structure, outputting second noise information existing in the first Gaussian noise image, calculating a loss value between the first Gaussian noise image with the second noise information added and a second Gaussian noise image, based on the minimum loss value, continuing to update parameters of the unet network structure; step S207, repeating step S206 until the n-th Gaussian noise image is input into the unet network structure updated last time, outputting n+1 noise information existing in the n-th Gaussian noise image, calculating a loss value between the n-th Gaussian noise image with the n+1 noise information added and the initial rendering image, based on the minimum loss value, updating parameters of the unet network structure, and completing training of a set of initial rendering images and target rendering images. Step S208, repeat steps S204 to S207 to complete the training of multiple sets of initial rendering images and target rendering images until the unet network structure converges completely to obtain a pre-trained Diffusion network model.
3. The method of claim 2, wherein, Also includes: The loss value is the similarity between the image after adding noise information to the input image of the unet network structure and the Gaussian noise image after randomly adding Gaussian noise to the input image.
4. The method of claim 1 or 2, wherein, The obtaining of the initial rendering image or the target rendering image comprises: inputting the scene to be rendered and the final rendering parameter into an offline renderer, and rendering the scene to be rendered by the offline renderer according to the final rendering parameter to obtain the target rendering image; Or, inputting the scene to be rendered and the template rendering parameter into an offline renderer, and rendering the scene to be rendered by the offline renderer according to the template rendering parameter to obtain the initial rendering image.
5. The method of claim 1, wherein, The final rendering image output by the pre-trained Diffusion network model comprises a JPEG format image, a PNG format image, a TIFF format image or an EXR format image.
6. The method of claim 1, wherein, The template rendering parameter or the final rendering parameter comprises a resolution, a sampling parameter, a light source and a material parameter.
7. An apparatus for implementing offline rendering of images based on Diffusion, characterized in that, The device comprises: a preprocessing module configured to obtain a scene to be rendered and a final rendering parameter, and adjust the final rendering parameter to a template rendering parameter; an offline rendering module configured to render the scene to be rendered according to the template rendering parameter to obtain an initial rendering image; a mapping relationship obtaining module configured to input the final rendering parameter and the template rendering parameter into a pre-trained Diffusion network model to obtain a mapping relationship between the template rendering parameter and the final rendering parameter; an image enhancement module configured to predict noise information in the initial rendering image according to the mapping relationship by using the pre-trained Diffusion network model, enhance the initial rendering image by subtracting the noise information, and predict noise information of a current image through multiple iterations until the enhanced image meets the final rendering parameter, and output a final rendering image.
8. A storage medium, characterized by The storage medium stores a computer program, and the computer program is executed by the host processor to implement each step of the method for realizing offline rendering of images based on Diffusion according to any one of claims 1-6.
Citation Information
Patent Citations
Medical image reconstruction method and device, computer equipment and storage medium
CN114693821A
Image rendering method and device
CN115861522A