Model training method, map determination method, device, and equipment
By building a map prediction model based on training data of ambient light and multiple point light source images, the problem of overexposure information loss during material parameter estimation in deep neural network is solved, efficient and accurate material parameter acquisition is achieved, and shooting conditions are simplified. .
Patent Information
- Application Number
- CN202210488281.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2024-11-05
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, when estimating material parameters in deep neural networks, there is a problem of loss of information in overexposure area, and the input method of multiple material images is long and harsh.
By obtaining training data composed of an image of the target object under ambient light and multiple images under a point light source, a map prediction model is obtained. The model inputs an image of the object under ambient light and a point Images under the light source and maps of the output objects solve the problem of loss of information in the overexposure area and reduce the harshness of shooting conditions.
It realizes the rapid acquisition of objects' maps without losing overexposure area information, and does not require strict shooting conditions, improving the efficiency and accuracy of material parameter estimation.
Smart Images

Figure CN115063645B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to graphics rendering technology, and in particular to a model training method, a texture determination method, a device, and a device. Background Art
[0002] Augmented Reality (AR) refers to a technology that uses the position and angle of camera images and image analysis technology to combine and interact with the virtual world on the screen. With the development of computer graphics and rendering engine-related technologies, the application scenarios of AR have also expanded from entertainment to industry, medicine, education and other fields, which puts higher requirements on the realism and immersion of applications. The realism and immersion of AR applications come from the precise positioning and realistic rendering of virtual objects. When rendering virtual objects, the rendering engine needs the object's geometry, color information, and lighting information, and uses the lighting model to calculate the results. The creation of realistic virtual objects depends on geometric modeling and material modeling, among which efficient modeling, storage, and use of object materials are crucial.
[0003] In the prior art, deep convolutional neural networks built based on convolutional neural networks (CNN) such as autoencoder and generative adversarial network (GAN) can estimate the spatially varying bidirectional reflectance distribution function (SVBRDF) material parameters required by the physically based rendering (PBR) method from the material image. Most of the existing deep neural network methods for estimating material parameters use a single point light source image as input to generate material parameters.
[0004] However, this method has the problem of losing information in the overexposed area. Summary of the invention
[0005] The present disclosure provides a model training method, a mapping determination method, a device, and a device, and the information of overexposed areas will not be lost.
[0006] According to a first aspect of the present disclosure, a model training method is provided, the method comprising:
[0007] Acquire a training data set; the training data set includes multiple groups of training data, each group of the training data includes a first image and multiple second images of a target object, and a labeled map of the target object; wherein the labeled map is a map of the target object that is pre-labeled; the first image is used to represent the image of the target object under ambient light, and the second image is used to represent the image of the target object under a point light source; wherein the map is used to represent the material parameters of the target object;
[0008] Inputting the first image and the plurality of second images of the target object into a preset model to obtain a predicted map of the target object;
[0009] According to the labeled map and the predicted map of the target object, the parameters in the preset model are adjusted to obtain a map prediction model, and the map prediction model is used to determine the map of the object according to the image of the object.
[0010] According to a second aspect of the present disclosure, a method for determining a map is provided, the method comprising:
[0011] Acquire a first image and a second image of a target object; wherein the first image is used to represent an image of the target object under ambient light; and the second image is used to represent an image of the target object under a point light source;
[0012] Inputting the first image and the second image of the target object into a preset texture prediction model to obtain a texture corresponding to the target object; wherein the texture is used to characterize the material parameters of the target object;
[0013] The map prediction model is trained using a training data set, which includes multiple groups of training data, each group of training data includes a first image and multiple second images of a target object used for model training, and an annotated map of the target object.
[0014] According to a third aspect of the present disclosure, a model training device is provided, the device comprising:
[0015] An acquisition unit is used to acquire a training data set; the training data set includes multiple groups of training data, each group of the training data includes a first image and multiple second images of a target object, and a labeled map of the target object; wherein the labeled map is a map of the target object that is pre-labeled; the first image is used to represent the image of the target object under ambient light, and the second image is used to represent the image of the target object under a point light source; wherein the map is used to represent the material parameters of the target object;
[0016] A training unit, used for inputting the first image and the plurality of second images of the target object into a preset model to obtain a predicted map of the target object;
[0017] The training unit is also used to adjust the parameters in the preset model according to the labeled map and the predicted map of the target object to obtain a map prediction model, and the map prediction model is used to determine the map of the object according to the image of the object.
[0018] According to a fourth aspect of the present disclosure, a mapping determination device is provided, the device comprising:
[0019] An acquisition unit, used for acquiring a first image and a second image of a target object; wherein the first image is used to represent an image of the target object under ambient light; and the second image is used to represent an image of the target object under a point light source; wherein the map is used to represent material parameters of the target object;
[0020] A determination unit, configured to input the first image and the second image of the target object into a preset texture prediction model to obtain a texture corresponding to the target object;
[0021] The map prediction model is trained using a training data set, which includes multiple groups of training data, each group of training data includes a first image and multiple second images of a target object used for model training, and an annotated map of the target object.
[0022] According to a fifth aspect of the present disclosure, an electronic device is provided, including a memory and a processor; wherein:
[0023] The memory is used to store computer programs;
[0024] The processor is used to read the computer program stored in the memory and execute the method as described in the first aspect and the second aspect according to the computer program in the memory.
[0025] According to a sixth aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in the first aspect or the second aspect is implemented.
[0026] According to a seventh aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method described in the first aspect or the second aspect is implemented.
[0027] The model training method, map determination method, device, and equipment provided by the present disclosure include: obtaining a training data set; the training data set includes multiple groups of training data, each group of training data includes a first image and multiple second images of a target object, and a labeled map of the target object; wherein the labeled map is a map of the target object that is pre-labeled; the first image is used to characterize the image of the target object under ambient light, and the second image is used to characterize the image of the target object under a point light source; wherein the map is used to characterize the material parameters of the target object; the first image and the multiple second images of the target object are input into a preset model to obtain a predicted map of the target object; according to the labeled map and the predicted map of the target object, the parameters in the preset model are adjusted to obtain a map prediction model, and the map prediction model is used to determine the map of the object according to the image of the object. In the model training method, map determination method, device, and equipment provided by the present solution, a map prediction model can be obtained based on training data consisting of an image of the target object under ambient light and multiple images under point light sources. When the map prediction model is in use, an image of the object under ambient light and an image under a point light source are input, and a map of the object is output. The image under ambient light contains material color information, and the image under the point light source contains material reflectivity information. In this way, the problem of loss of overexposed area information when generating object maps in the prior art can be solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A flowchart of a model training method according to an exemplary embodiment of the present disclosure is shown;
[0029] Figure 2 A flowchart of a model training method according to another exemplary embodiment of the present disclosure is shown;
[0030] Figure 3 A schematic diagram of data concentration of original data shown in an exemplary embodiment of the present disclosure;
[0031] Figure 4 A schematic diagram of a predicted map and a third image shown as an exemplary embodiment of the present disclosure;
[0032] Figure 5 A schematic diagram of mask convergence results is shown for an exemplary embodiment of the present disclosure;
[0033] Figure 6 A schematic flow chart of a method for determining a map according to an exemplary embodiment of the present disclosure;
[0034] Figure 7 A schematic diagram showing the effects of using different second images as model inputs according to an exemplary embodiment of the present disclosure;
[0035] Figure 8A schematic diagram of a process of obtaining a re-rendered image is shown as an exemplary embodiment of the present disclosure;
[0036] Fig. 9 A structural diagram of a model training device shown as an exemplary embodiment of the present disclosure;
[0037] Fig.10 A structural diagram of a mapping determination device shown as an exemplary embodiment of the present disclosure;
[0038] Fig.11 The present invention is a structural diagram of an electronic device according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0039] Augmented Reality (AR) refers to a technology that allows the virtual world on the screen to combine and interact with the real world scene by calculating the position and angle of the camera image and adding image analysis technology. With the development of computer graphics and rendering engine related technologies, the application scenarios of AR have also expanded from entertainment to industry, medical care, education and other fields, which puts higher requirements on the realism and immersion of the application. The realism and immersion of AR applications come from the precise positioning and real rendering of virtual objects. When rendering virtual objects, the rendering engine needs the geometric and color information and lighting information of the object, and uses the lighting model to calculate the results. The establishment of realistic virtual objects depends on geometric modeling and material modeling, among which the efficient modeling, storage and use of object materials are crucial. In the prior art, the traditional methods for obtaining material parameters are usually manual production, photometer measurement, etc., or generated by material synthesis methods. However, with the development of deep learning theory and the popularization of its application, deep convolutional neural networks based on CNN such as AutoEncoder and GAN can estimate the SVBRDF material parameters required by the PBR method from material images.
[0040] However, most of the existing deep neural network methods for estimating material parameters take a single point light source image as input, which results in the problem of information loss in overexposed areas. The few methods that use multiple material images as input and optimize the generated material parameters are time-consuming and require harsh shooting conditions.
[0041] In order to solve the above technical problems, the solution provided by the present disclosure can obtain a texture prediction model based on training data consisting of one image of the target object under ambient light and multiple images under point light sources; when the texture prediction model is used, one image of the object under ambient light and one image under point light sources are input, and the texture of the object is output. The problem of losing information in overexposed areas when a single point light source image is used as input in the prior art is solved; and this solution is shorter in time than the prior art method of using multiple material images as input, and does not require harsh shooting conditions.
[0042] Figure 1 A flowchart of a model training method according to an exemplary embodiment of the present disclosure.
[0043] like Figure 1 As shown, the model training method provided in this embodiment includes:
[0044] Step 101, obtaining a training data set; the training data set includes multiple groups of training data, each group of training data includes a first image and multiple second images of a target object, and a labeled map of the target object; wherein the labeled map is a map of the target object that is pre-labeled; the first image is used to represent the image of the target object under ambient light, and the second image is used to represent the image of the target object under a point light source; wherein the map is used to represent the material parameters of the target object.
[0045] The method provided in the present disclosure may be executed by an electronic device with computing capability, such as a computer, etc. The electronic device is capable of acquiring a training data set.
[0046] Specifically, the multiple second images may represent images of the target object under different point light sources.
[0047] Ambient light refers to the color that is superimposed on the color of all objects in the scene. After the ambient light is created, it will be applied globally. Ambient light has no specific source direction and usually cannot be used as the only light source in the scene because it will render all objects in the scene with the same color. The purpose of introducing other light sources in the scene is to weaken the shadows.
[0048] Among them, a point light source refers to a point in space that emits light in all directions (no shadow will be generated because the point light source emits light in all directions). A point light source is a light source that emits light from a single point and illuminates all directions, such as a flare in the night sky.
[0049] Among them, material refers to the texture of an object. Material can be seen as a combination of material and texture. In the rendering program, material is a combination of various visual attributes of the surface, which refers to the color, texture, smoothness, transparency, reflectivity, refractive index, luminosity, etc. These visual attribute values are material parameters.
[0050] Specifically, the material parameters of the target object can be saved in the form of an image, thus obtaining a map.
[0051] The annotated material parameters of the target object are saved in the form of an image, and the image is the annotated map.
[0052] Step 102: input the first image and the plurality of second images of the target object into a preset model to obtain a predicted map of the target object.
[0053] The preset model is a pre-set network model, which is set based on a convolutional neural network.
[0054] The preset model can process the first image and the plurality of second images of the target object and output a predicted map of the target object, wherein the predicted map is used to characterize the predicted material parameters of the target object.
[0055] Step 103, according to the labeled texture and the predicted texture of the target object, the parameters in the preset model are adjusted to obtain a texture prediction model, and the texture prediction model is used to determine the texture of the object according to the image of the object.
[0056] Specifically, the labeled map of the target object can be used as the label of the predicted map of the target object, and the preset model can be trained to optimize the parameters in the preset model. The predicted map and the labeled map are made closer and closer. When the preset conditions are met, such as when the predicted map and the labeled map are 80% identical, the training is stopped to obtain the map prediction model.
[0057] Furthermore, a loss function can be constructed based on the predicted map and the labeled map, and then gradient feedback can be performed based on the loss function to adjust the parameters in the preset model so that the predicted map output by the preset model is closer and closer to the labeled map.
[0058] The model training method provided by the present disclosure includes: obtaining a training data set; the training data set includes multiple groups of training data, each group of training data includes a first image and multiple second images of a target object, and an annotated map of the target object; wherein the annotated map is a map of the target object annotated in advance; the first image is used to characterize the image of the target object under ambient light, and the second image is used to characterize the image of the target object under a point light source; wherein the map is used to characterize the material parameters of the target object; the first image and multiple second images of the target object are input into a preset model to obtain a predicted map of the target object; according to the annotated map and the predicted map of the target object, the parameters in the preset model are adjusted to obtain a map prediction model, and the map prediction model is used to determine the map of the object according to the image of the object. In the method adopted by the present disclosure, a map prediction model can be obtained based on training data consisting of an image of the target object under ambient light and multiple images under a point light source; when the map prediction model is used, an image of the object under ambient light and an image under a point light source are input, and the map of the object is output. The method provided by the present disclosure does not have the problem of information loss in overexposed areas; and it takes a short time to obtain the object map, and does not require harsh shooting conditions.
[0059] Figure 2 A flowchart of a model training method shown in another exemplary embodiment of the present disclosure.
[0060] like Figure 2 As shown, the model training method provided in this embodiment includes:
[0061] Step 201, obtaining an original data set; the original data set includes a labeled map of a target object; rendering the labeled map using a preset ambient light image to obtain a first image, and / or rendering the labeled map using preset point light source parameters to obtain a second image; wherein the labeled map is a map of a pre-labeled target object; wherein the map is used to characterize material parameters of the target object.
[0062] Specifically, after step 201, step 202A or step 202B may be executed.
[0063] The preset point light source parameters are point light source parameters pre-set according to actual conditions, wherein the point light source parameters may include direction, distance, intensity information, etc. of the point light source.
[0064] The ambient light image refers to an image under any ambient light. Specifically, the ambient light image can be obtained from the Internet. Specifically, the ambient light image can be a high dynamic range image (i.e., a 360-degree panoramic image).
[0065] The model is a description of a three-dimensional object using a strictly defined language or data structure, which includes geometry, viewpoint, texture, and lighting information. Rendering is the process of projecting a model in a three-dimensional scene into a digital image in two dimensions according to the set environment, lighting, material, and rendering parameters.
[0066] For example, the annotation map can be rendered by a VRay renderer.
[0067] Specifically, the annotation map may be rendered using a preset ambient light image to obtain a first image of the target object, wherein the first image is used to represent an image of the target object under ambient light.
[0068] Specifically, the annotation map can be rendered using preset point light source parameters to obtain a second image of the target object. Further, the annotation map can be rendered using different preset point light source parameters to obtain multiple second images of the target object. The second image is used to represent the image of the target object under the preset point light source.
[0069] In one possible implementation, the labeled map includes a labeled normal map, a labeled diffuse map, a labeled roughness map, and a labeled reflectivity map.
[0070] Among them, the normal map is to draw a normal line at each point of the concave and convex surface of the original object of the target object, and mark the direction of the normal line through the RGB color channel. It can be understood as another different surface parallel to the original concave and convex surface, but in fact it is just a smooth plane. For visual effects, it is more efficient than the original concave and convex surface. If a light source is applied at a specific position, a surface with a low degree of detail can generate a precise lighting direction and reflection effect with a high degree of detail.
[0071] Among them, red (red, R), green (green, G), and blue (blue, B) are called the three primary colors. The RGB color model is a color standard in the industry. It obtains various colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB represents the colors of the three channels of red, green, and blue. This standard covers almost all colors that can be perceived by human vision and is one of the most widely used color systems.
[0072] The diffuse map is also called the color map, which can show the color and intensity of the object when it is illuminated by light.
[0073] The roughness map is a black and white image that controls the roughness of the micro surface of the model. The whiter the pixels in the image, the rougher the micro surface, the more dispersed the direction range of the reflected light of a single pixel, and the less clear the surrounding environment is mapped to the model surface.
[0074] Among them, the reflectivity map is a black and white image. The whiter the pixel, the stronger the specular reflection, and the darker the pixel, the weaker the specular reflection. It is used to show the degree of reflectivity of the model surface (plastic>wood>skin>cloth), thereby distinguishing different materials.
[0075] like Figure 3 The following is an example of the data in the original dataset. Figure 3 Each row in represents the image of the target object under the point light source, and the labeled normal map, labeled diffuse map, labeled roughness map, and labeled reflectivity map of the target object from left to right.
[0076] Specifically, the ambient light parameters may be extracted from a preset ambient light image.
[0077] The marked normal map, the marked diffuse map, the marked roughness map, and the marked reflectivity map are rendered using the ambient light parameters to obtain a first image.
[0078] Specifically, based on an image based lighting (IBL) method, the extracted ambient light parameters may be used to render the labeled normal map, the labeled diffuse map, the labeled roughness map, and the labeled reflectivity map to obtain the first image.
[0079] Specifically, the preset ambient light image can be pre-filtered by diffuse reflection and specular reflection to obtain the corresponding ambient light map, and then a bidirectional reflectance distribution function (BRDF) integral lookup table is obtained through importance sampling, and then the labeled normal map, labeled diffuse reflection map, labeled roughness map, and labeled reflectivity map are rendered according to the lighting model, and the rendering result obtained is the first image of the target object.
[0080] Among them, BRDF is used to describe the relationship between reflected light and incident light, that is, for a given number and direction of incident light, the brightness of the outgoing light in a specified direction is calculated.
[0081] The labeled normal map, the labeled diffuse map, the labeled roughness map, and the labeled reflectivity map are rotated according to a preset rotation angle, and images are captured from the rotated labeled normal map, the labeled diffuse map, the labeled roughness map, and the labeled reflectivity map according to a preset interception position to obtain a local material map; the local material map includes a local normal map, a local diffuse map, a local roughness map, and a local reflectivity map.
[0082] The preset rotation angle is a preset rotation angle. The same preset rotation angle can be used to rotate the normal map, diffuse map, roughness map, and reflectivity map.
[0083] The preset interception position is a preset interception position. The same interception position can be used to intercept images in the rotated annotated normal map, the annotated diffuse map, the annotated roughness map, and the annotated reflectivity map to obtain a local material map.
[0084] Specifically, the following formula can be used to intercept the image at the center of the rotated annotated normal map to obtain a local normal map;
[0085]
[0086] s~U(1,1.3)
[0087] Where l represents the height of the local normal map; H represents the pixel size of the labeled normal map; s represents the scaling factor, where s is uniformly distributed from 1 to 1.3; A represents the rotation angle, and A∈[0,2π); the symbol Indicates rounding down.
[0088] Similarly, you can capture an image in the rotated annotated diffuse map to obtain a local diffuse map; capture an image in the rotated annotated roughness map to obtain a local roughness map; capture an image in the rotated annotated reflectivity map to obtain a local reflectivity map.
[0089] Specifically, the local normal map, local diffuse map, local roughness map, and local reflectivity map included in the same local material map can be obtained using the same scaling factor and rotation angle; different local material maps can be obtained using different scaling factors and different rotation angles.
[0090] The local material map is rendered using preset point light source parameters to obtain a second image.
[0091] Specifically, the local normal map, the local diffuse reflection map, the local roughness map, and the local reflectivity map may be rendered using preset point light source parameters to obtain a second image.
[0092] Specifically, different point light source parameters may be used to render different local material maps to obtain a plurality of second images.
[0093] Step 202A: Encode the first image using a first encoding module in a preset model to obtain a first vector of the target object.
[0094] Specifically, step 203 may be executed after step 202A.
[0095] Specifically, the first encoding module may perform convolution on the first image to generate a first vector of the target object.
[0096] Specifically, the first encoding module can generate a deep neural network for dual-channel materials based on a conditional adversarial generation network. The convolution module of each layer of the first encoding module can be composed of a convolution layer-linear rectifier unit-instance normalization. The input image resolution of the first encoding module can be 256×256. The first encoding module can be composed of 8 convolution modules, and the number of channels can be 64-128-256-512-512-512-512-512 respectively, and the dimension of each channel feature map (width and height are equal) can be 128-64-32-16-8-4-2-1.
[0097] Step 202B: Encode the second image using a second encoding module in the preset model to obtain a second vector of the target object.
[0098] Specifically, the second encoding module may convolve the second image to generate a second vector of the target object.
[0099] Specifically, the second encoding module can generate a deep neural network for a dual-channel material based on a conditional adversarial generative network. The convolution module of each layer of the second encoding module can be composed of a convolution layer-linear rectifier unit-instance normalization. The input image resolution of the second encoding module can be 128×128. The second encoding module can be composed of 7 convolution modules, and the number of channels can be 64-128-256-512-512-512-512-512 respectively, and the dimension of each channel feature map (width and height are equal) can be 64-32-16-8-4-2-1.
[0100] Step 203: Determine a target vector of the target object according to the first vector and the plurality of second vectors.
[0101] Specifically, the first vector and the plurality of second vectors may be processed to obtain processed vectors, and the processed vectors may be determined as target vectors of the target object.
[0102] In one possible implementation, the second vector is an N-dimensional vector; the parameters of the preset model also include a current mask vector, which is an N-dimensional vector; the product between the current mask vector and the second vector is determined to obtain a plurality of fourth vectors, and an average value of the plurality of fourth vectors is determined as the third vector of the target object;
[0103] Specifically, the value of each dimension data in the current mask vector is 0 or 1.
[0104] Specifically, the product between the current mask vector and the second vector refers to multiplying the current mask vector and data of the same dimension of the second vector.
[0105] The first vector and the third vector are connected to obtain a target vector of the target object.
[0106] Specifically, the first vector and the third vector are concatenated into one vector to obtain a target vector of the target object.
[0107] In an optional implementation, a separate module may be provided in the preset model to execute step 203, or step 203 may be executed by the first encoding module or the second encoding module.
[0108] Step 204: Decode the target vector using a decoding module in the preset model to obtain a predicted map of the target object.
[0109] Specifically, after step 204, step 205A, or 205B, or step 205C, or step 205D may be executed.
[0110] Specifically, the decoding module may perform a transposed convolution on the target vector to generate a predicted map of the target object.
[0111] In an implementable manner, the decoding module includes a first decoder and a second decoder; the predicted map of the target object includes a predicted normal map, a predicted roughness map, a predicted diffuse reflection map, and a predicted reflectivity map; wherein the normal map is used to characterize the normal parameters of the target object; the diffuse reflection map is used to characterize the diffuse reflection parameters of the target object; the roughness map is used to characterize the roughness parameters of the target object; and the reflectivity map is used to characterize the reflectivity parameters of the target object; the target vector is decoded using the first decoder to obtain the predicted normal map and the predicted roughness map of the target object;
[0112] The target vector is decoded by using a second decoder to obtain a predicted diffuse reflection map and a predicted reflectivity map of the target object.
[0113] Specifically, the convolution module of each layer of the decoding module can be composed of a transposed convolution layer-a linear rectifier unit-an instance normalization. The resolution of the predicted map output by the decoding module can be 256×256. The decoding module can be composed of 8 convolution modules; wherein the number of channels of the first decoder can be 512-512-512-512-256-128-64-4, the number of channels of the second decoder can be 512-512-512-512-256-128-64-6, and the dimension of each channel feature map (width and height are equal) can be 2-4-8-16-32-64-128-256. The convolution module <block 2 to block 8> in the decoding module can be connected to the output of the corresponding convolution module <block 7 to block 1> of the first encoding module to form a skip connection. The convolution kernel size can be 4, and the convolution step size can be 2.
[0114] Specifically, the inputs of the first decoder and the second decoder are both target vectors.
[0115] Step 205A, determining a first loss function and / or a second loss function according to the labeled map and the predicted map.
[0116] In one possible implementation, the formula of the first loss function is:
[0117] L p =‖PP gt ‖1
[0118] Where P represents the predicted map of the target object; P gt is the labeled map of the target object; ‖‖1 represents the L1 norm, which is equivalent to finding the absolute value of the difference;
[0119] The formula for the second loss function is:
[0120] L adv1 = E[logDis(X gt)]+E[log(1-Dis(X))]
[0121] Where X represents the predicted map; X gt Represents the labeled map; Dis represents the discriminator operation; E represents the expected sign.
[0122] Specifically, the predicted maps include predicted normal maps, predicted roughness maps, predicted diffuse maps, and predicted reflectivity maps; the annotated maps include annotated normal maps, annotated roughness maps, annotated diffuse maps, and annotated reflectivity maps.
[0123] Through the above formula, when the predicted map is a predicted normal map and the labeled map is a labeled normal map, the second loss function A can be obtained; when the predicted map is a predicted roughness map and the labeled map is a labeled roughness map, the second loss function B can be obtained; when the predicted map is a predicted diffuse map and the labeled map is a labeled diffuse map, the second loss function C can be obtained; when the predicted map is a predicted reflectivity map and the labeled map is a labeled reflectivity map, the second loss function D can be obtained; therefore, a total of four second loss functions can be obtained.
[0124] Specifically, the preset model may also include a discriminator. Specifically, the preset model may include 4 parameter discriminators (used to obtain four second loss functions respectively) and 1 re-rendering discriminator (used to obtain the fourth loss function), which have the same structure. The convolution module of each layer of each discriminator consists of a transposed convolution layer-linear rectifier unit-instance normalization. The map can be used as the input of the discriminator, where the resolution of the map can be 256×256. Each discriminator can be composed of 5 convolution modules, the number of channels can be 64-128-256-1024-1 respectively, and the dimension of each channel feature map (width and height are equal) can be 128-64-32-30-14; the convolution kernel size can be 4, and the convolution step size can be 2. In the penultimate convolution module, the second vector can be used as a priori condition input and input in series with the original input of the discriminator.
[0125] Step 205B, determining a third loss function and / or a fourth loss function according to the labeled map, the predicted map, and the parameters of the random point light source.
[0126] Specifically, point light source parameters may be randomly generated from the same distribution to obtain random point light source parameters.
[0127] Specifically, the annotation map and the prediction map may be rendered respectively using random point light source parameters, and the third loss function and / or the fourth loss function may be determined according to the rendering results.
[0128] In one possible implementation, the prediction map is rendered using random point light source parameters to obtain a third image of the target object;
[0129] The annotation map is rendered using the random point light source parameters to obtain a fourth image of the target object.
[0130] Specifically, the third image and the fourth image of the same target object can be rendered using the same point light source parameters, and different target objects can be rendered using different point light source parameters to obtain the third image or the fourth image.
[0131] Determine a third loss function according to an absolute value of a difference between the third image and the fourth image; and / or determine a fourth loss function based on the following formula:
[0132] L adv2 =E[logDis(Y gt )]+E[log(1-Dis(Y))]
[0133] Wherein, Y represents the third image; Y gt represents the fourth image; Dis represents the discriminator operation; E represents the expected sign.
[0134] like Figure 4 As shown, the large image in the first image of each row is the first image of the target object, and the small image is the second image of the target object; the second image to the fifth image in each row are the predicted normal map, predicted roughness map, predicted diffuse map, and predicted reflectivity map of the target object, respectively; the last image in each row is the third image of the target object.
[0135] Step 205C, determining a target mask vector corresponding to the target object according to each dimensional data in the multiple second vectors of the target object, and determining a fifth loss function according to the absolute value of the difference between the target mask vector and the current mask vector.
[0136] Among them, the value of each dimension data in the target mask vector is 0 or 1.
[0137] Specifically, the current mask vector may be set as a variable that maintains gradient information, and the initial value may be set to all 1s.
[0138] In one possible implementation, the second vector is an N-dimensional vector; the target mask vector is an N-dimensional vector; and the variance of each dimensional data is determined according to the multiple second vectors of the target object;
[0139] The variances are sorted to obtain a sorting result, and the intermediate value corresponding to each dimension of data is determined according to the sorting result; the intermediate values are combined to obtain the intermediate vector of the target object;
[0140] Specifically, the value of the middle value is 0 or 1. For example, the middle value corresponding to the first 50% of the variance in the sorting result can be determined as 0, and the middle value corresponding to the last 50% of the variance can be determined as 1.
[0141] Optionally, the middle values corresponding to the first K variances in the sorting results are determined to be 0;
[0142] The middle value corresponding to the last (NK) variances in the sorting result is determined to be 1; wherein K is less than or equal to N.
[0143] According to the intermediate vectors of multiple target objects, determine the data mean corresponding to each dimension of data;
[0144] The comparison result is obtained by comparing the mean value with the preset value, and the target mask value corresponding to each dimension of data is determined according to the comparison result; the target mask values are combined to obtain the target mask vector of the target object.
[0145] The preset value is a value preset according to actual conditions, for example, it may be 0.25.
[0146] Optionally, if the mean is greater than or equal to a preset value, the target mask value corresponding to the mean is determined to be 1;
[0147] If the mean is less than the preset value, the target mask value corresponding to the mean is determined to be 0.
[0148] Step 205D, determining a sixth loss function based on the third vector, the second vector, and the current mask vector.
[0149] The formula of the sixth loss function is:
[0150]
[0151] Among them, z p represents the third vector; Represents the i-th dimension data of the second vector; i is less than or equal to N; M represents the current mask vector; the symbol ⊙ represents multiplication; ‖‖1 represents the L1 norm, which is equivalent to taking the absolute value of the difference; (1-M) represents the inversion of M.
[0152] Step 206, adjust the parameters in the preset model according to at least one of the first loss function, the second loss function, the third loss function, the fourth loss function, the fifth loss function, and the sixth loss function to obtain a texture prediction model; the texture prediction model is used to determine the texture of the object based on the image of the object.
[0153] Optionally, a multi-stage training method can be used to ensure that the training of different parts of the network of the preset model does not interfere with each other and proceeds stably.
[0154] For example, in the first stage, the entire network can be pre-trained, and only the first loss function is used as the loss value. The initial value of the network weight can be obtained by random initialization. The pre-training stage can de-randomize the network weight so that the latent space has a certain dimensional stability. Among them, the latent space is the high-dimensional space where the first vector and the second vector are located.
[0155] In the second stage, the first loss function, the second loss function, the third loss function, the fourth loss function, and the fifth loss function can be used to optimize the network and converge the dimensional mask. The mask is not fully optimized at this stage, and the discriminator does not use the second vector as a priori condition.
[0156] In the third stage, the first loss function, the second loss function, the third loss function, the fourth loss function, and the sixth loss function are used to optimize the entire network weight and latent space so that the loss of the obtained predicted map is gradually reduced.
[0157] In one implementable method, in the first stage, only the first loss function can be used as the loss value and trained for 50,000 iterations; a second image and a first image are used as inputs of the preset model, and two latent vectors (i.e., the second vector and the first vector) are generated by the second encoding module and the first encoding module respectively, and the two are input into the decoding module in series to generate a predicted map, calculate the parameter loss, and use the back propagation function in Python to calculate the gradient (backward) to calculate the gradient, and use the update network weight (step) function in Python to update the network weight; the discriminator may not be used; wherein Python is an open source neural network framework.
[0158] In the second stage, the first loss function, the second loss function, the third loss function, the fourth loss function, and the fifth loss function can be used as loss values and trained for 50,000 iterations; the eight second images and the first image can be used as inputs of the preset model, and the second encoding module and the first encoding module generate eight second vectors and one first vector respectively; the intermediate vector of the target object is calculated based on the eight second vectors, the mask loss is calculated, and the mask value is updated using the Stochastic Gradient Descent (SGD) optimizer. The eight second vectors are averaged and multiplied with the current mask vector, and the product and the first vector are input into the decoding module in series to generate a predicted map and calculate the parameter loss; the material discriminator (the discriminator in the second loss function) and the rendering discriminator (the discriminator in the fourth loss function) are used to calculate the adversarial loss, the backward function can be used to calculate the gradient, and the step function can be used to update the network weights; the convergence results of the mask in this stage are as follows: Figure 5 shown.
[0159] In the third stage, the first loss function, the second loss function, the third loss function, the fourth loss function, and the sixth loss function are used as loss values, and 400,000 iterations are trained. The 8 second images and the first image are used as the input of the preset model, and the second encoding module and the first encoding module generate 8 second vectors and 1 first vector respectively; the 8 second vectors are averaged and multiplied with the current mask vector, and the product and the first vector are serially input into the decoding module to generate a predicted map and calculate the parameter loss; the second vector is input into the discriminator as a priori condition, and the material discriminator (the discriminator in the second loss function) and the rendering discriminator (the discriminator in the fourth loss function) are used to calculate the adversarial loss. The backward function can be used to calculate the gradient, and the step function can be used to update the network weights; the batch_size of the three stages can all be 4. Among them, batch_size refers to the number of samples selected for one training (that is, the number of target objects).
[0160] Figure 6 The figure is a flowchart of a method for determining a map according to an exemplary embodiment of the present disclosure.
[0161] like Figure 6 As shown, the mapping determination method provided in this embodiment includes:
[0162] Step 601, acquiring a first image and a second image of a target object; wherein the first image is used to represent an image of the target object under ambient light; and the second image is used to represent an image of the target object under a point light source.
[0163] Specifically, the first image and the second image can be obtained by taking a photo with a mobile phone. Specifically, an image of the target object taken by the mobile phone under ambient light is used as the first image; the flash in the mobile phone is turned on, and the image of the target object taken under the flash is used as the second image. The flash in the mobile phone can be used as a point light source.
[0164] Specifically, the electronic device can obtain the first image and the second image taken by the mobile phone.
[0165] Step 602, inputting the first image and the second image of the target object into a preset texture prediction model to obtain a texture corresponding to the target object; wherein the texture is used to characterize the material parameters of the target object; wherein the texture prediction model is trained using a training data set, the training data set includes multiple groups of training data, each group of training data includes a first image and multiple second images of the target object used for model training, and an annotated texture of the target object.
[0166] Specifically, the map may include a normal map, a diffuse map, a roughness map, and a reflectivity map.
[0167] like Figure 7 As shown, the first image in each row is a second image of the target object; the second image is a first image A of the target object; the third image is a map obtained based on the second image and the first image A; the fourth image is a first image B of the target object; the fifth image is a map obtained based on the second image and the first image B; the sixth image is a first image C of the target object; and the seventh image is a map obtained based on the second image and the first image C.
[0168] The method provided by the present disclosure can use a first image and a second image as inputs of a texture prediction model, and the texture prediction model outputs a texture. And a single second image can provide sufficient reflection information.
[0169] Figure 8 The present invention is a schematic diagram of a process of obtaining a re-rendered image according to an exemplary embodiment of the present invention.
[0170] like Figure 8 As shown, first, a training data set can be determined based on the original data set, preset point light source parameters, and preset ambient light images.
[0171] Then, the training data set is input into the preset model. The preset model uses the training data set and goes through the first stage, the second stage, and the third stage. After these three stages of model training, a map prediction model is finally obtained.
[0172] A first image and a second image of the target object can be used as inputs of a texture prediction model, and the texture prediction model outputs a texture. The texture output by the texture prediction model is rendered using a point light source to obtain a re-rendered image of the target object.
[0173] Fig. 9 The figure is a structural diagram of a model training device according to an exemplary embodiment of the present disclosure.
[0174] like Fig. 9 As shown, the model training device 900 provided by the present disclosure includes:
[0175] The acquisition unit 910 is used to acquire a training data set; the training data set includes multiple sets of training data, each set of training data includes a first image and multiple second images of a target object, and an annotated map of the target object; wherein the annotated map is a map of the target object annotated in advance; the first image is used to represent the image of the target object under ambient light, and the second image is used to represent the image of the target object under a point light source; wherein the map is used to represent the material parameters of the target object;
[0176] A training unit 920, configured to input a first image and a plurality of second images of a target object into a preset model to obtain a predicted map of the target object;
[0177] The training unit 920 is further used to adjust the parameters in the preset model according to the labeled map and the predicted map of the target object to obtain a map prediction model, and the map prediction model is used to determine the map of the object according to the image of the object.
[0178] The preset model includes a first encoding module, a second encoding module, and a decoding module; a training unit 920 is specifically used to encode the first image using the first encoding module to obtain a first vector of the target object;
[0179] Encoding the second image using a second encoding module to obtain a second vector of the target object;
[0180] Determining a target vector of the target object based on the first vector and the plurality of second vectors;
[0181] The target vector is decoded using the decoding module to obtain the predicted map of the target object.
[0182] The second vector is an N-dimensional vector; the parameters of the preset model also include a current mask vector, which is an N-dimensional vector; the training unit 920 is specifically used to determine the product between the current mask vector and the second vector to obtain multiple fourth vectors, and determine the average value of the multiple fourth vectors as the third vector of the target object;
[0183] The first vector and the third vector are connected to obtain a target vector of the target object.
[0184] The decoding module includes a first decoder and a second decoder; the predicted map of the target object includes a predicted normal map, a predicted roughness map, a predicted diffuse reflection map, and a predicted reflectivity map; wherein the normal map is used to characterize the normal parameters of the target object; the diffuse reflection map is used to characterize the diffuse reflection parameters of the target object; the roughness map is used to characterize the roughness parameters of the target object; and the reflectivity map is used to characterize the reflectivity parameters of the target object; the training unit 920 is specifically used to decode the target vector using the first decoder to obtain the predicted normal map and the predicted roughness map of the target object;
[0185] The target vector is decoded by using a second decoder to obtain a predicted diffuse reflection map and a predicted reflectivity map of the target object.
[0186] The training unit 920 is specifically configured to determine the loss function based on at least one of the following methods:
[0187] Determine a first loss function and / or a second loss function according to the labeled map and the predicted map;
[0188] Determine a third loss function and / or a fourth loss function according to the labeled map, the predicted map, and the random point light source parameters;
[0189] Determine a target mask vector corresponding to the target object according to each dimension data in the plurality of second vectors of the target object, and determine a fifth loss function according to an absolute value of a difference between the target mask vector and the current mask vector;
[0190] Determine a sixth loss function according to the third vector, the second vector, and the current mask vector;
[0191] According to at least one of the first loss function, the second loss function, the third loss function, the fourth loss function, the fifth loss function, and the sixth loss function, the parameters in the preset model are adjusted to obtain a texture prediction model.
[0192] The formula of the first loss function is:
[0193] L p =||PP gt ||1
[0194] Where P represents the predicted map of the target object; P gt is the label map of the target object; ||||1 represents the L1 norm;
[0195] The formula for the second loss function is:
[0196] L adv1 = E[logDis(X gt )]+E[log(1-Dis(X))]
[0197] Where X represents the predicted map; X gt Represents the labeled map; Dis represents the discriminator operation; E represents the expected sign.
[0198] The training unit 920 is specifically used to render the predicted map using the random point light source parameters to obtain a third image of the target object;
[0199] Rendering the annotation map using random point light source parameters to obtain a fourth image of the target object;
[0200] Determine a third loss function according to an absolute value of a difference between the third image and the fourth image; and / or determine a fourth loss function based on the following formula:
[0201] L adv2 =E[logDis(Y gt )]+E[log(1-Dis(Y))]
[0202] Wherein, Y represents the third image; Y gt represents the fourth image; Dis represents the discriminator operation; E represents the expected sign.
[0203] The second vector is an N-dimensional vector; the target mask vector is an N-dimensional vector; the training unit 920 is specifically used to determine the variance of each dimensional data according to the multiple second vectors of the target object;
[0204] The variances are sorted to obtain a sorting result, and the intermediate value corresponding to each dimension of data is determined according to the sorting result; the intermediate values are combined to obtain the intermediate vector of the target object;
[0205] According to the intermediate vectors of multiple target objects, determine the data mean corresponding to each dimension of data;
[0206] Compare the mean value with the preset value to obtain a comparison result, and determine the target mask value corresponding to each dimension data according to the comparison result;
[0207] The target mask values are combined to obtain a target mask vector for the target object.
[0208] The training unit 920 is specifically used to determine the middle values corresponding to the first K variances in the sorting result as 0;
[0209] The middle value corresponding to the last (NK) variances in the sorting result is determined to be 1; wherein K is less than or equal to N.
[0210] The training unit 920 is specifically configured to determine the target mask value corresponding to the mean value as 1 if the mean value is greater than or equal to a preset value;
[0211] If the mean is less than the preset value, the target mask value corresponding to the mean is determined to be 0.
[0212] The formula of the sixth loss function is:
[0213]
[0214] Among them, z p represents the third vector; Represents the i-th dimension data of the second vector; i is less than or equal to N; M represents the current mask vector; the symbol ⊙ represents multiplication; ‖‖1 represents the L1 norm; (1-M) represents the inversion of M.
[0215] The acquisition unit 910 is specifically used to acquire an original data set; the original data set includes a labeled map of the target object;
[0216] The annotation map is rendered using a preset ambient light image to obtain a first image, and / or the annotation map is rendered using preset point light source parameters to obtain a second image.
[0217] The labeled maps include a labeled normal map, a labeled diffuse map, a labeled roughness map, and a labeled reflectivity map; an acquisition unit 910 is specifically used to determine ambient light parameters according to a preset ambient light image;
[0218] Rendering the marked normal map, the marked diffuse map, the marked roughness map, and the marked reflectivity map using ambient light parameters to obtain a first image;
[0219] Rotating the labeled normal map, the labeled diffuse map, the labeled roughness map, and the labeled reflectivity map according to a preset rotation angle, and intercepting images in the rotated labeled normal map, the labeled diffuse map, the labeled roughness map, and the labeled reflectivity map according to a preset interception position to obtain a local material map; the local material map includes a local normal map, a local diffuse map, a local roughness map, and a local reflectivity map;
[0220] The local material map is rendered using preset point light source parameters to obtain a second image.
[0221] Fig.10 The present invention is a structural diagram of a device for determining a map according to an exemplary embodiment of the present invention.
[0222] like Fig.10 As shown, the map determination device 1000 provided by the present disclosure includes:
[0223] An acquisition unit 1010 is used to acquire a first image and a second image of a target object; wherein the first image is used to represent an image of the target object under ambient light; and the second image is used to represent an image of the target object under a point light source;
[0224] The determination unit 1020 is used to input the first image and the second image of the target object into a preset texture prediction model to obtain a texture corresponding to the target object; wherein the texture is used to characterize the material parameters of the target object;
[0225] The map prediction model is trained using a training data set, which includes multiple groups of training data. Each group of training data includes a first image and multiple second images of a target object used for model training, as well as an annotated map of the target object.
[0226] Fig.11 The present invention is a structural diagram of an electronic device according to an exemplary embodiment of the present invention.
[0227] like Fig.11 As shown, the electronic device provided in this embodiment includes:
[0228] Memory 1101;
[0229] Processor 1102; and
[0230] Computer programs;
[0231] The computer program is stored in the memory 1101 and is configured to be executed by the processor 1102 to implement any of the above methods.
[0232] This embodiment also provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement any of the above methods.
[0233] This embodiment also provides a computer program product, including a computer program, and when the computer program is executed by a processor, any of the above methods is implemented.
[0234] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0235] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A model training method, characterized in that: The method comprises: Acquire a training data set; the training data set includes multiple groups of training data, each group of the training data includes a first image and multiple second images of a target object, and a labeled map of the target object; wherein the labeled map is a map of the target object that is pre-labeled; the first image is used to represent the image of the target object under ambient light, and the second image is used to represent the image of the target object under a point light source; wherein the map is used to represent the material parameters of the target object; Inputting the first image and the plurality of second images of the target object into a preset model to obtain a predicted map of the target object; According to the labeled map and the predicted map of the target object, the parameters in the preset model are adjusted to obtain a map prediction model, and the map prediction model is used to determine the map of the object according to the image of the object.
2. The method according to claim 1, characterized in that The preset model includes a first encoding module, a second encoding module, and a decoding module; the parameters of the preset model also include a current mask vector; The step of inputting the first image and the plurality of second images of the target object into a preset model to obtain a predicted map of the target object includes: Encoding the first image using the first encoding module to obtain a first vector of the target object; Encoding the second image using the second encoding module to obtain a second vector of the target object; Determine the product between the current mask vector and the second vector to obtain a plurality of fourth vectors, and determine an average value of the plurality of fourth vectors as a third vector of the target object; the second vector is an N-dimensional vector; and the current mask vector is an N-dimensional vector; Connecting the first vector and the third vector to obtain a target vector of the target object; The target vector is decoded by using the decoding module to obtain a predicted map of the target object.
3. The method according to claim 2, characterized in that The step of adjusting the parameters in the preset model according to the labeled map and the predicted map of the target object to obtain a map prediction model includes: The loss function is determined based on at least one of the following methods: Determine a first loss function and / or a second loss function according to the labeled map and the predicted map; Determine a third loss function and / or a fourth loss function according to the labeled map, the predicted map, and the random point light source parameters; Determine a target mask vector corresponding to the target object according to each dimension data in the plurality of second vectors of the target object, and determine a fifth loss function according to an absolute value of a difference between the target mask vector and the current mask vector; Determine a sixth loss function according to the third vector, the second vector, and the current mask vector; According to at least one of the first loss function, the second loss function, the third loss function, the fourth loss function, the fifth loss function, and the sixth loss function, the parameters in the preset model are adjusted to obtain a texture prediction model.
4. The method according to claim 3, characterized in that The determining of the third loss function and / or the fourth loss function according to the labeled map, the predicted map, and the random point light source parameters includes: Rendering the predicted map using the random point light source parameters to obtain a third image of the target object; Rendering the annotation map using the random point light source parameters to obtain a fourth image of the target object; Determine the third loss function according to the absolute value of the difference between the third image and the fourth image; and / or determine the fourth loss function based on the following formula: L adv2 =E[logDis(Y gt )]+E[log(1-Dis(Y))] Wherein, Y represents the third image; Y gt represents the fourth image; Dis represents the discriminator operation; E represents the expected sign.
5. The method according to claim 3, characterized in that: The second vector is an N-dimensional vector; the target mask vector is an N-dimensional vector; The determining, according to each dimension data in the plurality of second vectors of the target object, a target mask vector corresponding to the target object comprises: Determine the variance of each dimensional data according to the plurality of second vectors of the target object; Sorting the variances to obtain a sorting result, determining an intermediate value corresponding to each dimension of data according to the sorting result; combining the intermediate values to obtain an intermediate vector of the target object; According to the intermediate vectors of multiple target objects, determine the data mean corresponding to each dimension of data; Comparing the mean with a preset value to obtain a comparison result, if the mean is greater than or equal to the preset value, determining the target mask value corresponding to the mean to be 1; if the mean is less than the preset value, determining the target mask value corresponding to the mean to be 0; The target mask values are combined to obtain a target mask vector of the target object.
6. The method according to claim 5, characterized in that The determining, according to the sorting result, an intermediate value corresponding to each dimension of data includes: The middle values corresponding to the first K variances in the sorting results are determined to be 0; The middle value corresponding to the last (NK) variances in the sorting result is determined to be 1; wherein K is less than or equal to N.
7. The method according to claim 1, characterized in that Also includes: Acquire an original data set; the original data set includes a labeled map of the target object; The annotation map is rendered using a preset ambient light image to obtain the first image, and / or the annotation map is rendered using preset point light source parameters to obtain the second image.
8. The method according to claim 7, characterized in that The labeled maps include a labeled normal map, a labeled diffuse map, a labeled roughness map, and a labeled reflectivity map; The rendering process of the annotation map by using a preset ambient light image to obtain the first image includes: Determine ambient light parameters according to a preset ambient light image; Rendering the labeled normal map, the labeled diffuse reflection map, the labeled roughness map, and the labeled reflectivity map using the ambient light parameters to obtain the first image; The rendering process of the annotation map using preset point light source parameters to obtain the second image includes: Rotating the labeled normal map, the labeled diffuse reflection map, the labeled roughness map, and the labeled reflectivity map respectively according to a preset rotation angle, and intercepting images in the rotated labeled normal map, the labeled diffuse reflection map, the labeled roughness map, and the labeled reflectivity map respectively according to a preset interception position to obtain a local material map; the local material map includes a local normal map, a local diffuse reflection map, a local roughness map, and a local reflectivity map; The local material map is rendered using preset point light source parameters to obtain the second image.
9. A method for determining a map, characterized in that: The method comprises: Acquire a first image and a second image of a target object; wherein the first image is used to represent an image of the target object under ambient light; and the second image is used to represent an image of the target object under a point light source; Inputting the first image and the second image of the target object into a preset texture prediction model to obtain a texture corresponding to the target object; wherein the texture is used to characterize the material parameters of the target object; The map prediction model is trained using a training data set, which includes multiple groups of training data, each group of training data includes a first image and multiple second images of a target object used for model training, and an annotated map of the target object.
10. An electronic device, characterized in that: comprising a memory and a processor; wherein, The memory is used to store computer programs; The processor is used to read the computer program stored in the memory and execute the method according to any one of claims 1 to 8 or 9 according to the computer program in the memory.
