Picture resource generation method and device for game development

文档序号:623977 发布日期:2021-05-11 浏览:30次 中文

阅读说明:本技术 用于游戏开发的图片资源生成方法及装置 (Picture resource generation method and device for game development ) 是由 董中要 于 2019-11-11 设计创作,主要内容包括:本申请公开了一种用于游戏开发的图片资源生成方法及装置,涉及计算机技术领域。其中,所述方法中通过对包含生成模型和鉴别模型的生成式对抗网络进行训练,获得具备生成较真实图片的泛化能力的目标生成模型,然后采用该目标生成模型对随机输入数据进行处理,即可根据随机的输入数据自动生成图片资源以供游戏开发者使用。通过该方法,不仅可以降低开发过程中的人工设计成本,还可以提高图片资源的生产速度,丰富图片资源的选择空间,进而提高游戏开发效率。(The application discloses a picture resource generation method and device for game development, and relates to the technical field of computers. In the method, a generative confrontation network comprising a generative model and an identification model is trained to obtain a target generative model with generalization capability of generating a relatively real picture, and then random input data is processed by adopting the target generative model, so that picture resources can be automatically generated according to the random input data for game developers to use. By the method, the manual design cost in the development process can be reduced, the production speed of the picture resources can be increased, the selection space of the picture resources is enriched, and the game development efficiency is improved.)

1. A picture resource generation method for game development is applied to an electronic device, the electronic device is configured with a generative confrontation network, the generative confrontation network comprises a generative model and an authentication model, and the method comprises the following steps:

acquiring first input data;

converting the first input data into a corresponding noise picture according to a preset conversion function;

inputting the noise picture into an initial generation model to obtain a first picture with a first label;

inputting a second picture with a second label and the first picture into an initial identification model to obtain a first identification result of the initial identification model on the first picture and a second identification result on the second picture;

and adjusting the network parameters of the initial identification model based on the first identification result and the second identification result, and adjusting the network parameters of the initial generation model based on the first identification result until the identification result of the initial identification model after parameter adjustment on the picture obtained by the initial generation model after parameter adjustment meets the preset condition, so as to obtain a target generation model and a target identification model, wherein the target generation model is used for generating target picture resources for game development.

2. The method of claim 1, wherein the first input data comprises numerical data in a predetermined range, and the step of converting the first input data into the corresponding noise picture according to a predetermined conversion function comprises:

processing the numerical data through the conversion function to obtain the picture size, the resolution and the initial pixel value corresponding to the numerical data;

and obtaining the noise picture according to the picture size, the resolution and the initial pixel value.

3. The method of claim 1, wherein the step of inputting the noise picture into an initial generation model to obtain a first picture with a first label comprises:

and adjusting the pixel value of each pixel point in the noise picture through the initial generation model, and adding a first label to the noise picture to obtain the first picture with the first label.

4. The method according to any one of claims 1-3, wherein the step of inputting the second labeled picture and the first picture into an initial authentication model to obtain a first authentication result of the initial authentication model for the first picture and a second authentication result for the second picture comprises:

extracting the pixel distribution characteristics of the first picture and the pixel distribution characteristics of the second picture;

obtaining the first identification result according to the pixel distribution characteristics of the first picture and a first target function corresponding to the initial identification model;

and obtaining the second identification result according to the pixel distribution characteristics of the second picture and the first objective function.

5. The method of claim 4, wherein the step of adjusting network parameters of the initial authentication model based on the first authentication result and the second authentication result comprises:

and adjusting parameters of the first objective function according to a gradient rise algorithm and the first identification result and the second identification result so that the identification result of the initial identification model on the picture obtained by the initial generation model approaches to the first label.

6. The method of claim 4, wherein the step of adjusting network parameters of the initial generative model based on the first authentication result comprises:

and adjusting parameters of a second objective function corresponding to the initial generation model according to a gradient descent algorithm and the first identification result, so that an identification result obtained by identifying the picture generated by the initial generation model through the initial identification model approaches to the second label.

7. A picture resource generation device for game development, which is applied to an electronic device configured with a generative confrontation network, wherein the generative confrontation network comprises a generative model and an authentication model, and the device comprises:

the acquisition module is used for acquiring first input data;

the conversion module is used for converting the first input data into a corresponding noise picture according to a preset conversion function;

the generating module is used for inputting the noise picture into an initial generating model to obtain a first picture with a first label;

the identification module is used for inputting a second picture with a second label and the first picture into an initial identification model to obtain a first identification result of the initial identification model on the first picture and a second identification result of the initial identification model on the second picture;

and the adjusting module is used for adjusting the network parameters of the initial identification model based on the first identification result and the second identification result, adjusting the network parameters of the initial generation model based on the first identification result, and obtaining a target generation model and a target identification model when the identification result of the initial identification model after parameter adjustment on the picture obtained by the initial generation model after parameter adjustment meets the preset condition, wherein the target generation model is used for generating target picture resources for game development.

8. The apparatus of claim 7, wherein the first input data comprises numerical data within a predetermined range, and the conversion module is specifically configured to:

processing the numerical data through the conversion function to obtain the picture size, the resolution and the initial pixel value corresponding to the numerical data;

and obtaining the noise picture according to the picture size, the resolution and the initial pixel value.

9. A storage medium, characterized in that the storage medium comprises a computer program for implementing the method according to any one of claims 1-6.

10. An electronic device, comprising a memory for storing a computer program and a processor for loading execution of the computer program to cause the electronic device to perform the method of any of claims 1-6.

Technical Field

The application relates to the technical field of computers, in particular to a picture resource generation method and device for game development.

Background

In the game development process, a large amount of picture resources are required to be used, for example: character models, scene pictures, prop icons, etc. in the game.

However, in the prior art, these picture resources usually need professional UI staff to design for different games respectively, so as to draw different picture resources for developers to use.

In summary, the following problems exist in the prior art: 1. the production cost of the picture resources is high, and the burden is increased for the operation cost of a company; 2. the production efficiency of the picture resources is low, the development efficiency of the game is influenced, and the online time of the game is further influenced.

Disclosure of Invention

The embodiment of the application provides a picture resource generation method and device for game development, so as to solve the problems in the prior art.

In order to achieve the above purpose, the preferred embodiment of the present application adopts the following technical solutions:

in a first aspect, an embodiment of the present application provides a method for generating a picture resource for game development, which is applied to an electronic device, where the electronic device is configured with a generative confrontation network, where the generative confrontation network includes a generative model and an authentication model, and the method includes:

acquiring first input data;

converting the first input data into a corresponding noise picture according to a preset conversion function;

inputting the noise picture into an initial generation model to obtain a first picture with a first label;

inputting a second picture with a second label and the first picture into an initial identification model to obtain a first identification result of the initial identification model on the first picture and a second identification result on the second picture;

and adjusting the network parameters of the initial identification model based on the first identification result and the second identification result, and adjusting the network parameters of the initial generation model based on the first identification result until the identification result of the initial identification model after parameter adjustment on the picture obtained by the initial generation model after parameter adjustment meets the preset condition, so as to obtain a target generation model and a target identification model, wherein the target generation model is used for generating target picture resources for game development.

Optionally, in an embodiment of the present application, the step of converting the first input data into a corresponding noise picture according to a preset conversion function includes:

processing the numerical data through the conversion function to obtain the picture size, the resolution and the initial pixel value corresponding to the numerical data;

and obtaining the noise picture according to the picture size, the resolution and the initial pixel value.

Optionally, in an embodiment of the present application, the step of inputting the noise picture into an initial generation model to obtain a first picture with a first tag includes:

and adjusting the pixel value of each pixel point in the noise picture through the initial generation model, and adding a first label to the noise picture to obtain the first picture with the first label.

Optionally, in an embodiment of the present application, the step of inputting the second image with the second label and the first image into an initial authentication model to obtain a first authentication result of the initial authentication model for the first image and a second authentication result for the second image includes:

extracting the pixel distribution characteristics of the first picture and the pixel distribution characteristics of the second picture;

obtaining the first identification result according to the pixel distribution characteristics of the first picture and a first target function corresponding to the initial identification model;

and obtaining the second identification result according to the pixel distribution characteristics of the second picture and the first objective function.

Optionally, in an embodiment of the present application, the step of adjusting the network parameter of the initial authentication model based on the first authentication result and the second authentication result includes:

and adjusting parameters of the first objective function according to a gradient rise algorithm and the first identification result and the second identification result so that the identification result of the initial identification model on the picture obtained by the initial generation model approaches to the first label.

Optionally, in an embodiment of the present application, the step of adjusting the network parameter of the initial generative model based on the first authentication result includes:

and adjusting parameters of a second objective function corresponding to the initial generation model according to a gradient descent algorithm and the first identification result, so that an identification result obtained by identifying the picture generated by the initial generation model through the initial identification model approaches to the second label.

In a second aspect, an embodiment of the present application provides a picture resource generation apparatus for game development, which is applied to an electronic device configured with a generative confrontation network, where the generative confrontation network includes a generative model and an authentication model, and the apparatus includes:

the acquisition module is used for acquiring first input data;

the conversion module is used for converting the first input data into a corresponding noise picture according to a preset conversion function;

the generating module is used for inputting the noise picture into an initial generating model to obtain a first picture with a first label;

the identification module is used for inputting a second picture with a second label and the first picture into an initial identification model to obtain a first identification result of the initial identification model on the first picture and a second identification result of the initial identification model on the second picture;

and the adjusting module is used for adjusting the network parameters of the initial identification model based on the first identification result and the second identification result, adjusting the network parameters of the initial generation model based on the first identification result, and obtaining a target generation model and a target identification model when the identification result of the initial identification model after parameter adjustment on the picture obtained by the initial generation model after parameter adjustment meets the preset condition, wherein the target generation model is used for generating target picture resources for game development.

Optionally, in an embodiment of the present application, the first input data includes numerical data in a preset range, and the conversion module is specifically configured to:

processing the numerical data through the conversion function to obtain the picture size, the resolution and the initial pixel value corresponding to the numerical data;

and obtaining the noise picture according to the picture size, the resolution and the initial pixel value.

Optionally, in an embodiment of the present application, the generating module is specifically configured to:

and adjusting the pixel value of each pixel point in the noise picture through the initial generation model, and adding a first label to the noise picture to obtain the first picture with the first label.

Optionally, in an embodiment of the present application, the authentication module is specifically configured to:

extracting the pixel distribution characteristics of the first picture and the pixel distribution characteristics of the second picture;

obtaining the first identification result according to the pixel distribution characteristics of the first picture and a first target function corresponding to the initial identification model;

and obtaining the second identification result according to the pixel distribution characteristics of the second picture and the first objective function.

Optionally, in an embodiment of the present application, the adjusting module is specifically configured to:

and adjusting parameters of the first objective function according to a gradient rise algorithm and the first identification result and the second identification result so that the identification result of the initial identification model on the picture obtained by the initial generation model approaches to the first label.

Optionally, in an embodiment of the present application, the adjusting module is further specifically configured to:

and adjusting parameters of a second objective function corresponding to the initial generation model according to a gradient descent algorithm and the first identification result, so that an identification result obtained by identifying the picture generated by the initial generation model through the initial identification model approaches to the second label.

In a third aspect, an embodiment of the present application provides a storage medium, which includes a computer program, and the computer program is used to implement the method described in any one of the above.

In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory is used to store a computer program, and the processor is used to load and execute the computer program, so that the electronic device executes the method described in any one of the above.

Compared with the prior art, the picture resource generation method for game development provided in the embodiment of the application has at least the following technical effects or advantages:

according to the picture resource generation method for game development, provided by the embodiment of the application, the generation type countermeasure network comprising the generation model and the identification model is trained, the target generation model with the generalization capability of generating a relatively real picture is obtained, then the target generation model is adopted to process random input data, and the picture resource can be automatically generated according to the random input data for game developers to use. By the method, the manual design cost in the development process can be reduced, the production speed of the picture resources can be increased, the selection space of the picture resources is enriched, and the game development efficiency is improved.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;

FIG. 2 is a schematic flowchart illustrating steps of a method for generating a picture resource for game development according to an embodiment of the present disclosure;

fig. 3 is a schematic diagram of a noise picture obtained by conversion through a conversion function in the picture resource generation method for game development according to the embodiment of the present application;

fig. 4 to 5 are schematic diagrams of image effects obtained by generating a model in an image resource generation method for game development according to an embodiment of the present application;

fig. 6 is a schematic flowchart illustrating a sub-step of step S30 in a picture resource generation method for game development according to an embodiment of the present application;

fig. 7 is a schematic block diagram of a picture resource generation apparatus for game development according to an embodiment of the present application.

Icon: 20-an electronic device; 21-a memory; 22-a memory controller; 23-a processor; 70-picture resource generating means for game development; 701-an obtaining module; 702-a conversion module; 703-a generating module; 704-an authentication module; 705-adjustment module.

Detailed Description

In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments. It should be noted that the features of the following embodiments and examples may be combined with each other without conflict.

It should also be noted that in the description of the embodiments of the present application, the terms "first", "second", and the like are used for distinguishing the description, and are not to be construed as indicating or implying relative importance.

It is known that during the development of games and application software, a large number of picture resources are used, for example: character models, scene pictures and prop icons in the game, software icons, function icons, background pictures, user interfaces and the like in application software.

However, in the prior art, these picture resources are usually obtained by manual design, which not only requires a lot of manpower and material resources, but also has low production efficiency.

To solve the problem, embodiments of the present application provide a method and an apparatus for generating picture resources for game development, so as to improve the production efficiency of the picture resources and reduce the production cost of the picture resources.

Referring to fig. 1, a schematic structural diagram of an electronic device provided in an embodiment of the present application is shown, where the electronic device 20 includes a picture resource generating device 70 for game development, a memory 21, a storage controller 22, and a processor 23.

The memory 21, the memory controller 22 and the processor 23 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The picture resource generating device 70 for game development may include at least one software functional module which may be stored in the memory 21 in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the electronic device 20. The processor 23 is configured to execute executable modules stored in the memory 21, such as software functional modules and computer programs included in the picture resource generating device 70 for game development, so as to make the electronic device 20 execute a picture resource generating method for game development as described below.

Referring to fig. 2, a schematic step flow diagram of a method for generating a picture resource for game development according to an embodiment of the present application is shown. The method may be applied to the electronic device 20 shown in fig. 1, so as to provide the electronic device 20 with a picture resource generation function as described below.

The following describes in detail a method for generating a picture resource for game development according to an embodiment of the present application with reference to fig. 2.

In the embodiment of the present application, the electronic device is configured with a generative confrontation network gan (generative adaptive network), and the generative confrontation network includes a generative model and an authentication model.

Referring to fig. 2, a method for generating a picture resource for game development provided in an embodiment of the present application includes:

in step S10, first input data is acquired.

Step S20, converting the first input data into a corresponding noise picture according to a preset conversion function.

And step S30, inputting the noise picture into the initial generation model to obtain a first picture with a first label.

Step S40, inputting the second picture with the second label and the first picture into an initial identification model, and obtaining a first identification result of the initial identification model for the first picture and a second identification result for the second picture.

Those skilled in the art should understand that the generative confrontation network GAN is a deep learning model, in which the generative model is used to generate pictures according to a random input data, and the identification model is used to identify the quality of the pictures generated by the generative model and assist the generative model to improve the quality of the generated pictures, specifically, while identifying the authenticity of the pictures generated by the generative model, the identification result is fed back to the generative model to help the generative model to continuously optimize.

Since the generalization ability of the generative model and the identification model is poor before training, in other words, when the generative model is used, the generated picture may be blurred and the content in the picture may not be understood, and when the identification model is used, the identification result may be inaccurate, in the embodiment of the present application, the initial generative model and the initial identification model in the generative countermeasure network need to be trained before the generative model is used to automatically generate the picture resource for the developer to use.

It should be understood that, in the embodiment of the present application, the authentication model is used to perform a truth evaluation on the picture generated by the generation model, and then feed back the truth evaluation result to the generation model, so that the generation model can improve the truth of the picture generated by the generation model by adjusting the network parameters. Meanwhile, since the evaluation capability of the authentication model needs to be continuously improved through training, in this embodiment, while the generated model is trained, a first picture with a first tag generated by the generated model and a second picture with a second tag prepared in advance need to be input into the authentication model, so that the authentication model is trained to obtain the capability of accurately authenticating the authenticity of the picture.

It should be noted that, in the embodiment of the present application, the first picture with the first tag may include a plurality of pictures, and the second picture with the second tag may also include a plurality of pictures. The plurality of pictures included in the first picture can be generated by different first input data, or can be generated by inputting the same first input data into the generation model under different iteration times.

Specifically, in the embodiment of the present application, the first input data may be any numerical value. In a possible implementation manner, an input arbitrary value may be converted into a corresponding noise picture by presetting a conversion function. For example, when the first input data is 100, the first input data may be converted into a noise picture with 100 × 100 pixels through the conversion function, and the noise picture may be formed by arranging a plurality of pixels with a gray value of 0 and a plurality of pixels with a gray value of non-0 at intervals (as shown in fig. 3). It should be noted that, in the embodiment of the present application, the picture size, the resolution, and the correspondence between the initial pixel value and the first input data of the noise picture may be obtained by pre-establishing a mapping relationship in the conversion function.

Further, after the noise picture is input into the initial generation model, the pixel value (such as RGB value) of each pixel point is adjusted through the generation model, and the first picture shown in fig. 4 can be generated.

It should be understood that the image shown in fig. 4 is only used for example, and the generative model is still poor in generating capability, and after many training, the generative model can be continuously optimized, so that a more realistic image as shown in fig. 5 is obtained through the generative model.

It should also be understood that, in the embodiment of the present application, the generation model may learn different picture generation capabilities based on the specific content included in the second picture, so as to obtain the first pictures with different shapes. For example: when the second picture is a real cartoon character, the generating model can generate a similar character picture according to the characteristics of the second picture; and when the second picture is a real scenery picture, the generation model can generate a similar scene picture according to the characteristics of the second picture.

Further, in the embodiment of the present application, the first label is used to mark a plurality of pictures generated by the initial generation model as dummy pictures (i.e. let the identification model learn features of dummy pictures), and the second label is used to mark a plurality of second pictures as real pictures (i.e. let the identification model learn features of real pictures). In the embodiment of the application, a large number of first pictures with first labels and second pictures with second labels are input into the initial authentication model for training, so that the authentication model can obtain the capability of authenticating the authenticity of the images according to the characteristics of the pictures, and then the corresponding authentication results are output according to the characteristics of any input pictures.

Referring to fig. 6, in the embodiment of the present application, the step S40 may include the following sub-steps:

in the substep S401, the pixel distribution characteristics of the first picture and the pixel distribution characteristics of the second picture are extracted.

And a substep S402, obtaining a first identification result according to the pixel distribution characteristics of the first picture and a first objective function corresponding to the initial identification model.

And a substep S403, obtaining a second discrimination result according to the pixel distribution characteristic of the second picture and the first objective function.

Specifically, in this embodiment of the application, the pixel distribution characteristics of the first picture and the pixel distribution characteristics of the second picture may include a pixel value characteristic of each pixel in the picture, a contour shape characteristic formed by a plurality of adjacent pixels, and the like, and each of the characteristics is used as a variable in the first objective function, and the identification model may calculate the identified pixel distribution characteristics by respectively substituting the identified pixel distribution characteristics into corresponding variables of the first objective function, so as to obtain an identification result corresponding to the input picture.

Further, with continued reference to fig. 2, after the above step S40, the method further includes:

step S50, adjusting the network parameters of the initial identification model based on the first identification result and the second identification result, and adjusting the network parameters of the initial generation model based on the first identification result until the identification result of the initial identification model after parameter adjustment on the picture obtained by the initial generation model after parameter adjustment satisfies a preset condition, obtaining a target generation model and a target identification model, wherein the target generation model is used for generating a target picture resource for game development.

It should be understood by those skilled in the art that, in the embodiment of the present application, the purpose of training the generative confrontation network is to obtain a generative model capable of generating a picture with high degree of reality, and the role of the identification model is to assist the training of the generative model and to detect the generalization ability of the generative model.

Specifically, in an embodiment of the application, in the process of adjusting the network parameter of the initial authentication model based on the first authentication result of the initial authentication model for the first picture and the second authentication result of the initial authentication model for the second picture, the parameter of the first objective function may be adjusted according to a gradient ascent algorithm and the authentication results of the authentication model for the first picture and the second picture, so that the authentication result of the authentication model for the first picture approaches to the first label. In the process of adjusting the network parameter of the initial generation model based on the authentication result of the initial authentication model for the first picture, the parameter of the second objective function corresponding to the generation model can be adjusted according to the gradient descent algorithm and the authentication result of the authentication model for the first picture, so that the authentication result obtained by authenticating the first picture generated by the generation model through the initial authentication model approaches to the second label.

For example, in an embodiment of the present application, the authentication result of the authentication model for the input picture may be calculated by the first objective function to obtain a value between 0 and 1, where the closer to 0, the higher the degree of truth of the picture is, and the closer to 1, the lower the degree of truth of the picture is (that is, the first label may be represented by 1, and the second label may be represented by 0).

In the training process of the identification model, based on the identification result of the identification model on the first picture and the second picture, a gradient ascent algorithm may be used to adjust the parameter of the first objective function corresponding to the identification model (i.e., the weight coefficient corresponding to each of the above feature variables), so that the value corresponding to the identification result of the identification model on the first picture generated by the generation model is raised. In the training process of the generative model, based on the identification result of the identification model on the first picture, a gradient descent algorithm may be used to adjust the parameter of the second objective function corresponding to the generative model, so that the value corresponding to the identification result obtained by identifying the first picture generated by the initial generative model by the initial identification model is descended (i.e., the authenticity of the picture generated by the generative model is improved).

Further, after the network parameters of the identification model and the generation model are adjusted, if the identification result of the identification model on the picture generated by the generation model can reach 0.5, it indicates that the picture generated by the generation model is high in reality, and at this time, the training can be finished to obtain the target generation model and the target identification model.

Since the generative countermeasure network is a prior art, those skilled in the art will understand the specific training process and the usage process thereof, for example, those skilled in the art should know that the first objective function described in the embodiments of the present application can be expressed asThe second objective function may be expressed asWherein G represents a generative model Generator, D represents an identification model Discrimatoror, PdataRepresenting the distribution of the second picture, PGRepresenting the distribution of the first picture generated by the generative model, E represents the mathematical expectation. Therefore, details thereof are not repeated in the embodiments of the present application.

Further, in the embodiment of the present application, after the target generation model is obtained through the training process, the second input data input by the user is processed through the target generation model and the conversion function, and then the image resource with higher fidelity can be automatically generated.

It should be noted that, in the embodiment of the present application, the second input data may be any numerical data within a preset range, and the second input data is converted by the above-mentioned conversion function to obtain a corresponding noise picture, and then the noise picture corresponding to the second input data is input into the target generation model for processing, so as to quickly obtain a picture resource with a higher degree of reality.

For game or application software developers, a large number of picture resources can be quickly generated by the method, and then the proper pictures are selected to be used as materials required by game or application software development, so that the production speed of the picture resources is greatly improved, the production cost of the picture resources is reduced, and meanwhile, the selection space of the picture resources is enriched.

It should be further noted that the method for generating picture resources for game development provided in the embodiment of the present application may be applied to other scenes requiring picture resources to be used, such as appearance design, artistic creation, and the like, besides being used to generate picture materials required by games and application software. Under different application scenes, the model can be trained by using pictures with different styles or different contents as the second picture, so that the model can obtain the capability of generating similar pictures.

In summary, the method for generating picture resources for game development provided in the embodiment of the present application has the following technical effects or advantages, compared with the prior art:

according to the picture resource generation method for game development, provided by the embodiment of the application, the generation type countermeasure network comprising the generation model and the identification model is trained, the target generation model with the generalization capability of generating a relatively real picture is obtained, then the target generation model is adopted to process random input data, and the picture resource can be automatically generated according to the random input data for game developers to use. By the method, the manual design cost in the development process can be reduced, the production speed of the picture resources can be increased, the selection space of the picture resources is enriched, and the game development efficiency is improved.

Referring to fig. 7, an embodiment of the present application further provides a picture resource generating apparatus 70 for game development, which may be applied to the electronic device 20 shown in fig. 1, so as to provide the electronic device 20 with the picture resource generating function as described above.

Specifically, in the embodiment of the present application, the electronic device 20 is configured with a generative countermeasure network, the generative countermeasure network includes a generative model and an authentication model, and the apparatus includes an obtaining module 701, a converting module 702, a generating module 70/3, an authentication module 704, and an adjusting module 705.

The obtaining module 701 is configured to obtain first input data; the conversion module 702 is configured to convert the first input data into a corresponding noise picture according to a preset conversion function; the generating module 703 is configured to input the noise picture into an initial generating model, so as to obtain a first picture with a first tag; the identification module 704 is configured to input a second picture with a second tag and the first picture into an initial identification model, so as to obtain a first identification result of the initial identification model for the first picture and a second identification result for the second picture; the adjusting module 705 is configured to adjust a network parameter of the initial identification model based on the first identification result and the second identification result, and adjust a network parameter of the initial generation model based on the first identification result until an identification result of the initial identification model after parameter adjustment on a picture obtained by the initial generation model after parameter adjustment satisfies a preset condition, so as to obtain a target generation model and a target identification model, where the target generation model is used to generate a target picture resource for game development.

Optionally, in an embodiment of the present application, the first input data includes numerical data in a preset range, and the conversion module 702 is specifically configured to:

processing the numerical data through the conversion function to obtain the picture size, the resolution and the initial pixel value corresponding to the numerical data; and obtaining the noise picture according to the picture size, the resolution and the initial pixel value.

Optionally, in an embodiment of the present application, the generating module 703 is specifically configured to:

and adjusting the pixel value of each pixel point in the noise picture through the initial generation model, and adding a first label to the noise picture to obtain the first picture with the first label.

Optionally, in an embodiment of the present application, the identifying module 704 is specifically configured to:

extracting the pixel distribution characteristics of the first picture and the pixel distribution characteristics of the second picture; and then, obtaining the first identification result according to the pixel distribution characteristic of the first picture and a first objective function corresponding to the initial identification model, and obtaining the second identification result according to the pixel distribution characteristic of the second picture and the first objective function.

Optionally, in an embodiment of the present application, the adjusting module 705 is specifically configured to:

and adjusting parameters of the first objective function according to a gradient rise algorithm and the first identification result and the second identification result so that the identification result of the initial identification model on the picture obtained by the initial generation model approaches to the first label.

Optionally, in an embodiment of the present application, the adjusting module 705 is further specifically configured to:

and adjusting parameters of a second objective function corresponding to the initial generation model according to a gradient descent algorithm and the first identification result, so that an identification result obtained by identifying the picture generated by the initial generation model through the initial identification model approaches to the second label.

Since the picture resource generating device 70 for game development described in this embodiment is a device used for implementing the picture resource generating method for game development in this embodiment, based on the picture resource generating method for game development described in this embodiment, a person skilled in the art can understand a specific implementation manner and various variations of the picture resource generating device 70 for game development in this embodiment, and therefore, a detailed description of how the picture resource generating device 70 for game development implements the method in this embodiment is not provided here. The picture resource generating device 70 for game development, which is adopted by a person skilled in the art to implement the picture resource generating method for game development in the embodiment of the present application, is within the scope of the present application.

Besides, the embodiment of the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program performs the steps in the picture resource generation method for game development as described above.

As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

The above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

The application discloses:

a1, a picture resource generation method for game development, which is applied to an electronic device configured with a generative confrontation network, the generative confrontation network comprising a generative model and an authentication model, the method comprising:

acquiring first input data;

converting the first input data into a corresponding noise picture according to a preset conversion function;

inputting the noise picture into an initial generation model to obtain a first picture with a first label;

inputting a second picture with a second label and the first picture into an initial identification model to obtain a first identification result of the initial identification model on the first picture and a second identification result on the second picture;

and adjusting the network parameters of the initial identification model based on the first identification result and the second identification result, and adjusting the network parameters of the initial generation model based on the first identification result until the identification result of the initial identification model after parameter adjustment on the picture obtained by the initial generation model after parameter adjustment meets the preset condition, so as to obtain a target generation model and a target identification model, wherein the target generation model is used for generating target picture resources for game development.

A2. The method as claimed in a1, wherein the first input data includes numerical data in a preset range, and the step of converting the first input data into the corresponding noise picture according to a preset conversion function includes:

processing the numerical data through the conversion function to obtain the picture size, the resolution and the initial pixel value corresponding to the numerical data;

and obtaining the noise picture according to the picture size, the resolution and the initial pixel value.

A3. The method of a1, wherein the step of inputting the noise picture into an initial generation model to obtain a first picture with a first label comprises:

and adjusting the pixel value of each pixel point in the noise picture through the initial generation model, and adding a first label to the noise picture to obtain the first picture with the first label.

A4. The method according to any of a1-A3, wherein the step of inputting the second labeled picture and the first picture into an initial authentication model to obtain a first authentication result of the initial authentication model for the first picture and a second authentication result for the second picture comprises:

extracting the pixel distribution characteristics of the first picture and the pixel distribution characteristics of the second picture;

obtaining the first identification result according to the pixel distribution characteristics of the first picture and a first target function corresponding to the initial identification model;

and obtaining the second identification result according to the pixel distribution characteristics of the second picture and the first objective function.

A5. The method of claim a4, wherein the step of adjusting network parameters of the initial authentication model based on the first authentication result and the second authentication result comprises:

and adjusting parameters of the first objective function according to a gradient rise algorithm and the first identification result and the second identification result so that the identification result of the initial identification model on the picture obtained by the initial generation model approaches to the first label.

A6. The method of a4, wherein the step of adjusting the network parameters of the initial generative model based on the first authentication result comprises:

and adjusting parameters of a second objective function corresponding to the initial generation model according to a gradient descent algorithm and the first identification result, so that an identification result obtained by identifying the picture generated by the initial generation model through the initial identification model approaches to the second label.

B1. A picture resource generation device for game development, which is applied to an electronic device configured with a generative confrontation network, wherein the generative confrontation network comprises a generative model and an authentication model, and the device comprises:

the acquisition module is used for acquiring first input data;

the conversion module is used for converting the first input data into a corresponding noise picture according to a preset conversion function;

the generating module is used for inputting the noise picture into an initial generating model to obtain a first picture with a first label;

the identification module is used for inputting a second picture with a second label and the first picture into an initial identification model to obtain a first identification result of the initial identification model on the first picture and a second identification result of the initial identification model on the second picture;

and the adjusting module is used for adjusting the network parameters of the initial identification model based on the first identification result and the second identification result, adjusting the network parameters of the initial generation model based on the first identification result, and obtaining a target generation model and a target identification model when the identification result of the initial identification model after parameter adjustment on the picture obtained by the initial generation model after parameter adjustment meets the preset condition, wherein the target generation model is used for generating target picture resources for game development.

B2. The apparatus of claim B1, wherein the first input data includes numerical data within a preset range, and the conversion module is specifically configured to:

processing the numerical data through the conversion function to obtain the picture size, the resolution and the initial pixel value corresponding to the numerical data;

and obtaining the noise picture according to the picture size, the resolution and the initial pixel value.

B3. The apparatus of B1, wherein the generating module is specifically configured to:

and adjusting the pixel value of each pixel point in the noise picture through the initial generation model, and adding a first label to the noise picture to obtain the first picture with the first label.

B4. The apparatus of any one of claims B1-B3, wherein the discrimination module is specifically configured to:

extracting the pixel distribution characteristics of the first picture and the pixel distribution characteristics of the second picture;

obtaining the first identification result according to the pixel distribution characteristics of the first picture and a first target function corresponding to the initial identification model;

and obtaining the second identification result according to the pixel distribution characteristics of the second picture and the first objective function.

B5. The apparatus of B4, wherein the adjustment module is specifically configured to:

and adjusting parameters of the first objective function according to a gradient rise algorithm and the first identification result and the second identification result so that the identification result of the initial identification model on the picture obtained by the initial generation model approaches to the first label.

B6. The apparatus of B4, wherein the adjustment module is further specifically configured to:

and adjusting parameters of a second objective function corresponding to the initial generation model according to a gradient descent algorithm and the first identification result, so that an identification result obtained by identifying the picture generated by the initial generation model through the initial identification model approaches to the second label.

C1. A storage medium, characterized in that the storage medium comprises a computer program for implementing the method according to any of a1-a 6.

D1. An electronic device, comprising a memory for storing a computer program and a processor for loading execution of the computer program to cause the electronic device to perform the method according to any of a1-a 6.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:目标场景画面的还原方法、装置、电子设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类