Image drawing method, image drawing apparatus, and storage medium

By providing an image drawing method, allowing users to select image drawing style and text description, and calling the image drawing model to generate target images, it solves the problem that existing AI painting technology cannot create unique and innovative works, and achieves high-quality and personalized image generation.

CN119919535APending Publication Date: 2025-05-02BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311433830.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-31
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

Existing AI painting techniques cannot create truly unique and innovative works, the generated images lack human creativity and imagination, and there is a problem that the generated images may be distorted or unreal.

Method used

Provides an image drawing method, by obtaining the image to be created, displaying image drawing options, including image drawing style options and image drawing text description options, calling the image drawing model based on the user-selected style and text description, generating and displaying the target image.

Benefits of technology

It realizes the generation of target images that meet similarity conditions and text descriptions based on the user's creativity and style, which improves the uniqueness and reality of the image and meets the user's creative needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119919535A_ABST
    Figure CN119919535A_ABST
Patent Text Reader

Abstract

The invention relates to an image drawing method, an image drawing device and a storage medium. The image drawing method comprises the following steps: acquiring a to-be-created first image; in response to the detection of the operation of performing drawing processing on the first image to be created, displaying image drawing options, the image drawing options including an image drawing style option and an image drawing text description option; determining a target image drawing style based on a target image drawing style option selected by the user, and obtaining target image drawing text description input by the user based on the image drawing text description option; calling an image drawing model based on the target image drawing style and the target image drawing text description; based on the image drawing model, a target image is generated and displayed, the target image and the to-be-created first image meet the similarity condition, and the target image drawing style and the target image drawing text description are matched. Through the method and the device, custom style creation can be realized, and secondary creation can be carried out according to user requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of model training, style image generation, image segmentation, cloud / mobile model training and reasoning, and related artificial intelligence technologies, and in particular to an image drawing method, an image drawing device, and a storage medium. Background Art

[0002] Artificial Intelligence (AI) image generation technology refers to the method of generating images using artificial intelligence technology. At present, AI images have made great progress. AI painting and AI generation technology are one of the hot research directions in the field of artificial intelligence in recent years. AI painting technology refers to the use of artificial intelligence technology to generate new paintings, including hand-painted and digital paintings. At present, AI painting technology has made great progress, and the research status of this field is as follows:

[0003] AI painting technology mainly uses technologies such as Generative Adversarial Networks (GAN) to generate realistic works of art. This technology can learn the style and skills of artists by training models to generate images with artistic value. At present, some commercial AI painting software has been launched, such as Prisma, DeepArt, Stable Diffusion, Midjourney, etc.

[0004] Among the related technologies, the research status of AI painting and AI portrait generation technology is still relatively preliminary. The generated images lack human creativity and imagination, and are unable to create truly unique and innovative works. They lack details and realism. In addition to the fact that the generated images may be distorted or unrealistic, there are also some unreasonable problems in the generated images, and model training cannot be achieved. Summary of the invention

[0005] In order to overcome the problems existing in the related art, the present disclosure provides an image drawing method, an image drawing device and a storage medium.

[0006] According to a first aspect of an embodiment of the present disclosure, there is provided an image drawing method, the method comprising acquiring a first image to be created; in response to detecting an operation of drawing the first image to be created, displaying image drawing options, the image drawing options comprising an image drawing style option and an image drawing text description option; determining a target image drawing style based on a target image drawing style option selected by a user, and acquiring a target image drawing text description input by the user based on the image drawing text description option; based on the target image drawing style and the target image drawing text description, calling an image drawing model, wherein different image drawing styles and / or image drawing text descriptions correspond to different image drawing models; based on the image drawing model, generating and displaying a target image, the target image meets a similarity condition with the first image to be created, and matches the target image drawing style and the target image drawing text description.

[0007] In one embodiment, the image drawing style options include a default image drawing style option and a custom image drawing style option; and determining the target image drawing template based on the image drawing style option selected by the user includes: in response to the user selecting the default image drawing style option, using the image drawing style corresponding to the default image drawing style option as the target image drawing style; or in response to the user selecting the custom image drawing style option, obtaining custom image drawing style data provided by the user, and training an image drawing model based on the custom image drawing style data, and using the image drawing style generated based on the image drawing model as the target image drawing style.

[0008] In one embodiment, the obtaining of the first image to be created includes: obtaining the first image to be created drawn by a user on an electronic device; or obtaining the first image to be created selected by the user based on a preset storage path.

[0009] In one embodiment, the image drawing option also includes an image drawing modification amplitude option, and the image drawing modification amplitude option is used to determine the similarity between the target image to be drawn and the first image to be created; the similarity condition is determined based on the image drawing modification amplitude corresponding to the image drawing modification amplitude option, and different image drawing modification amplitudes correspond to different similarities.

[0010] In one embodiment, the generating and displaying of the target image includes: generating an initial target image; optimizing the initial target image and displaying the optimized target image; the optimization includes at least one of the following: filtering out target content information; image area repairing; redrawing based on a user's redrawing operation; and image enhancement.

[0011] In one embodiment, the image drawing model is pre-trained in the following manner: obtaining a style image sample set selected by a user; preprocessing the style image sample set to obtain a style image training set; determining a label data set corresponding to the style image in the style image training set, wherein the label data set includes an image drawing text description corresponding to the style image; and training the image drawing model based on the label data set and the style image training set.

[0012] In one embodiment, obtaining the style image sample set selected by the user includes: providing an image selection path in response to detecting that the user triggers an operation to select the style image sample set; obtaining the style image selected by the user based on the image selection path to obtain the style image sample set.

[0013] In one embodiment, the preprocessing of the style image sample set to obtain a style image training set includes: screening the style images in the style image sample set to obtain a screened style image sample set; obtaining a style image training set based on the screened style image sample set; the screened images satisfy at least one of the following: the image resolution is greater than a resolution threshold; the number of images satisfies a preset number; the display attributes of the images satisfy attribute conditions, and the display attributes include at least one of the following: blur, brightness, and contrast.

[0014] In one embodiment, obtaining a style image training set based on the screened style image sample set includes: performing edge cutting on the style image samples in the screened style image sample set to obtain a cut style image sample set; performing resolution compression on the style image samples in the cut style image sample set whose resolution is higher than a resolution threshold to obtain style image samples with a preset resolution; cropping the style image samples with the preset resolution according to different random cropping ratios to obtain a preset number of style image sample sets; and determining the preset number of style image sample sets as the style image training set.

[0015] In one embodiment, the method further includes: determining the similarity of each style image sample in the style image sample set; and filtering out the style image sample set whose similarity is lower than a threshold to obtain a style image training set whose similarity is higher than the similarity threshold.

[0016] In one embodiment, the training of the image drawing model based on the label data set and the style image training set includes: calling a first pre-trained model, and training a second pre-trained model based on the label data set and the style image training set; based on the first pre-trained model and the second pre-trained model, repeatedly training each style image in the style image training set based on the label data set for a preset number of times to obtain the image drawing model.

[0017] According to a second aspect of an embodiment of the present disclosure, there is provided an image drawing device, the device comprising: an acquisition unit, for acquiring a first image to be created; a detection unit, for displaying image drawing options in response to detecting an operation of drawing the first image to be created, the image drawing options comprising an image drawing style option and an image drawing text description option; a determination unit, for determining a target image drawing style based on a target image drawing style option selected by a user, and obtaining a target image drawing text description input by the user based on the image drawing text description option; a calling unit, for calling an image drawing model based on the target image drawing style and the target image drawing text description, wherein different image drawing styles and / or image drawing text descriptions correspond to different image drawing models; and a generation unit, for generating and displaying a target image based on the image drawing model, the target image meeting a similarity condition with the first image to be created, and matching the target image drawing style and the target image drawing text description.

[0018] In one embodiment, the image drawing style options include a default image drawing style option and a custom image drawing style option; the determination unit determines the target image drawing template based on the image drawing style option selected by the user in the following manner, including: in response to the user selecting the default image drawing style option, using the image drawing style corresponding to the default image drawing style option as the target image drawing style; or in response to the user selecting the custom image drawing style option, obtaining custom image drawing style data provided by the user, and training an image drawing model based on the custom image drawing style data, and using the image drawing style generated based on the image drawing model as the target image drawing style.

[0019] In one embodiment, the acquisition unit acquires the first image to be created in the following manner, including: acquiring the first image to be created drawn by a user on an electronic device; or acquiring the first image to be created selected by the user based on a preset storage path.

[0020] In one embodiment, the image drawing option also includes an image drawing modification amplitude option, and the image drawing modification amplitude option is used to determine the similarity between the target image to be drawn and the first image to be created based on the following method adopted by the determination unit; the similarity condition is determined based on the image drawing modification amplitude corresponding to the image drawing modification amplitude option, and different image drawing modification amplitudes correspond to different similarities.

[0021] In one embodiment, the generation unit generates and displays the target image in the following manner, including: generating an initial target image; optimizing the initial target image and displaying the optimized target image; the optimization includes at least one of the following: filtering out target content information; image area repairing; redrawing based on a user's redrawing operation; and image enhancement.

[0022] In one embodiment, the image drawing model is pre-trained in the following manner: obtaining a style image sample set selected by a user; preprocessing the style image sample set to obtain a style image training set; determining a label data set corresponding to the style image in the style image training set, wherein the label data set includes an image drawing text description corresponding to the style image; and training the image drawing model based on the label data set and the style image training set.

[0023] In one embodiment, the acquisition unit acquires the style image sample set selected by the user in the following manner, including: providing an image selection path in response to detecting that the user triggers an operation to select the style image sample set; acquiring the style image selected by the user based on the image selection path to obtain the style image sample set.

[0024] In one embodiment, the determination unit preprocesses the style image sample set in the following manner to obtain a style image training set, including: screening the style images in the style image sample set to obtain a screened style image sample set; obtaining a style image training set based on the screened style image sample set; the screened images satisfy at least one of the following: the image resolution is greater than a resolution threshold; the number of images satisfies a preset number; the display attributes of the images satisfy attribute conditions, and the display attributes include at least one of the following: blur, brightness, and contrast.

[0025] In one embodiment, the determination unit obtains a style image training set based on the screened style image sample set in the following manner, including: performing edge cutting on the style image samples in the screened style image sample set to obtain a cut style image sample set; performing resolution compression on the style image samples in the cut style image sample set whose resolution is higher than a resolution threshold to obtain style image samples with a preset resolution; cropping the style image samples with the preset resolution according to different random cropping ratios to obtain a preset number of style image sample sets; and determining the preset number of style image sample sets as the style image training set.

[0026] In one embodiment, the determining unit is further used to: determine the similarity of each style image sample in the style image sample set; and filter out the style image sample set with a similarity lower than a threshold to obtain a style image training set with a similarity greater than the similarity threshold.

[0027] In one embodiment, the calling unit trains an image drawing model based on the label data set and the style image training set in the following manner, including: calling a first pre-trained model, and training a second pre-trained model based on the label data set and the style image training set; based on the first pre-trained model and the second pre-trained model, repeatedly training each style image in the style image training set based on the label data set for a preset number of times to obtain an image drawing model.

[0028] According to a third aspect of an embodiment of the present disclosure, there is provided an image drawing device, comprising: a processor; and a memory for storing processor executable instructions; wherein the processor is configured to: execute the image drawing method described in the first aspect or any one of the implementations of the first aspect.

[0029] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, in which instructions are stored. When the instructions in the storage medium are executed by a processor, the processor is enabled to execute the image drawing method described in the second aspect or any one of the embodiments of the second aspect.

[0030] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: obtaining a first image to be created, obtaining a target image drawing style and a target image drawing text description based on an image drawing style option and an image drawing text description option, and calling an image drawing model based on the target image drawing style and the target image drawing text description, and generating and displaying a target image based on the image drawing model. Through the present disclosure, image creation is performed in a manner guided by both text description and the image drawn by the user, using a personalized generation model and a generation model based on user preferences and style to generate an image that meets the user's needs and preferences. It should be understood that the above general description and the detailed description below are merely exemplary and explanatory and do not limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0032] Figure 1 The figure is a flowchart of an image drawing method according to an exemplary embodiment.

[0033] Figure 2The figure is a flowchart of a method for selecting an image drawing style according to an exemplary embodiment.

[0034] Figure 3 It is a schematic diagram showing an optimization processing method according to an exemplary embodiment.

[0035] Figure 4 The figure is a flowchart of a method for obtaining an image rendering model according to an exemplary embodiment.

[0036] Figure 5 The figure is a flowchart of a method for obtaining a style image sample set according to an exemplary embodiment.

[0037] Figure 6 The figure is a flowchart of a method for obtaining a style image training set according to an exemplary embodiment.

[0038] Figure 7 The figure is a flow chart of a similarity analysis method according to an exemplary embodiment.

[0039] Figure 8 It is a schematic diagram of a data preprocessing method according to an exemplary embodiment.

[0040] Fig. 9 The figure is a flowchart of a method for image drawing model according to an exemplary embodiment.

[0041] Fig.10 It is a schematic diagram of a model training method according to an exemplary embodiment.

[0042] Fig.11 It is a schematic diagram showing an image drawing method according to an exemplary embodiment.

[0043] Fig.12 The figure is a block diagram of an image drawing device according to an exemplary embodiment.

[0044] Fig.13 It is a block diagram of a device for image drawing according to an exemplary embodiment. DETAILED DESCRIPTION

[0045] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure.

[0046] AI image generation technology refers to the method of generating images using artificial intelligence technology. At present, AI image generation technology has made great progress, mainly including the following aspects: (1) Image generation technology based on GAN: GAN is a generative model, which consists of a generator and a discriminator. The generator is used to generate images, and the discriminator is used to determine whether the generated image is real. By continuously training the generator and the discriminator, GAN can generate high-quality images. (2) Image generation technology based on VAE: VAE (Variational Autoencoder) is an autoencoder that can encode the input image into a latent vector and then decode the latent vector into an image. By adjusting the value of the latent vector, VAE can generate different images. (3) Image generation technology based on deep learning: Deep learning is a machine learning method that can learn the features of an image and generate new images. At present, deep learning has been widely used in the field of image generation, such as using convolutional neural networks (CNN) to generate images. (4) Image generation technology based on transfer learning: Transfer learning is a machine learning method that can apply an already learned model to a new task. In the field of image generation, transfer learning can apply already trained models to new image generation tasks, thereby accelerating the training process and improving the quality of generated images.

[0047] Among the related technologies, the research status of AI painting and AI portrait generation technology is still relatively preliminary. It does not allow users to upload personal images for secondary creation, only allows online creation, does not allow users to customize styles, and can only use default styles. The final raw image effect is false and has low aesthetics. It does not support multiple creations by users, does not support text-guided raw images, etc.

[0048] Furthermore, in the related art, AI painting cannot fully simulate human creativity and imagination. Although existing AI technologies can generate a variety of images, they lack human creativity and imagination and cannot create truly unique and innovative works. For example, the graffiti function of some drawing applications, the raw image effect will cause serious modifications to the graffiti and cannot fit the shape of the original graffiti draft. The images generated by AI painting may also lack details and realism. Although AI can generate high-resolution images, they may lack realism and details because they are only generated based on existing data without truly understanding the meaning and background of the image. For example, although AI painting in the related art increases the beauty of AI painting, it brings excessive rendering to the original picture / graffiti, resulting in the loss of the realism of the original picture. In addition to the problem that the generated image may be distorted or unrealistic, when generating images and processing relatively complex scenes or details, there are also some unreasonable problems in the generated images, such as the posture, lighting, shape of the person or object may not be natural enough. And the final generated image may have copyright and privacy issues, for example, images generated using AI technology may involve legal issues such as copyright of artistic creation. AI style generation technology requires a large amount of data and computing resources to train and generate images, which may lead to some environmental and resource waste problems. Pure cloud operation requires a lot of money. In addition, other mobile platforms such as mobile phones cannot realize the deployment of large model functions, consume large resources, and cannot realize model training.

[0049] In view of this, the present disclosure proposes an image drawing method.

[0050] The following describes an image drawing method in an embodiment of the present disclosure.

[0051] Figure 1 is a flowchart of an image drawing method according to an exemplary embodiment. Figure 1 As shown, the method includes the following.

[0052] In step S11, a first image to be created is obtained.

[0053] In the disclosed embodiment, a first image to be created input by a user is acquired, wherein the first image to be created may be a graffiti image of the user or an image locally uploaded by the user.

[0054] In step S12, in response to detecting an operation of performing a drawing process on the first image to be created, image drawing options are displayed, the image drawing options including an image drawing style option and an image drawing text description option.

[0055] In the embodiment of the present disclosure, in response to detecting that a user is performing AI creation, an operation of drawing a first image to be created is performed, and image drawing options are displayed on the mobile terminal used by the user, wherein the image drawing options include image drawing style options and image drawing text options. It can be understood that image drawing supports style drawing and text-guided drawing.

[0056] In step S13, based on the target image drawing style option selected by the user, the target image drawing style is determined, and the target image drawing text description input by the user based on the image drawing text description option is obtained.

[0057] In the embodiment of the present disclosure, the image drawing style selected by the user is used as the target image drawing style. For example, the image drawing style options include animation, cartoon, oil painting and other image drawing styles. If the user selects the oil painting option, the oil painting style is used as the target image drawing style. The image drawing text description input by the user is used as the target image drawing text description. For example, the user can input "red apple" as the target image drawing text description.

[0058] In step S14, an image drawing model is called based on the target image drawing style and the target image drawing text description, wherein different image drawing styles and / or image drawing text descriptions correspond to different image drawing models.

[0059] In the disclosed embodiment, based on the target image drawing style determined by the user and the target image drawing text description input by the user, the image drawing model is called to initialize the model. Different image drawing styles and / or image drawing text descriptions correspond to different image drawing models, and each image drawing model corresponds to the other.

[0060] In step S15, based on the image rendering model, a target image is generated and displayed, the target image meets the similarity condition with the first image to be created, and matches the target image rendering style and the target image rendering text description.

[0061] In the disclosed embodiment, a target image is generated and displayed based on a determined image drawing model. It is understandable that the target image is the final style image created and generated by the AI ​​painting. The target image meets the similarity condition with the first image to be created, and the target image can match the target drawing image style determined by the user and the target image drawing text description input by the user, that is, a matching target image is generated based on the target drawing image style and the target image drawing text description input by the user.

[0062] In the disclosed embodiment, the target image generated based on the target drawing image style and the target image drawing text description input by the user meets the user's needs, fits the user's preferences, and improves the user's experience.

[0063] The present disclosure embodiment will now explain the image drawing style options.

[0064] Figure 2 is a flowchart of a method for selecting an image drawing style according to an exemplary embodiment. Figure 2 As shown, the method includes the following.

[0065] In step S21, the user selects an image drawing style.

[0066] In the disclosed embodiment, an image drawing template is determined based on an image drawing style option selected by a user.

[0067] In step S22a, the default image drawing style is used.

[0068] In the embodiment of the present disclosure, in response to the user selecting the default image drawing style option, the image drawing style corresponding to the default image drawing style option is used as the target image drawing style. The default image drawing style can be understood as the default preset style in the user's mobile AI painting, which can include three-dimensional (3D) animation, anime, cartoon, line drawing, pixel, oil painting, watercolor, etc. If the default preset style includes the style required by the user, the default preset style type that the user likes can be selected.

[0069] In step S22b, the image drawing style is customized.

[0070] In an embodiment of the present disclosure, in response to a custom image drawing style option selected by a user, where the custom image drawing style is a style other than the default image drawing style, that is, the preset style does not include the style type that the user likes and needs, the custom image drawing style option is selected, custom image drawing style data provided by the user is obtained, and an image drawing model is trained based on the custom image drawing style data, and the image drawing style generated by the image drawing model is used as the target image drawing style.

[0071] In step S23, a target image drawing template is determined.

[0072] In the disclosed embodiment, a target image is generated based on a default image drawing style option or a custom image drawing style option selected by a user as a target image drawing template.

[0073] In the disclosed embodiment, users can select default preset styles and custom styles, which increases human creativity and imagination, and generates more realistic and natural style images. Characteristic images with unique styles can be generated, meeting the needs of AI creative paintings, achieving unique and innovative target images, and making the target images more personalized.

[0074] The following is an explanation of a method for obtaining a first image to be created in an embodiment of the present disclosure.

[0075] In the disclosed embodiment, the first image to be created obtained by the user may be the first image to be created drawn by the user on the electronic device. The first image to be created may be understood as the graffiti work of the user. It may also be the first image to be created selected by the user based on a preset storage path, that is, a local image to be created uploaded locally by the user.

[0076] In the disclosed embodiment, through AI creation of graffiti works and local images, the ability of rich AI style creation on the mobile terminal is achieved, providing users with a powerful AI creation platform.

[0077] The following is an explanation of the image drawing modification amplitude method in the embodiment of the present disclosure.

[0078] In an embodiment of the present disclosure, the image drawing option further includes an image drawing modification amplitude option, and the image drawing modification amplitude option is used to determine the similarity between the drawn target image and the first image to be created.

[0079] In the disclosed embodiment, during the target image generation process on the mobile terminal, the user is allowed to perform repeated operations multiple times. The user can achieve the raw image effect by adjusting the parameters of the drawing modification amplitude option, wherein the adjustment of the drawing modification amplitude can be understood as the AI ​​modification amplitude, and the similarity between the first image to be created and the target image is controlled by the control capability of the AI.

[0080] In one example, a mobile terminal extracts relevant information of a first image to be created, and AI controls relevant parameters. The lower the modification range, the closer the generation effect of the target image is to the first image to be created. If the modification range is larger, it can be understood that the generation effect of the target image is dominated by AI creation, and the generation effect is close to the selected target image drawing style.

[0081] In the disclosed embodiment, the similarity condition is determined based on the image drawing modification amplitude corresponding to the image drawing modification amplitude option. It can be understood that different image drawing modification amplitudes correspond to different similarities, that is, the similarity changes with the change of the image drawing modification amplitude.

[0082] In the disclosed embodiment, by controlling the image drawing modification amplitude, the target image can have different similarities with the first image to be created, thereby meeting the needs of AI creative painting, being customizable, and realizing the adjustment of whether the target image raw effect is dominated by AI creation or the first image to be created.

[0083] The following is an explanation of a method for generating and displaying a target image in an embodiment of the present disclosure.

[0084] In the disclosed embodiment, an initial target image is generated, wherein the initial target image can be understood as a style image generated for the first time, and the initial target image is not directly displayed to the user, and the initial target image needs to be optimized and displayed. The optimization process includes at least one of the following: filtering out target content information, image region repair, redrawing based on the user's redrawing operation, and image enhancement.

[0085] Figure 3 is a schematic diagram of an optimization processing method according to an exemplary embodiment. Figure 3 As shown, the method includes the following.

[0086] In the disclosed embodiment, the initial target image needs to be screened for target content information, i.e., risk detection. The content information may be privacy, violence, pornography, and other related information. The screening of target content information is mainly controlled by the prompt words in the target image generation process. The mobile terminal will detect the text description content of the user-defined prompt words, and identify it through the image recognition of the current step. After ensuring that the generated target image is a regular image, it is displayed to the user. It is understandable that if the user is not satisfied with the generation effect, the user can return to regenerate the target image.

[0087] In the disclosed embodiment, the optimization processing of the initial target image also includes image area repair, and the mobile terminal repairs the local area of ​​the initial target image, wherein the local area repair includes edge repair and proportion repair. In edge repair, the edge position of the image can be repaired using but not limited to interpolation methods. It can also be redrawn by selecting the area, and the area repair depends on the generation capability of the basic model. In proportion repair, the proportion problem of the generated target image object is mainly repaired, and the parts that are too blurred and have too large size differences are regenerated by using a fuzziness detection algorithm and an object separation ratio detection algorithm.

[0088] In the disclosed embodiment, the optimization process of the initial target image also includes redrawing based on the user's redrawing operation. If the generated target image is not satisfactory, the user can return to the previous version for repair, or directly return to the target image generation stage.

[0089] In the disclosed embodiment, the optimization processing of the initial target image also includes image enhancement processing. The technology used to improve the image quality through the image quality enhancement algorithm, this technical solution uses a method based on mean filtering, sharpening filtering, and histogram equalization to smooth the image, remove noise and details, adjust the brightness and contrast of the image, enhance the edges and details of the initial target image, thereby improving the clarity of the initial target image.

[0090] In the disclosed embodiment, the target image displayed after the initial target image is optimized can effectively protect privacy through prompt words and filtered target content information, prevent the generated target image from being used for illegal purposes, and protect the copyright of AI creation. At the same time, a high-definition target image can be obtained after optimization, improving user satisfaction.

[0091] The following is an explanation of a method for obtaining an image drawing model in an embodiment of the present disclosure.

[0092] Figure 4 is a flowchart of a method for obtaining an image rendering model according to an exemplary embodiment. Figure 4 As shown, the method includes the following.

[0093] In step S31, a style image sample set selected by a user is obtained.

[0094] In the disclosed embodiment, it is detected that the user selects a custom image drawing style option, and the custom style data provided by the user is obtained as a style image sample set.

[0095] In step S32, the style image sample set is preprocessed to obtain a style image training set.

[0096] In the disclosed embodiment, the acquired style image sample set cannot be used directly for model training. The style image sample set needs to be preprocessed to obtain a style image training set. At this time, the style image training set can be used as training data to obtain an image rendering model.

[0097] In step S33, a label data set corresponding to the style image in the style image training set is determined, and the label data set includes an image drawing text description corresponding to the style image.

[0098] In the disclosed embodiment, for the style images in the style image training set obtained by preprocessing, the style image labels are generated through the open source model, the label data set corresponding to the style images in the style image training set is determined, and the label data set corresponding to the style image is determined as the image drawing text description. In order to improve the accuracy of the label data set, a label optimization step is involved, which filters the content by comparing the preset text library and removes the descriptive words of some scenes. For example, "blurred background, blur, excellent image quality", etc.

[0099] In step S34, an image rendering model is trained based on the label data set and the style image training set.

[0100] In the disclosed embodiment, based on the filtered label data set and the style image training set, the training data of the model is uploaded to the cloud for training to obtain an image rendering model.

[0101] In the disclosed embodiments, a corresponding image rendering model can be generated according to user needs, and the image rendering model can be generated based on a user-defined data training set, i.e., a style image training set. At the same time, the generation algorithm is continuously optimized according to user feedback and evaluation to meet user needs.

[0102] The following is an explanation of the method for obtaining a style image sample set selected by a user in the disclosed embodiment.

[0103] Figure 5 is a flowchart of a method for obtaining a style image sample set according to an exemplary embodiment. Figure 5 As shown, the method includes the following.

[0104] In step S41, a style image sample set selected by a user is obtained.

[0105] In step S42 , in response to detecting that the user triggers a selection operation of a style image sample set, an image selection path is provided.

[0106] In the disclosed embodiment, in response to training of the image rendering model, it is detected that the user triggers the selection operation of the style image sample set, and an image selection path is provided. Among them, the style image sample set recommends that the best images uploaded by the user are 3-50 by default, and sets the minimum bottom line to 3. And uploading less than 10 style images may lead to a decrease in the quality of the image style. When the uploaded style images are less than 10, a cutting operation will be performed to expand the data. The above data involved are only exemplary descriptions, and the specific data are not limited.

[0107] In step S43, the style image selected by the user based on the image selection path is obtained to obtain a style image sample set.

[0108] In the embodiment of the present disclosure, the style image selected by the user in the selection path is obtained as the style image sample set.

[0109] In the disclosed embodiment, the style image sample set obtained based on the user's selection satisfies the user's preference and style, so as to generate a target image that meets the user's needs.

[0110] The following is an explanation of the preprocessing of the style image sample set in the embodiment of the present disclosure.

[0111] In the disclosed embodiment, the style image sample set is preprocessed to obtain a style image training set, and the style image sample set is screened to obtain a style image sample set, wherein after the preprocessing, the image resolution is greater than a resolution threshold, the number of images meets a preset number, and the display attributes of the images meet the attribute conditions, and at least one of the above items is met to determine it as a style image sample set.

[0112] In the embodiment of the present disclosure, in the style image sample set, images with a resolution greater than a resolution threshold are retained, where the resolution threshold may be 576*768, and images with a resolution less than the resolution threshold are forcibly deleted, and the user is prompted with relevant instructions. In the style image sample set, if there is character data, character morphology filtering is performed on the character image to ensure normal character morphology.

[0113] Furthermore, in an embodiment of the present disclosure, images whose resolution is greater than a resolution threshold are renamed and sorted in descending order according to high resolution. Among them, the images are renamed according to resolution, and high and low resolutions can be distinguished by naming, and high-resolution images are given priority during the training process. At the same time, to prevent too many images, low-resolution images are preferentially filtered out, and high-resolution images are retained. The above operations can be completed by renaming the images. After completing the preliminary filtering of the images, inappropriate images are deleted. If the amount of data is less than the preset amount, the user will be prompted to continue uploading. In addition, the display attributes of the image must meet the attribute conditions, and the display attributes include at least one of the following: blurriness, brightness, and contrast. Image blurriness, brightness, and contrast detection are required to ensure the quality of the style image.

[0114] In the disclosed embodiment, the style image sample set uploaded by the user is screened for image quality, thereby ensuring the image quality of the style image sample set.

[0115] The following is an explanation of how to obtain a style image training set in the disclosed embodiment.

[0116] Figure 6 is a flowchart of a method for obtaining a style image training set according to an exemplary embodiment. Figure 6 As shown, the method includes the following.

[0117] In step S51 , edge cutting is performed on the style image samples in the filtered style image sample set to obtain a cut style image sample set.

[0118] In the disclosed embodiment, based on the filtered style image sample set, data enhancement is performed on the filtered style image sample set. The default prompt for the user to upload data is to meet the real needs of ordinary users, but the data volume does not meet the standard for image rendering model training, and a certain amount of expansion is required through data enhancement. For the style image samples in the filtered style image sample set, edge cutting is performed to cut the edges of the high-resolution style image, so that the interference existing on the edge of the picture or the picture border can be eliminated. For example, for an oil painting with a blank frame, the blank frame is cut off.

[0119] In step S52 , resolution compression is performed on the style image samples with a resolution higher than a resolution threshold in the segmented style image sample set to obtain style image samples with a preset resolution.

[0120] In the embodiment of the present disclosure, if there are images with a resolution lower than the resolution threshold in the style image sample set after cutting, they are filtered out. The resolution threshold is determined based on experimental values. For example, the resolution threshold can be 512*768. Resolution compression is performed on images that meet the requirements to a preset resolution to obtain style image samples with a preset resolution. The preset resolution is determined based on standard training data and can be a resolution of 512*768.

[0121] In step S53, the style image samples with the preset resolution are cropped according to different random cropping ratios to obtain a preset number of style image sample sets.

[0122] In the disclosed embodiment, style image samples with preset resolution are cut according to different random cropping ratios. In one example, the random cropping ratios are mainly divided into three parts: 144*192, 72*96, and 36*48. In this way, an image contains multiple images after random cropping. At the same time, in order to achieve the image enhancement effect, the image with a resolution that meets the preset resolution is randomly divided into 24 images according to the above three ratios. A preset number of style image sample sets are obtained after random cropping, wherein the preset number can be 24 in the example. The above data involved are only exemplary descriptions and are not limited to the specific data.

[0123] In step S54, a preset number of style image sample sets are determined as style image training sets.

[0124] In the disclosed embodiment, a certain amount of expansion is performed based on data enhancement, thereby improving resource utilization.

[0125] The following is an explanation of similarity analysis in the disclosed embodiment.

[0126] Figure 7 is a flow chart of a similarity analysis method according to an exemplary embodiment. Figure 7 As shown, the method includes the following.

[0127] In step S61 , the similarity of each style image sample in the style image sample set is determined.

[0128] In the disclosed embodiment, in order to enable the trained image rendering model to generate a more stable style and improve the quality of the target image generated by the image rendering model, the image data is further optimized to ensure that data with styles as similar as possible are retained, and images with very few different styles and images with style differences in some small images due to cutting are filtered out.

[0129] In step S62, the style image sample set with a similarity lower than a threshold is screened out to obtain a style image training set with a similarity greater than the similarity threshold.

[0130] In the disclosed embodiment, if there are two style images with similarities, the style image with a similarity greater than a similarity threshold is preferentially retained. If both are greater than the similarity threshold, the style image with more elements can be selected and retained.

[0131] In one example, similarity analysis can adopt but is not limited to a method based on feature extraction (Oriented FAST and Rotated BRIEF, ORB), which is a combination of a key point detection algorithm (Features from Accelerated Segment Test, FAST) and a descriptor algorithm (Binary Robust Independent Elementary Features, BRIEF), and uses Euclidean distance as a similarity judgment basis, retaining more than 90% of the data and deleting the last 10% of the data. The above analysis methods are only exemplary and are not limited to specific analysis methods.

[0132] In the disclosed embodiment, the style image training set obtained based on similarity analysis reduces the probability of target image distortion, avoids the problem of unreasonable image in the target image, and improves the naturalness of the target image.

[0133] The following is an explanation of the pre-trained image rendering model in the embodiments of the present disclosure.

[0134] Figure 8 is a schematic diagram of a data preprocessing method according to an exemplary embodiment. Figure 8 As shown, the method includes the following.

[0135] In the disclosed embodiment, before training the image rendering model, it is necessary to perform image quality filtering, morphology filtering, and image optimization on the acquired user-selected style image sample set to ensure that the image resolution of the image sample set is greater than the resolution threshold, the number of images meets the preset number, and the display attributes of the image meet the attribute conditions, where the display attributes include at least one of the following: blurriness, brightness, and contrast. The style image sample set that meets the above conditions is then subjected to image segmentation, resolution filtering and compression, image enhancement, and similarity analysis. The style image sample set determined after the above steps is used as the style image training set. The style image training set and the label data set corresponding to the style image training set are used as input together to train the image rendering model.

[0136] The data preprocessing involved in the disclosed embodiments is completed in the cloud, and the trained image drawing model is sent to the mobile terminal for drawing, avoiding the cost of pure cloud operation, saving computing resources and environmental resources, and improving resource utilization. At the same time, the model is trained based on user-defined data, and the generation algorithm can be continuously optimized based on user feedback and evaluation to meet the user's creative needs.

[0137] The following is an explanation of a method for obtaining an image drawing model in an embodiment of the present disclosure.

[0138] Fig. 9 is a flowchart of an image drawing model method according to an exemplary embodiment. Fig. 9 As shown, the method includes the following.

[0139] In step S71, the first pre-trained model is called, and the second pre-trained model is trained based on the label data set and the style image training set.

[0140] In the disclosed embodiment, the first pre-trained model can be understood as a basic model. In one example, the basic model can be an open source model, and the open source model is fine-tuned on a large scale through a style image training set, and the fine-tuned model is used as the basic model. The second pre-trained model is obtained by training based on the label data set and the style image training set. Among them, the second pre-trained model can be understood as a custom style model.

[0141] In step S72, based on the first pre-trained model and the second pre-trained model, each style image in the style image training set is repeatedly trained a preset number of times based on the label data set to obtain an image rendering model.

[0142] In one example, the settings of the preset training parameters can be the following values: the number of repetitions for each image in the style image training set subset is 32, the number of samples used for training in a single pass is set to 2, the rank of the training model is 64, the number of model training rounds is 16, and after the training is completed, the model with the smallest loss function (loss) after the last three rounds of training is compared as the final model.

[0143] In the embodiment of the present disclosure, in order to ensure that the model can be inferred on the mobile terminal without affecting the timeliness of the inference, the second pre-trained model and the first pre-trained model after training are quantized to integer (Int) 8 and floating point (Float) 16, and the quantized model is sent to the mobile terminal. The above data are only exemplary and are not limited to the specific data.

[0144] In one example, Fig.10 FIG. 1 is a schematic diagram of a model training method according to an exemplary embodiment. Fig.10 As shown, a first pre-trained model and a second pre-trained model are obtained based on an image drawing training set, and the first pre-trained model and the second pre-trained model are trained based on preset parameter settings to obtain an image drawing model. In the disclosed embodiment, parameter quantization can be used to reduce the amount of calculation, speed up the calculation, reduce the training time, and continuously train the model to improve the quality and diversity of the generated image based on the continuous training model, which has strong scalability.

[0145] Fig.11 is a schematic diagram of an image drawing method according to an exemplary embodiment. Fig.11 As shown, the method includes the following.

[0146] In the disclosed embodiment, the first image to be created input by the user is obtained, wherein the first image to be created can be a user's doodle or a local image upload. The image drawing style is selected. If the default preset style includes the image drawing style that the user likes, it can be directly selected. If it does not include it, the user can click the custom image drawing style option to train to obtain a custom image drawing style that the user is satisfied with. In the custom image drawing style, the user's style image sample set is uploaded to the cloud, and the image drawing model is trained in the cloud. The trained image drawing model is sent to the mobile terminal and optimized to obtain the target image. In the process of generating the target image on the mobile terminal, the user is allowed to provide a text description of the image drawing for guidance.

[0147] In the disclosed embodiment, based on the guidance of the image drawing style and the image drawing text description, cloud training is combined with local reasoning to avoid the cost of pure cloud-based permission and reduce resource power consumption and waste. At the same time, the generated target image can be applied to coloring book applications, photo editing applications, social applications, educational applications and other scenarios. And it can generate higher quality target images in a shorter time, save computing resources and environmental resources, make full use of the edge computing capabilities of the mobile terminal, and improve resource utilization. And it can generate target images of different styles, sizes, and colors according to user needs, which is customizable.

[0148] Based on the same concept, the embodiment of the present disclosure further provides an image drawing device 100 .

[0149] It is understandable that the image drawing device 100 provided in the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function in order to realize the above functions. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.

[0150] Fig.12 1 is a block diagram of an image drawing apparatus 100 according to an exemplary embodiment. Fig.12 The device includes an acquisition unit 101, a detection unit 102, a determination unit 103, a calling unit 104 and a generation unit 105.

[0151] The acquisition unit 101 is used to acquire a first image to be created.

[0152] The detection unit 102 is used to display image drawing options in response to detecting an operation of drawing a first image to be created, where the image drawing options include image drawing style options and image drawing text description options.

[0153] The determination unit 103 is configured to determine the target image drawing style based on the target image drawing style option selected by the user, and obtain the target image drawing text description input by the user based on the image drawing text description option.

[0154] The calling unit 104 is used to call the image drawing model based on the target image drawing style and the target image drawing text description, wherein different image drawing styles and / or image drawing text descriptions correspond to different image drawing models.

[0155] The generating unit 105 is used to generate and display a target image based on the image rendering model, where the target image meets the similarity condition with the first image to be created and matches the target image rendering style and the target image rendering text description.

[0156] In one implementation, the image drawing style options include a default image drawing style option and a custom image drawing style option; the determination unit 103 determines the target image drawing template based on the image drawing style option selected by the user in the following manner, including: in response to the user selecting the default image drawing style option, using the image drawing style corresponding to the default image drawing style option as the target image drawing style; or in response to the user selecting the custom image drawing style option, obtaining custom image drawing style data provided by the user, and training an image drawing model based on the custom image drawing style data, and using the image drawing style generated based on the image drawing model as the target image drawing style.

[0157] In one implementation, the acquisition unit 101 acquires the first image to be created in the following manner, including: acquiring the first image to be created drawn by a user on an electronic device; or acquiring the first image to be created selected by a user based on a preset storage path.

[0158] In one embodiment, the image drawing option also includes an image drawing modification amplitude option, and the image drawing modification amplitude option is used to determine the similarity between the target image to be drawn and the first image to be created in the following manner based on the determination unit 103; the similarity condition is determined based on the image drawing modification amplitude corresponding to the image drawing modification amplitude option, and different image drawing modification amplitudes correspond to different similarities.

[0159] In one embodiment, the generation unit 105 generates and displays the target image in the following manner, including: generating an initial target image; optimizing the initial target image and displaying the optimized target image; the optimization process includes at least one of the following: filtering out target content information; image area repairing; redrawing based on the user's redrawing operation; and image enhancement.

[0160] In one embodiment, the image drawing model is pre-trained in the following manner: obtaining a style image sample set selected by a user; preprocessing the style image sample set to obtain a style image training set; determining a label data set corresponding to the style image in the style image training set, the label data set including an image drawing text description corresponding to the style image; and training the image drawing model based on the label data set and the style image training set.

[0161] In one implementation, the acquisition unit 101 acquires the style image sample set selected by the user in the following manner, including: providing an image selection path in response to detecting that the user triggers an operation of selecting the style image sample set; acquiring the style image selected by the user based on the image selection path to obtain the style image sample set.

[0162] In one implementation, the determination unit 103 preprocesses the style image sample set in the following manner to obtain a style image training set, including: screening the style images in the style image sample set to obtain a screened style image sample set; obtaining a style image training set based on the screened style image sample set; the screened images satisfy at least one of the following: the image resolution is greater than a resolution threshold; the number of images satisfies a preset number; the display attributes of the images satisfy the attribute conditions, and the display attributes include at least one of the following: blur, brightness, and contrast.

[0163] In one implementation, the determination unit 103 obtains a style image training set based on the screened style image sample set in the following manner, including: performing edge cutting on the style image samples in the screened style image sample set to obtain a cut style image sample set; performing resolution compression on the style image samples in the cut style image sample set whose resolution is higher than a resolution threshold to obtain style image samples with a preset resolution; cropping the style image samples with a preset resolution according to different random cropping ratios to obtain a preset number of style image sample sets; and determining the preset number of style image sample sets as the style image training set.

[0164] In one implementation, the determination unit 103 is further configured to: determine the similarity of each style image sample in the style image sample set; and filter out the style image sample set with a similarity lower than a threshold to obtain a style image training set with a similarity greater than the similarity threshold.

[0165] In one embodiment, the calling unit 104 trains an image drawing model based on a label data set and a style image training set in the following manner, including: calling a first pre-trained model, and training a second pre-trained model based on the label data set and the style image training set; based on the first pre-trained model and the second pre-trained model, repeatedly training each style image in the style image training set based on the label data set for a preset number of times to obtain an image drawing model.

[0166] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0167] Fig.13 1 is a block diagram of a device 200 for image drawing according to an exemplary embodiment. The device 200 may be provided as a terminal. For example, the device 200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0168] Reference Fig.13, the device 200 may include one or more of the following components: a processing component 202 , a memory 204 , a power component 206 , a multimedia component 208 , an audio component 210 , an input / output (I / O) interface 212 , a sensor component 214 , and a communication component 216 .

[0169] The processing component 202 generally controls the overall operation of the device 200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 202 may include one or more modules to facilitate interaction between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate interaction between the multimedia component 208 and the processing component 202.

[0170] The memory 204 is configured to store various types of data to support operations on the device 200. Examples of such data include instructions for any application or method operating on the device 200, contact data, phone book data, messages, pictures, videos, etc. The memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0171] The power component 206 provides power to the various components of the device 200. The power component 206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 200.

[0172] The multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0173] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC), and when the device 200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 204 or sent via the communication component 216. In some embodiments, the audio component 210 also includes a speaker for outputting audio signals.

[0174] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0175] The sensor assembly 214 includes one or more sensors for providing various aspects of the status assessment of the device 200. For example, the sensor assembly 214 can detect the open / closed state of the device 200, the relative positioning of components, such as the display and keypad of the device 200, the sensor assembly 214 can also detect the position change of the device 200 or a component of the device 200, the presence or absence of user contact with the device 200, the orientation or acceleration / deceleration of the device 200 and the temperature change of the device 200. The sensor assembly 214 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 214 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 214 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.

[0176] The communication component 216 is configured to facilitate wired or wireless communication between the device 200 and other devices. The device 200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0177] In an exemplary embodiment, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0178] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 204 including instructions, and the instructions can be executed by the processor 220 of the device 200 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

Claims

1. An image drawing method, characterized in that: include: Obtaining a first image to be created; In response to detecting an operation of performing a drawing process on the first image to be created, displaying image drawing options, the image drawing options including an image drawing style option and an image drawing text description option; Determine the target image drawing style based on the target image drawing style option selected by the user, and obtain the target image drawing text description input by the user based on the image drawing text description option; Based on the target image drawing style and the target image drawing text description, calling an image drawing model, wherein different image drawing styles and / or image drawing text descriptions correspond to different image drawing models; Based on the image rendering model, a target image is generated and displayed, wherein the target image meets a similarity condition with the first image to be created and matches the target image rendering style and the target image rendering text description.

2. The method according to claim 1, characterized in that The image drawing style options include a default image drawing style option and a custom image drawing style option; The step of determining a target image drawing template based on the image drawing style option selected by the user includes: In response to the user selecting a default image drawing style option, using the image drawing style corresponding to the default image drawing style option as the target image drawing style; or In response to the user selecting the custom image drawing style option, the custom image drawing style data provided by the user is obtained, and based on the custom image drawing style data, an image drawing model is trained to obtain the image drawing style, and the image drawing style generated based on the image drawing model is used as the target image drawing style.

3. The method according to claim 1 or 2, characterized in that: The step of obtaining a first image to be created includes: Acquire a first image to be created drawn by a user on an electronic device; or A first image to be created selected by a user based on a preset storage path is obtained.

4. The method according to claim 1, characterized in that The image drawing options further include an image drawing modification amplitude option, and the image drawing modification amplitude option is used to determine the similarity between the drawn target image and the first image to be created; The similarity condition is determined based on the image drawing modification amplitude corresponding to the image drawing modification amplitude option, and different image drawing modification amplitudes correspond to different similarities.

5. The method according to claim 1, characterized in that The generating and displaying of the target image comprises: Generate an initial target image; Optimizing the initial target image and displaying the optimized target image; The optimization process includes at least one of the following: Filter out target content information; Image region restoration; Perform redrawing based on the user's redrawing operation; Image enhancement processing.

6. The method according to claim 1, characterized in that The image rendering model is pre-trained in the following manner: Get the style image sample set selected by the user; Preprocessing the style image sample set to obtain a style image training set; Determine a label data set corresponding to a style image in the style image training set, wherein the label data set includes an image drawing text description corresponding to the style image; Based on the label data set and the style image training set, an image rendering model is trained.

7. The method according to claim 6, characterized in that The step of obtaining a style image sample set selected by a user includes: In response to detecting that a user triggers a selection operation of a style image sample set, providing an image selection path; A style image selected by a user based on the image selection path is obtained to obtain a style image sample set.

8. The method according to claim 6 or 7, characterized in that: The preprocessing of the style image sample set to obtain a style image training set includes: Screening the style images in the style image sample set to obtain a screened style image sample set; Based on the filtered style image sample set, a style image training set is obtained; The filtered image meets at least one of the following conditions: The image resolution is greater than the resolution threshold; The number of images meets the preset number; The display attribute of the image satisfies the attribute condition, and the display attribute includes at least one of the following: blurriness, brightness, and contrast.

9. The method according to claim 8, characterized in that The step of obtaining a style image training set based on the filtered style image sample set includes: Performing edge cutting on the style image samples in the filtered style image sample set to obtain a cut style image sample set; Performing resolution compression on style image samples whose resolutions in the cut style image sample set are higher than a resolution threshold to obtain style image samples with a preset resolution; Cropping the style image samples with the preset resolution according to different random cropping ratios to obtain a preset number of style image sample sets; The preset number of style image sample sets are determined as style image training sets.

10. The method according to claim 6 or 8, characterized in that: The method further comprises: Determine the similarity of each style image sample in the style image sample set; The style image sample set with similarity lower than the threshold is screened out to obtain the style image training set with similarity greater than the similarity threshold.

11. The method according to claim 6, characterized in that The step of training an image rendering model based on the label data set and the style image training set includes: Calling the first pre-trained model, and training the second pre-trained model based on the label data set and the style image training set; Based on the first pre-trained model and the second pre-trained model, each style image in the style image training set is repeatedly trained a preset number of times based on the label data set to obtain an image rendering model.

12. An image drawing device, characterized in that: include: An acquisition unit, used for acquiring a first image to be created; a detection unit, configured to display image drawing options in response to detecting an operation of drawing the first image to be created, wherein the image drawing options include an image drawing style option and an image drawing text description option; a determination unit, configured to determine a target image drawing style based on a target image drawing style option selected by a user, and obtain a target image drawing text description input by the user based on the image drawing text description option; A calling unit, configured to call an image drawing model based on the target image drawing style and the target image drawing text description, wherein different image drawing styles and / or image drawing text descriptions correspond to different image drawing models; A generating unit is used to generate and display a target image based on the image rendering model, wherein the target image meets a similarity condition with the first image to be created and matches the target image rendering style and the target image rendering text description.

13. The device according to claim 12, characterized in that The image drawing style options include a default image drawing style option and a custom image drawing style option; The determining unit determines the target image drawing template based on the image drawing style option selected by the user in the following manner, including: In response to the user selecting a default image drawing style option, using the image drawing style corresponding to the default image drawing style option as the target image drawing style; or In response to the user selecting the custom image drawing style option, the custom image drawing style data provided by the user is obtained, and based on the custom image drawing style data, an image drawing model is trained to obtain the image drawing style, and the image drawing style generated based on the image drawing model is used as the target image drawing style.

14. The device according to claim 12 or 13, characterized in that The acquisition unit acquires the first image to be created in the following manner, including: Acquire a first image to be created drawn by a user on an electronic device; or A first image to be created selected by a user based on a preset storage path is obtained.

15. The device according to claim 12, characterized in that The image drawing options further include an image drawing modification range option, and the image drawing modification range option is used to determine the similarity between the drawn target image and the first image to be created based on the following method adopted by the determination unit; The similarity condition is determined based on the image drawing modification amplitude corresponding to the image drawing modification amplitude option, and different image drawing modification amplitudes correspond to different similarities.

16. The device according to claim 12, characterized in that The generating unit generates and displays the target image in the following manner, including: Generate an initial target image; Optimizing the initial target image and displaying the optimized target image; The optimization process includes at least one of the following: Filter out target content information; Image region restoration; Perform redrawing based on the user's redrawing operation; Image enhancement processing.

17. The device according to claim 12, characterized in that The image rendering model is pre-trained in the following manner: Get the style image sample set selected by the user; Preprocessing the style image sample set to obtain a style image training set; Determine a label data set corresponding to a style image in the style image training set, wherein the label data set includes an image drawing text description corresponding to the style image; Based on the label data set and the style image training set, an image rendering model is trained.

18. The device according to claim 17, characterized in that The acquiring unit acquires the style image sample set selected by the user in the following manner, including: In response to detecting that a user triggers a selection operation of a style image sample set, providing an image selection path; A style image selected by a user based on the image selection path is obtained to obtain a style image sample set.

19. The device according to claim 17 or 18, characterized in that The determining unit preprocesses the style image sample set in the following manner to obtain a style image training set, including: Screening the style images in the style image sample set to obtain a screened style image sample set; Based on the filtered style image sample set, a style image training set is obtained; The filtered image meets at least one of the following conditions: The image resolution is greater than the resolution threshold; The number of images meets the preset number; The display attribute of the image satisfies the attribute condition, and the display attribute includes at least one of the following: blurriness, brightness, and contrast.

20. The device according to claim 19, characterized in that The determining unit obtains a style image training set based on the filtered style image sample set in the following manner, including: Performing edge cutting on the style image samples in the filtered style image sample set to obtain a cut style image sample set; Performing resolution compression on style image samples whose resolutions in the cut style image sample set are higher than a resolution threshold to obtain style image samples with a preset resolution; Cropping the style image samples with the preset resolution according to different random cropping ratios to obtain a preset number of style image sample sets; The preset number of style image sample sets are determined as style image training sets.

21. The device according to claim 17 or 19, characterized in that The determining unit is further configured to: Determine the similarity of each style image sample in the style image sample set; The style image sample set with similarity lower than the threshold is screened out to obtain the style image training set with similarity greater than the similarity threshold.

22. The device according to claim 17, characterized in that The calling unit trains an image rendering model based on the label data set and the style image training set in the following manner, including: Calling the first pre-trained model, and training the second pre-trained model based on the label data set and the style image training set; Based on the first pre-trained model and the second pre-trained model, each style image in the style image training set is repeatedly trained a preset number of times based on the label data set to obtain an image rendering model.

23. An image drawing device, characterized in that: include: processor: a memory for storing processor-executable instructions; Wherein, the processor is configured to: execute the image drawing method according to any one of claims 1 to 11.

24. A storage medium, characterized in that The storage medium stores instructions, and when the instructions in the storage medium are executed by a processor, the processor is enabled to execute the image drawing method according to any one of claims 1 to 11.