Virtual image generation method and device
By generating and processing virtual images in the virtual world, combined with user identity verification, the problem of limited virtual image generation methods and privacy protection is solved, and the user experience in the virtual world is improved.
Patent Information
- Application Number
- CN202410903036.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2024-10-18
AI Technical Summary
Existing technology is difficult to generate avatars that meet specific user needs in the virtual world, and it is difficult to protect user privacy, resulting in limited avatar generation methods and poor user experience.
By inputting user images collected in the physical world into the image generation model, a preset virtual image is generated, and masking and enhancement processing are performed based on the recognition probability. Combined with user identity verification, the target image is selected to display in the virtual world to meet the user's personalized needs and Protect privacy.
It enriches the virtual image generation method, improves the user's experience in the virtual world, meets the personality display needs of specific users, and protects user privacy at the same time.
Smart Images

Figure CN118799463A_ABST
Abstract
Description
[0001] This application is a divisional application of the Chinese patent application submitted to the China Patent Office on December 19, 2022, with application number 202211634239.5 and invention name “Virtual Image Generation Method and Device”. Technical Field
[0002] This document relates to the field of virtualization technology, and in particular to a method and device for generating a virtual image. Background Art
[0003] With the continuous development of virtualization technology, the virtual world has gradually become a hot topic in various fields. The virtual world is a simulation of the physical world. In the virtual world, users can log in to the virtual world through a specific identity and engage in various activities similar to those in the physical world, or even engage in activities that cannot be performed in the physical world. In the virtual world, users usually use their respective user roles to carry out activities. Summary of the invention
[0004] One or more embodiments of the present specification provide a method for generating a virtual image, including: inputting a user image of a specific user collected from the physical world into an image generation model to generate a virtual image and identify the specific user type, and obtaining a preset virtual image and a recognition probability. If the recognition probability is greater than a preset threshold, inputting the preset virtual image into an image mask model to mask the virtual image to obtain a masked virtual image, and inputting the preset virtual image into an image enhancement model to enhance the virtual image to obtain an enhanced virtual image. If the specific user passes the specific identity verification, a target image is selected from the preset virtual image, the masked virtual image, and the enhanced virtual image according to the user's instruction to be displayed in the virtual world.
[0005] One or more embodiments of the present specification provide a virtual image generation device, including: inputting a user image of a specific user collected from the physical world into an image generation model to generate a virtual image and identify the specific user type, and obtaining a preset virtual image and a recognition probability. If the recognition probability is greater than a preset threshold, inputting the preset virtual image into an image mask model to mask the virtual image to obtain a masked virtual image, and inputting the preset virtual image into an image enhancement model to enhance the virtual image to obtain an enhanced virtual image. If the specific user passes the specific identity verification, a target image is selected from the preset virtual image, the masked virtual image, and the enhanced virtual image according to the user's instruction to be displayed in the virtual world.
[0006] One or more embodiments of the present specification provide a virtual image generation device, including: a processor; and a memory configured to store computer executable instructions, wherein when the computer executable instructions are executed, the processor: inputs a user image of a specific user collected from the physical world into an image generation model to generate a virtual image and identify the specific user type, and obtains a preset virtual image and recognition probability. If the recognition probability is greater than a preset threshold, the preset virtual image is input into an image mask model to mask the virtual image to obtain a masked virtual image, and the preset virtual image is input into an image enhancement model to enhance the virtual image to obtain an enhanced virtual image. If the specific user passes the specific identity verification, a target image is selected from the preset virtual image, the masked virtual image, and the enhanced virtual image according to the user instruction to be displayed in the virtual world.
[0007] One or more embodiments of the present specification provide a storage medium for storing computer executable instructions, which implement the following process when executed by a processor: input a user image of a specific user collected from the physical world into an image generation model to generate a virtual image and identify the specific user type, and obtain a preset virtual image and recognition probability. If the recognition probability is greater than a preset threshold, input the preset virtual image into an image mask model to mask the virtual image to obtain a masked virtual image, and input the preset virtual image into an image enhancement model to enhance the virtual image to obtain an enhanced virtual image. If the specific user passes the specific identity verification, select a target image from the preset virtual image, masked virtual image, and enhanced virtual image according to the user instruction to display in the virtual world. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.
[0009] Figure 1 A processing flow chart of a method for generating a virtual image provided by one or more embodiments of this specification;
[0010] Figure 2 A processing flow chart of a method for generating a virtual image applied to a virtual world scene provided by one or more embodiments of this specification;
[0011] Figure 3 A schematic diagram of a virtual image generation device provided in one or more embodiments of this specification;
[0012] Figure 4 A schematic diagram of the structure of a virtual image generation device provided in one or more embodiments of this specification. DETAILED DESCRIPTION
[0013] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.
[0014] This specification provides an embodiment of a method for generating a virtual image:
[0015] The virtual image generation method provided in the present embodiment first inputs the user image of the specific user collected from the physical world into the image generation model to generate the virtual image and identify the specific user type, to obtain a preset virtual image and an identification probability. If the identification probability is greater than a preset threshold, on the one hand, the preset virtual image is input into the image mask model to perform masking processing on the virtual image to obtain a masked virtual image. On the other hand, the preset virtual image is input into the image enhancement model to perform virtual image enhancement to obtain an enhanced virtual image. If the specific user passes the specific identity verification, the target image is selected from the preset virtual image, the masked virtual image, and the enhanced virtual image according to the user's instruction to be displayed in the virtual world, thereby enriching the way in which the specific user generates the virtual image, avoiding the privacy of the specific user from being leaked, and improving the experience of the specific user in conducting activities in the virtual world by meeting the specific user's needs for the personalized display of the virtual image.
[0016] Reference Figure 1 The virtual image generation method provided in this embodiment specifically includes steps S102 to S106.
[0017] Step S102, inputting the user image of the specific user collected in the physical world into the image generation model to generate a virtual image and identify the type of the specific user, and obtaining a preset virtual image and recognition probability.
[0018] The virtual world described in this embodiment refers to a virtual simulation world based on decentralized collaboration and with an open economic system. Specifically, users in the physical world (real world) can access the virtual world through access devices to perform behavioral activities in the virtual world, such as a game virtual world where users interact with each other through access devices, or a conference virtual world where users conduct online meetings through access devices; the access device of the virtual world can be a VR (Virtual Reality) device connected to the virtual world, an AR (Augmented Reality) device, etc., such as a head-mounted VR device connected to the virtual world. The physical world refers to the world corresponding to the virtual world, that is, the real world. Optionally, the physical world includes the real world.
[0019] The user image refers to an image acquired by an image sensor integrated or configured by an access device of the virtual world. Optionally, the user image is acquired by an image sensor integrated or configured by an access device of the virtual world. The user image includes a color image acquired by an image sensor, such as an RGB (Red Green Blue) image acquired by a visible light sensor.
[0020] The specific users include disabled users, users with specific identities and / or users with asymmetric bodies; wherein the disabled users include but are not limited to: users with physical defects and users with behavioral disorders.
[0021] The preset virtual image refers to a three-dimensional digital image obtained by reconstructing the user image using image reconstruction technology based on the user image, which is used to display the user image in the virtual world; specifically, if the user's body appearance is symmetrical, a preset virtual image with a symmetrical appearance is displayed in the virtual world; if the user's body appearance is defective, a preset virtual image with a defective specific part is displayed in the virtual world. The masked virtual image refers to a virtual image obtained by adding image materials to a specific part of a specific user. The enhanced virtual image refers to a virtual image obtained by enhancing the virtual image of a specific user using image enhancement.
[0022] In a specific implementation, in order to obtain a preset virtual image of a specific user, a user image of the specific user collected from the physical world is input into an image generation model to generate a corresponding preset virtual image, and the user type is identified to obtain a recognition probability, which is used as a basis for subsequent judgment on whether to perform mask processing and enhancement processing on the preset virtual image. In the process of model training, in order to improve the training efficiency of the significant feature model, and also to reduce the difficulty of collecting training samples and the workload of model training, in an optional implementation manner provided in this embodiment, the image generation model is trained and obtained in the following manner:
[0023] Inputting a first image sample collected from the physical world into the image generation model to be trained to generate a virtual image, thereby obtaining a sample virtual image and a sample recognition probability;
[0024] Calculating the training loss according to the mapping images of the sample virtual image at each angle and the first classification labels corresponding to the mapping images at each angle;
[0025] Parameters of the image generation model to be trained are adjusted according to the training loss.
[0026] Referring to the above-mentioned model training method, repeat the above-mentioned training process to train the image generation model, and obtain the image generation model after the training is completed. Furthermore, in order to improve the model training effect, loss calculation is introduced from the dimension of the mapping images of the sample virtual image at various angles and the first classification label corresponding to the first sample image to constrain the training process of the image generation model, so as to improve the accuracy and efficiency of model training. Specifically, in an optional implementation manner provided by this embodiment, the training loss is calculated based on the mapping images of the sample virtual image at various angles and the first classification label corresponding to the mapping images at various angles, including:
[0027] Calculating contrast loss according to the mapping images at each angle and the first image sample;
[0028] Calculate a first classification loss according to the first classification labels corresponding to the mapped images at each angle and the sample classification labels of the first image samples;
[0029] The sum of the contrast loss and the first classification loss is taken as the training loss.
[0030] Specifically, the NeRF (Neural Radiance Fields) model can also be used as the image generation model to be trained. During the model training process, the first image sample collected from the physical world is first input into the NeRF model to generate a virtual image, and the sample virtual image and sample recognition probability are obtained. The contrast loss is calculated based on the mapped images of the sample virtual image at each angle and the first image sample at the corresponding angle, and the first classification loss is calculated based on the first classification label of the mapped image and the sample classification label of the first image sample, and the sum of the contrast loss and the first classification loss is used as the training loss. Among them, the mapped images at each angle include the mapped images obtained by mapping the preset virtual image according to the acquisition angle of the first image sample. The first classification label includes the label obtained after the user type is identified.
[0031] For example, the image generation model to be trained adopts the NeRF model. During the training process of the NeRF model, the first image sample is input into the NeRF model for virtual image generation to obtain the sample virtual image and the sample recognition probability. In the process of training the image generation model to be trained, the loss function is constructed as follows:
[0032]
[0033] Among them, Loss total is the training loss of the image generation model to be trained, which is calculated based on the contrast loss and the first classification loss; rgb represents the first image sample, view(C nerf (rgb, θ) represents the multi-angle mapping of the sample virtual image, rgb-view (C nerf (rgb, θ)) represents the calculation of the Euclidean distance based on the first image sample and the RGB image obtained after mapping the sample virtual image, It means that the 2-norm is calculated for the Euclidean distance first and then the 2-norm, which is the contrast loss; Softmax(x, y cls ) indicates that the first classification loss is calculated according to the recognition probability of the first image sample and the recognition probability of the mapped RGB image.
[0034] During the training process, based on the above model structure and training loss, the SGD (Stochastic Gradient Descent) method is used to adjust the parameters of the image generation model to be trained until the image generation model is obtained after the loss function converges.
[0035] Optionally, the first image sample includes at least one of the following: a specific image sample, a preset image sample.
[0036] In specific implementation, in order to obtain a preset virtual image of a specific user, it is necessary to collect a specific user image sample. In this embodiment, the preset image sample is input into a feature extraction model for feature extraction to obtain a sample first feature image. On the basis of the sample first feature image, the preset image sample is edited in a pixel value manner to obtain a specific image sample. In an optional implementation manner provided by this embodiment, the specific image sample is obtained in the following manner:
[0037] Inputting the preset image sample into a feature extraction model to perform feature extraction, and obtaining a first feature image of the sample;
[0038] The pixel values of the preset image sample are edited based on the sample first feature image to obtain the specific image sample.
[0039] The sample first feature image includes an image with fine-grained features annotated on the basis of a preset image sample, such as an image with background, user's face, body and other parts annotated.
[0040] Furthermore, in the process of editing the pixel value of the preset image sample based on the sample first feature image, in order to make the feature of the specific image sample closer to the specific user, in an optional implementation manner provided by this embodiment, the pixel value of the preset image sample is edited based on the sample first feature image, including:
[0041] Screening the image features of the first feature image of the sample to obtain features to be processed;
[0042] Delete the pixel values of the area corresponding to the area of the feature to be processed in the preset image sample.
[0043] Optionally, in the process of screening the image features of the sample first feature image, the screening can be performed in a random manner. For example, after obtaining the sample first feature image through the preset image sample, the part of the sample first feature image marked with the left hand is randomly screened out, and the pixel value of the left hand part in the preset image sample is deleted.
[0044] In specific implementation, in order to improve the training efficiency of the feature extraction model, and also to reduce the difficulty of collecting training samples and reduce the workload of model training, in an optional implementation manner provided in this embodiment, the feature extraction model is trained and obtained in the following manner:
[0045] Inputting a second image sample collected from the physical world into the feature extraction model to be trained for feature extraction to obtain a second feature image of the sample;
[0046] Calculating feature loss according to the second feature image of the sample and the preset feature image;
[0047] Parameters of the feature extraction model to be trained are adjusted according to the feature loss.
[0048] Referring to the above model training method, the above training process is repeated to train the image generation model, and the image generation model is obtained after the training is completed.
[0049] Specifically, in the process of calculating the feature loss according to the second feature image of the sample and the preset feature image, the pixel-wise loss function can be used to calculate the classification loss function to obtain the feature loss.
[0050] During the training process, based on the above model structure and training loss, the SGD (Stochastic Gradient Descent) method is used to adjust the parameters of the image generation model to be trained until the image generation model is obtained after the loss function converges.
[0051] Step S104, if the recognition probability is greater than a preset threshold, input the preset virtual image into the image mask model to perform mask processing on the virtual image to obtain a masked virtual image, and input the preset virtual image into the image enhancement model to perform virtual image enhancement to obtain an enhanced virtual image.
[0052] Based on the above-mentioned acquisition of the preset virtual image and the recognition probability, in this step, when the recognition probability is greater than the preset threshold, taking into account the needs of specific users in generating virtual images, on the one hand, the virtual image is input into the image mask model for masking of the virtual image to obtain a masked virtual image; on the other hand, the preset virtual image is input into the image enhancement model for virtual image enhancement to obtain an enhanced virtual image, so that specific users can choose to display the corresponding virtual image in the virtual world according to their needs.
[0053] The following specifically describes the process of obtaining the masked virtual image and the process of obtaining the enhanced virtual image.
[0054] (1) Inputting the preset virtual image into the image mask model to perform mask processing on the virtual image to obtain a masked virtual image.
[0055] In the specific execution process, in order to more accurately perform mask processing on the incomplete parts of the preset virtual image, the preset virtual image obtained in the previous step is input into the image mask model to perform mask processing on the virtual image. In an optional implementation manner provided by this embodiment, the inputting the preset virtual image into the image mask model to perform mask processing on the virtual image includes:
[0056] Identifying a specific part of the preset virtual image;
[0057] The image material corresponding to the specific part is rendered above the layer of the image area where the specific part is located.
[0058] Optionally, the specific part includes a disabled part, such as a disabled left hand of a disabled user.
[0059] Specifically, after identifying that a specific part of the preset virtual image is defective, the masked virtual image is obtained by rendering the image material corresponding to the specific part above the layer of the image area of the specific part. For example, if it is identified that the left hand of the preset virtual image is defective, the left hand prosthesis material corresponding to the defective part is rendered above the layer of the defective part.
[0060] In a specific implementation, a model capable of generating a masked virtual image is obtained by training the model. In the process of model training, in order to improve the training efficiency of the image mask model, and also to reduce the difficulty of collecting training samples and the workload of model training, in an optional implementation provided by this embodiment, the image mask model is trained and obtained in the following manner:
[0061] Inputting the first virtual image sample into the image mask model to be trained to perform mask processing on the virtual image, thereby obtaining a sample masked virtual image;
[0062] Calculating a second classification loss according to the second classification label of the sample mask virtual image and the preset classification label;
[0063] Parameters of the image mask model to be trained are adjusted according to the second classification loss.
[0064] Specifically, 3DCNN (Convolutional Neural Networks) can also be used as the image mask model to be trained. During the model training process, the first virtual image sample is first input into the 3DCNN for mask processing of the virtual image to obtain a sample masked virtual image. The second classification loss is calculated based on the second classification label of the image material of the specific part of the sample masked virtual image and the preset classification label of the preset image material of the specific part of the sample masked image, and the parameters of the 3DCNN are adjusted based on the second classification loss.
[0065] For example, the image generation model to be trained adopts 3DCNN. During the training process of the 3DCNN model, the first virtual image sample is input into the 3DCNN to generate the sample mask virtual image. In the process of training the image mask model from the 3DCNN, the loss function is constructed as follows:
[0066] Loss peishi =Softmax(x,y)
[0067] Among them, Loss peishi is the second classification loss, Softmax(x, y) indicates calculating the second classification loss based on the second classification label of the image material of the specific part of the sample mask virtual image and the preset classification label of the preset image material of the specific part of the sample mask image.
[0068] During the training process, based on the above model structure and training loss, the SGD method is used to adjust the parameters of the image generation model to be trained until the image generation model is obtained after the loss function converges.
[0069] (2) Inputting the preset virtual image into the image enhancement model to enhance the virtual image and obtain an enhanced virtual image.
[0070] During the specific execution process, in order to more accurately enhance the incomplete parts of the preset virtual image, the preset virtual image obtained in the previous step is input into the image enhancement model to enhance the virtual image. In an optional implementation manner provided by this embodiment, the virtual image enhancement process includes:
[0071] Identifying a specific part of the preset virtual image;
[0072] The pixel values of the specific part are reversed and image rendering is performed according to the reversed editing result to obtain the enhanced virtual image.
[0073] Specifically, after identifying that a specific part of the preset virtual image is defective, the pixel values of the specific part are reversed and the image is rendered according to the reversed editing result to obtain an enhanced virtual image. For example, if it is identified that the left hand of the preset virtual image is defective, the pixel values of the left hand of the preset virtual image are reversed to obtain a complete virtual image of the left hand, which is an enhanced virtual image.
[0074] In specific implementation, a model capable of generating an enhanced virtual image is obtained by training the model. In the process of model training, in order to improve the training efficiency of the image enhancement model, and also to reduce the difficulty of collecting training samples and the workload of model training, in an optional implementation manner provided in this embodiment, the image enhancement model is obtained by training in the following manner:
[0075] Inputting the second virtual image sample into the image enhancement model to be trained to enhance the virtual image, thereby obtaining a sample enhanced virtual image;
[0076] Calculate the regression loss based on the sample enhanced virtual image and the preset enhanced virtual image;
[0077] Parameters of the image enhancement model to be trained are adjusted according to the regression loss.
[0078] Specifically, 3DCNN can also be used as the image enhancement model to be trained. During the model training process, the first virtual image sample is first input into 3DCNN for virtual image enhancement processing to obtain a sample enhanced virtual image. The Euclidean distance loss is calculated based on the sample enhanced virtual image and the preset enhanced virtual image, and the model parameters are adjusted based on the Euclidean distance loss.
[0079] For example, the image generation model to be trained adopts 3DCNN. During the training process of the 3DCNN model, the second virtual image sample is input into the 3DCNN for sample enhanced virtual image generation. In the process of training the image enhancement model from the 3DCNN, the loss function is constructed as follows:
[0080] Loss fillup =EuclideanLoss(x,y)
[0081] Among them, Loss fillup is the regression loss, and EuclideanLoss(x, y) represents the Euclidean distance loss calculated based on the sample enhanced virtual image and the preset enhanced virtual image.
[0082] During the training process, based on the above model structure and training loss, the SGD method is used to adjust the parameters of the image generation model to be trained until the image generation model is obtained after the loss function converges.
[0083] Step S106, if the specific user passes the specific identity verification, a target image is selected from the preset virtual image, the masked virtual image, and the enhanced virtual image according to the user's instruction to be displayed in the virtual world.
[0084] Based on the preset virtual image, masked virtual image and enhanced virtual image, a specific identity verification is performed on a specific user. If the verification is passed, a target image is selected from the preset virtual image, masked virtual image and enhanced virtual image according to the user's instructions to be displayed in the virtual world.
[0085] In a specific implementation process, according to the method for generating a virtual image according to claim 1, the performing of specific identity verification includes:
[0086] Sending the image credentials submitted by the specific user to a reviewer to verify whether the user has a specific identity;
[0087] If the verification result shows that the user has a specific identity, the verification is confirmed to be successful.
[0088] If the verification result is that the user does not have a specific identity, the enhanced virtual image is displayed in the virtual world.
[0089] Specifically, after receiving the audit task, the auditor confirms the audit result by verifying the image credentials submitted by the user. If the image credentials submitted by the user can prove that the user is a user with a specific identity, the audit is confirmed to be passed. If it cannot be proved, the enhanced virtual image will be directly displayed in the virtual world.
[0090] In addition, the process of selecting a target image from among the preset virtual image, masked virtual image, and enhanced virtual image for display in the virtual world according to user instructions can also be replaced by selecting a target image from among any one or any two of the preset virtual image, masked virtual image, and enhanced virtual image for display in the virtual world according to user instructions.
[0091] To summarize, the virtual image generation method provided in this embodiment first inputs the user image of a specific user collected from the physical world into an image generation model to generate a virtual image and identify the specific user type, to obtain a preset virtual image and a recognition probability. If the recognition probability is greater than a preset threshold, on the one hand, the preset virtual image is input into an image mask model to perform mask processing on the virtual image to obtain a masked virtual image. On the other hand, the preset virtual image is input into an image enhancement model to perform virtual image enhancement to obtain an enhanced virtual image. If the specific user passes the specific identity verification, the target image is selected from the preset virtual image, masked virtual image, and enhanced virtual image according to the user's instructions for display in the virtual world. The virtual image of the specific user is enriched through a customized algorithm model to meet the specific user's display needs for different virtual images.
[0092] Furthermore, on the one hand, by identifying specific parts of a preset virtual image, the image material corresponding to the specific parts is rendered above the layer of the image area where the specific parts are located to perform mask processing on the virtual image, thereby obtaining a masked virtual image; on the other hand, by identifying specific parts of a preset virtual image, the pixel values of the specific parts are reverse-edited to perform image rendering, thereby obtaining an enhanced virtual image, thereby satisfying the needs of specific users to protect privacy in the virtual world.
[0093] The following uses the application of a virtual image generation method provided by this embodiment in a virtual world scene as an example to further illustrate the virtual image generation method provided by this embodiment. Figure 2 , a method for generating a virtual image applied to a virtual world scene specifically includes the following steps.
[0094] Step S202: Input the user image of the disabled user collected from the physical world into the image generation model to generate a virtual image and identify the user type, so as to obtain a preset virtual image and recognition probability.
[0095] Step S204: if the recognition probability is greater than a preset threshold, the preset virtual image is input into the image mask model to perform mask processing on the virtual image to obtain a masked virtual image.
[0096] Step S206: input the preset virtual image into the image enhancement model to enhance the virtual image and obtain an enhanced virtual image.
[0097] Step S208, if the disabled user passes the disability identity verification, a masked virtual image is selected from the preset virtual image, the masked virtual image, and the enhanced virtual image according to the user's instruction.
[0098] Step S210: displaying the masked virtual image through the access device of the virtual world.
[0099] Step S212: If the disabled user fails the disability identity verification, an enhanced virtual image is displayed in the virtual world.
[0100] An embodiment of a virtual image generation device provided in this specification is as follows:
[0101] In the above-mentioned embodiment, a virtual image generation method is provided, and correspondingly, a virtual image generation device is also provided, which is described below with reference to the accompanying drawings.
[0102] Reference Figure 3 , which shows a schematic diagram of a virtual image generating device provided in this embodiment.
[0103] Since the device embodiment corresponds to the method embodiment, the description is relatively simple, and the relevant parts can refer to the corresponding description of the method embodiment provided above. The device embodiment described below is only illustrative.
[0104] This embodiment provides a virtual image generation device, including:
[0105] An image generation module 302 is configured to input a user image of a specific user collected in the physical world into an image generation model to generate a virtual image and identify the type of the specific user, thereby obtaining a preset virtual image and an identification probability;
[0106] If the recognition probability is greater than a preset threshold, the image processing module 304 is run, and the mask and enhancement module is configured to input the preset virtual image into the image mask model to perform mask processing of the virtual image to obtain a masked virtual image, and input the preset virtual image into the image enhancement model to perform virtual image enhancement to obtain an enhanced virtual image;
[0107] If the specific user passes the specific identity verification, the image display module 306 is run, and the image update module is configured to select a target image from the preset virtual image, the masked virtual image, and the enhanced virtual image according to the user's instructions to display it in the virtual world.
[0108] An embodiment of a virtual image generation device provided in this specification is as follows:
[0109] Corresponding to the virtual image generation method described above, based on the same technical concept, one or more embodiments of this specification also provide a virtual image generation device, the virtual image generation device is used to execute the virtual image generation method provided above, Figure 4 A schematic diagram of the structure of a virtual image generation device provided in one or more embodiments of this specification.
[0110] This embodiment provides a virtual image generation device, including:
[0111] like Figure 4 As shown, the virtual image generation device may have relatively large differences due to different configurations or performances, and may include one or more processors 401 and memory 402, and the memory 402 may store one or more storage applications or data. Among them, the memory 402 may be a temporary storage or a permanent storage. The application stored in the memory 402 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the virtual image generation device. Furthermore, the processor 401 may be configured to communicate with the memory 402, and execute a series of computer executable instructions in the memory 402 on the virtual image generation device. The virtual image generation device may also include one or more power supplies 403, one or more wired or wireless network interfaces 404, one or more input / output interfaces 405, one or more keyboards 406, etc.
[0112] In a specific embodiment, the virtual image generation device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the virtual image generation device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0113] Inputting a user image of a specific user collected in the physical world into an image generation model to generate a virtual image and identify the specific user type, thereby obtaining a preset virtual image and recognition probability;
[0114] If the recognition probability is greater than a preset threshold, inputting the preset virtual image into an image mask model to perform masking of the virtual image to obtain a masked virtual image, and inputting the preset virtual image into an image enhancement model to perform virtual image enhancement to obtain an enhanced virtual image;
[0115] If the specific user passes the specific identity verification, a target image is selected from the preset virtual image, the masked virtual image, and the enhanced virtual image according to the user's instruction to be displayed in the virtual world.
[0116] An embodiment of a storage medium provided in this specification is as follows:
[0117] Corresponding to the virtual image generation method described above, based on the same technical concept, one or more embodiments of this specification also provide a storage medium.
[0118] The storage medium provided in this embodiment is used to store computer executable instructions, and the computer executable instructions implement the following process when executed by a processor:
[0119] Inputting a user image of a specific user collected in the physical world into an image generation model to generate a virtual image and identify the specific user type, thereby obtaining a preset virtual image and recognition probability;
[0120] If the recognition probability is greater than a preset threshold, inputting the preset virtual image into an image mask model to perform masking of the virtual image to obtain a masked virtual image, and inputting the preset virtual image into an image enhancement model to perform virtual image enhancement to obtain an enhanced virtual image;
[0121] If the specific user passes the specific identity verification, a target image is selected from the preset virtual image, the masked virtual image, and the enhanced virtual image according to the user's instruction to be displayed in the virtual world.
[0122] It should be noted that the embodiment of the storage medium in this specification and the embodiment of the virtual image generation method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned corresponding method, and the repeated parts will not be repeated.
[0123] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0124] In the 1930s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many improvements to method flows today can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0125] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0126] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0127] For the convenience of description, the above device is described in terms of functions and is divided into various units and described separately. Of course, when implementing the embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0128] It should be understood by those skilled in the art that one or more embodiments of this specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0129] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0132] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0133] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0134] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0135] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0136] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0137] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0138] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.
Claims
1. A method for generating a virtual image, comprising: Inputting a user image of a specific user collected in the physical world into an image generation model to generate a virtual image and identify the specific user type, thereby obtaining a preset virtual image and recognition probability; If the recognition probability is greater than a preset threshold, inputting the preset virtual image into an image mask model to perform masking of the virtual image to obtain a masked virtual image, and inputting the preset virtual image into an image enhancement model to perform virtual image enhancement to obtain an enhanced virtual image; If the specific user passes the specific identity verification, a target image is selected from the preset virtual image, the masked virtual image, and the enhanced virtual image according to the user's instruction to be displayed in the virtual world.
2. The method for generating a virtual image according to claim 1, wherein the step of inputting the preset virtual image into an image mask model to perform mask processing on the virtual image comprises: Identifying a specific part of the preset virtual image; The image material corresponding to the specific part is rendered above the layer of the image area where the specific part is located.
3. The method for generating a virtual image according to claim 1, wherein the step of enhancing the virtual image comprises: Identifying a specific part of the preset virtual image; The pixel values of the specific part are reversed and image rendering is performed according to the reversed editing result to obtain the enhanced virtual image.
4. The method for generating a virtual image according to claim 1, wherein the image mask model is obtained by training in the following manner: Inputting the first virtual image sample into the image mask model to be trained to perform mask processing on the virtual image, thereby obtaining a sample masked virtual image; Calculating a second classification loss according to the second classification label of the sample mask virtual image and the preset classification label; Parameters of the image mask model to be trained are adjusted according to the second classification loss.
5. According to the method for generating a virtual image according to claim 1, the image enhancement model is trained and obtained in the following manner: Inputting the second virtual image sample into the image enhancement model to be trained to enhance the virtual image, thereby obtaining a sample enhanced virtual image; Calculate the regression loss based on the sample enhanced virtual image and the preset enhanced virtual image; Parameters of the image enhancement model to be trained are adjusted according to the regression loss.
6. The method for generating a virtual image according to claim 1, wherein the specific identity verification comprises: Sending the image credentials submitted by the specific user to a reviewer to verify whether the user has a specific identity; If the verification result shows that the user has a specific identity, the verification is confirmed to be successful.
7. The method for generating a virtual image according to claim 6, further comprising: If the verification result is that the user does not have a specific identity, the enhanced virtual image is displayed in the virtual world.
8. A virtual image generating device, comprising: An image generation module is configured to input a user image of a specific user collected from the physical world into an image generation model to generate a virtual image and identify the type of the specific user, thereby obtaining a preset virtual image and an identification probability; If the recognition probability is greater than a preset threshold, the image processing module is run, and the image processing module is configured to input the preset virtual image into the image mask model to perform mask processing of the virtual image to obtain a masked virtual image, and input the preset virtual image into the image enhancement model to perform virtual image enhancement to obtain an enhanced virtual image; If the specific user passes the specific identity verification, the image display module is run, and the image update module is configured to select a target image from the preset virtual image, the masked virtual image, and the enhanced virtual image for display in the virtual world according to the user's instructions.
9. A virtual image generation device, comprising: processor; and a memory configured to store computer executable instructions that, when executed, cause the processor to: Inputting a user image of a specific user collected in the physical world into an image generation model to generate a virtual image and identify the specific user type, thereby obtaining a preset virtual image and recognition probability; If the recognition probability is greater than a preset threshold, inputting the preset virtual image into an image mask model to perform masking of the virtual image to obtain a masked virtual image, and inputting the preset virtual image into an image enhancement model to perform virtual image enhancement to obtain an enhanced virtual image; If the specific user passes the specific identity verification, a target image is selected from the preset virtual image, the masked virtual image, and the enhanced virtual image according to the user's instruction to be displayed in the virtual world.
10. A storage medium for storing computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the following process: Inputting a user image of a specific user collected in the physical world into an image generation model to generate a virtual image and identify the specific user type, thereby obtaining a preset virtual image and recognition probability; If the recognition probability is greater than a preset threshold, inputting the preset virtual image into an image mask model to perform masking of the virtual image to obtain a masked virtual image, and inputting the preset virtual image into an image enhancement model to perform virtual image enhancement to obtain an enhanced virtual image; If the specific user passes the specific identity verification, a target image is selected from the preset virtual image, the masked virtual image, and the enhanced virtual image according to the user's instruction to be displayed in the virtual world.
