Image redrawing method and device, equipment and storage medium
By detecting and redrawing the text area in the image containing text, the problem of image quality degradation when text repainting in the prior art is solved, and a higher quality overall image redrawing effect is achieved.
Patent Information
- Application Number
- CN202411742778.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
AI Technical Summary
The prior art is prone to defects when redrawing an image containing text, which affects the image quality.
By obtaining the input image, detecting its text area, and using the text redrawing model to redraw the text area according to the prompt word, generating a text redrawing image, and finally repainting the overall image through the image redrawing model to eliminate the influence of text on image redrawing.
Effectively remove text defects in the image, improve the image content, improve the quality of the overall redrawn image, and avoid defects in the image generated.
Smart Images

Figure CN119672179A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an image redrawing method, device, equipment and storage medium. Background Art
[0002] In the digital age, image redrawing technology is constantly being explored and innovated, and the use of image redrawing models to redraw images has been widely used.
[0003] In the related art, an image redrawing model is used to redraw the original image as a whole according to the text prompt words, so that an output image corresponding to the text prompt words can be generated, and the output image has the image quality and image effect desired by the user.
[0004] However, if the above method is used to redraw an image containing text, defects will be generated in the generated image, affecting the image quality. Summary of the invention
[0005] The embodiment of the present application provides an image redrawing method, device, equipment and storage medium. The technical solution provided by the embodiment of the present application is as follows:
[0006] According to one aspect of an embodiment of the present application, a method for redrawing an image is provided, the method comprising:
[0007] Get the input image;
[0008] In the case where the input image contains text, obtaining a prompt word corresponding to the input image according to the input image, wherein the prompt word corresponding to the input image is used to indicate the image content of the input image;
[0009] Performing text detection on the input image to obtain a text area of the input image;
[0010] Generate a text redrawing image of the input image according to the input image, the text area of the input image and the prompt word corresponding to the input image by a text redrawing model, wherein the text redrawing image is an image obtained by redrawing the text area of the input image;
[0011] The image is redrawn according to the text using the image redrawing model to obtain an overall redrawn image corresponding to the input image.
[0012] According to one aspect of an embodiment of the present application, there is provided an image redrawing device, the device comprising:
[0013] An image acquisition module, used for acquiring an input image;
[0014] a prompt word determination module, configured to obtain a prompt word corresponding to the input image according to the input image when the input image contains text, wherein the prompt word corresponding to the input image is used to indicate the image content of the input image;
[0015] A text detection module, used to perform text detection on the input image to obtain a text area of the input image;
[0016] a text redrawing module, configured to generate a text redrawing image of the input image according to the input image, the text area of the input image and the prompt word corresponding to the input image through a text redrawing model, wherein the text redrawing image is an image obtained by redrawing the text area of the input image;
[0017] The overall redrawing module is used to redraw the image according to the text using the image redrawing model to obtain an overall redrawn image corresponding to the input image.
[0018] According to one aspect of an embodiment of the present application, a computer device is provided, the computer device comprising a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-mentioned image redrawing method.
[0019] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned image redrawing method.
[0020] According to one aspect of an embodiment of the present application, a computer program product is provided. The computer program product includes a computer program. The computer program is loaded and executed by a processor to implement the above-mentioned image redrawing method.
[0021] The technical solution provided in the embodiments of the present application can bring the following beneficial effects:
[0022] For an input image containing text, the prompt word corresponding to the input image and the text area of the input image are determined, so that the text area of the input image can be redrawn according to the prompt word corresponding to the input image through the text redrawing model, and the text in the input image is removed while the image content of the input image is improved, so that the text-redrawn image is used to represent the original image meaning of the input image, and then the text-redrawn image is input into the image redrawing model for overall image redrawing, which can eliminate the influence of the text in the input image on the image redrawing, avoid defects in the generated overall redrawn image, and improve the image quality of the overall redrawn image. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;
[0024] Figure 2 is a flowchart of an image redrawing method provided by an embodiment of the present application;
[0025] Figure 3 is a schematic diagram of a complete process of image redrawing provided by an embodiment of the present application;
[0026] Figure 4 is a block diagram of an image redrawing device provided by an embodiment of the present application;
[0027] Figure 5 It is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0029] Please refer to Figure 1 , which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application. The solution implementation environment can be implemented as an image redrawing system. The solution implementation environment may include: a terminal device 10 and a server 20.
[0030] The number of terminal devices 10 can be one or more. The terminal device 10 can be an electronic device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a game console, an e-book reader, a multimedia player, a wearable device, an intelligent voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, etc.
[0031] The terminal device 10 may be installed with a client of a target application, and the target application has an image redrawing function. When a user inputs an image in the target application, the target application will output a redrawn image of the input image as a whole. The present application does not limit the type of the target application, including but not limited to question-and-answer applications, music applications, video applications, game applications, web applications, etc. Optionally, the target application may be an application that needs to be downloaded and installed, or may be a click-to-use application, and the present application does not limit this.
[0032] The server 20 is used to provide background services for the client of the target application installed and running in the terminal device 10. For example, the server 20 can be the background server of the above-mentioned target application. The server 20 can be an independent physical server, or a server cluster composed of multiple servers, or a cloud computing service center. Optionally, the server 20 provides background services for the target applications in multiple terminal devices 10 at the same time. The terminal device 10 and the server 20 can communicate with each other through the network.
[0033] In an embodiment of the present application, a user inputs an image in a target application, and a terminal device sends the image input by the user to a server. After receiving the input image, the server detects whether the input image contains text. If the input image contains text, the prompt word corresponding to the input image is determined, and the image content of the input image is indicated by the prompt word. The input image is subjected to text detection to obtain the text area of the input image, and then the text area of the input image is redrawn by a text redrawing model according to the input image, the text area of the input image, and the prompt word corresponding to the input image, to generate a text redrawn image of the input image. Finally, the image redrawing model is used to redraw the image according to the text to obtain an overall redrawn image corresponding to the input image. If the input image does not contain text, the image redrawing model is used to directly obtain an overall redrawn image corresponding to the input image according to the input image. If the overall redrawn image passes the deformity detection, the server returns the overall redrawn image to the terminal device and displays the overall redrawn image in the display interface of the target application.
[0034] Please refer to Figure 2 , which shows a flow chart of an image redrawing method provided by an embodiment of the present application. The execution subject of each step of the method may be a server. The method may include at least one of the following steps 210 to 250:
[0035] Step 210, obtaining an input image.
[0036] The input image may be an image of any content. Optionally, the input image may be an image containing a person, wherein the person contained in the input image may be an actual person, including but not limited to ordinary people, actors, singers, athletes, entrepreneurs, and characters in film and television dramas. The person contained in the input image may also be a virtual person, including but not limited to game characters, cartoon characters, and other self-created characters. Optionally, the input image may also be an image containing other objects, for example, the input image may be a landscape image, a street view image, a still life image, and the like. This application does not limit this.
[0037] Optionally, the input image may contain text, for example, the input image may be a magazine cover image, an artist photo image, a brand poster image, etc. Optionally, the input image may not contain text, for example, the input image may be an unprocessed image.
[0038] Step 220 , when the input image contains text, obtain a prompt word corresponding to the input image according to the input image, where the prompt word corresponding to the input image is used to indicate the image content of the input image.
[0039] When the input image does not contain any text, the process directly jumps to step 250. When the input image contains any text, the process executes steps 220 to 240.
[0040] The present application does not limit the text type of the text contained in the input image, which may be Chinese text or text in other languages, such as English text, Japanese text, French text, etc. The present application also does not limit the related information such as the text font, text color, and text size contained in the input image.
[0041] The prompt word corresponding to the input image is a word extracted according to the image content of the input image, and is used to summarize the image meaning of the input image. The prompt word of the input image is a word that does not contain illegal content.
[0042] In some embodiments, step 220 includes at least one of sub-steps 221 - 225 .
[0043] Sub-step 221 , extracting features of the input image and at least one candidate prompt word respectively through a multimodal learning model, and obtaining image features of the input image and text features corresponding to the at least one candidate prompt word respectively.
[0044] The multimodal learning model is used to extract features of the input image to obtain image features of the input image, and to extract features of at least one candidate prompt word to obtain text features corresponding to at least one candidate prompt word. The candidate prompt word is a word in the candidate word library, and the input image is matched with at least one candidate prompt word in the candidate word library to obtain the candidate prompt word with the highest matching degree, thereby obtaining the prompt word corresponding to the input image.
[0045] The multimodal learning model here can be any publicly available multimodal large model, such as a model based on a deep learning structure obtained by training with a large amount of data. The large amount of data can reach a sample level of more than 100 million, and this application does not limit this.
[0046] Sub-step 222, calculating the similarity between the image feature of the input image and the text feature corresponding to at least one candidate prompt word, and obtaining the similarity corresponding to at least one candidate prompt word.
[0047] Exemplarily, a calculation method such as cosine similarity and Euclidean distance may be used to calculate the similarity between the image feature of the input image and the text feature corresponding to at least one candidate prompt word, so as to obtain the similarity corresponding to at least one candidate prompt word.
[0048] Sub-step 223: Determine the candidate prompt word corresponding to the maximum similarity among the similarities corresponding to at least one candidate prompt word as the target prompt word.
[0049] The candidate prompt word corresponding to the maximum similarity value is the candidate prompt word with the highest matching degree with the input image, and the target prompt word is obtained. The target prompt word is used to indicate the image content of the input image.
[0050] Sub-step 224 , when the target prompt word does not contain any illegal content, the target prompt word is determined as the prompt word corresponding to the input image.
[0051] Illegal content includes but is not limited to pornographic content, vulgar content, bloody content, violent content, horror content, content with bad values, etc.
[0052] In some embodiments, the violation rate of the target prompt word is obtained according to the target prompt word through the violation detection model, and the violation rate is used to indicate the content of the illegal content in the target prompt word. The violation detection model is a pre-trained machine learning model, and the vocabulary is input into the violation detection model, and the violation rate of the vocabulary is output. When the violation rate of the target prompt word is less than the first threshold, it is determined that the target prompt word does not contain illegal content, and the target prompt word is determined as the prompt word corresponding to the input image, and sub-step 225 is no longer executed. When the violation rate of the target prompt word is greater than or equal to the first threshold, it is determined that the target prompt word contains illegal content, and sub-step 225 is executed.
[0053] The numerical range of the violation rate is 0 to 1. The higher the violation rate, the higher the content of the illegal content in the target prompt word, and the lower the violation rate, the lower the content of the illegal content in the target prompt word. The specific value of the first threshold value is set by the technical personnel according to the needs of violation detection, and this application does not limit it. Exemplarily, the first threshold value can be 0.2. In the case where the violation rate of the target prompt word is less than 0.2, it is determined that the target prompt word does not contain illegal content. In the case where the violation rate of the target prompt word is greater than or equal to 0.2, it is determined that the target prompt word contains illegal content.
[0054] When the first threshold is greater than 0, the target prompt word does not contain illegal content, which means that the target prompt word has a low content of illegal content and can be identified as not containing illegal content, but does not mean that the target prompt word does not contain any illegal content at all. When the illegal rate of the target prompt word is equal to 0, the target prompt word does not contain any illegal content at all.
[0055] By inferring the input image, calculating the similarity between the input image and at least one candidate prompt word, and obtaining the prompt word of the input image according to the similarity, the obtained prompt word can fully represent the image content of the input image, so that the text area can be redrawn according to the prompt word, thereby improving the redrawing quality of the text area.
[0056] Sub-step 225 , when the target prompt word contains illegal content, the prompt word corresponding to the input image is obtained from a preset vocabulary library according to the image content of the input image.
[0057] The target prompt word contains illegal content means that the content of illegal content in the target prompt word exceeds the allowed threshold range, and it needs to be identified as containing illegal content. In the case where the target prompt word contains illegal content, the target prompt word cannot be used in the subsequent image redrawing process, and the prompt word corresponding to the input image can be obtained from the preset vocabulary library according to the image content of the input image.
[0058] The image content of the input image includes image content such as people, animals, scenery, and still life. People can be divided into types according to the age, gender, clothing, action and other elements of the people. For example, people can be divided into different types of people such as little girls, little boys, young women, young men, middle-aged women, middle-aged men, old women, and old men. Animals can be divided into different types according to the species, age, skin color and other elements of the animals. For example, animals can be divided into different types of animals such as young monkeys, adult monkeys, red goldfish, and white goldfish. Scenery can be divided into different types according to the location and weather of the scene. For example, scenery can be divided into different types of scenery such as the beach in the daytime and the desert in the evening. Still life can be divided into different types of still life according to the type, location, size and other elements of the object. For example, still life can be divided into different types of still life such as buildings, vehicles, tables and chairs.
[0059] The preset vocabulary library pre-stores vocabulary corresponding to different types of image content, and the application does not limit the classification of image content types. For example, for a half-length photo of a young girl, when the image content includes people, if the type of image content is only divided according to the gender of the people, the images containing people are divided into images containing men and images containing women, then the prompt word corresponding to the input image is "a girl", and if the type of image content is divided according to the age and gender of the people, then the prompt word corresponding to the input image is "a young girl". For example, the image content can also be divided into person images, animal images, scene images, still life images, etc. The prompt word corresponding to the person image is "person", the prompt word corresponding to the animal image is "animal", the prompt word corresponding to the scene image is "scenery", and the prompt word corresponding to the still life image is "still life".
[0060] Exemplarily, a large multimodal model may be fine-tuned and trained, an input image may be input into the trained large multimodal model, and prompt words corresponding to the input image may be output based on a preset vocabulary library.
[0061] By obtaining the corresponding prompt word from the preset vocabulary library when the target prompt word contains illegal content, the target prompt word is prevented from being filtered out due to not meeting the conditions, and no prompt word participates in the subsequent image redrawing process, thereby ensuring the reasonable operation of image redrawing.
[0062] Step 230: Perform text detection on the input image to obtain the text area of the input image.
[0063] The text detection model is used to perform text detection on the input image, detect the text area in the input image, and obtain the text area of the input image. The text detection model is a pre-trained deep learning model. The text area of the input image refers to the image area where the text contained in the input image is located in the input image.
[0064] Step 240, generating a text redrawing image of the input image according to the input image, the text region of the input image and the prompt word corresponding to the input image through the text redrawing model, wherein the text redrawing image is an image obtained by redrawing the text region of the input image.
[0065] The text redrawing model is a model obtained by fine-tuning the image redrawing model, and is used to redraw the text area of the input image.
[0066] In some embodiments, a text area in an input image is filled with a first color to obtain a filled input image; and a text redrawing image is generated according to the filled input image and a prompt word corresponding to the input image by a text redrawing model.
[0067] After obtaining the text area of the input image, the text area and the background area in the input image are segmented to obtain the background area of the input image, and the background area of the input image includes the text area in a vacant state. Filling the text area in the input image with a first color can also be interpreted as filling the text area in the background area of the input image with a first color to obtain a filled input image. The filled input image includes the background area of the input image and the text area in the first color.
[0068] The present application does not limit the setting of the first color, which may be any color. For example, the first color may be white.
[0069] The filled input image and the prompt word corresponding to the input image are input into the text redrawing model, and a text redrawing image is output. The text redrawing image is an image obtained by redrawing the text area of the filled input image in the first color based on the prompt word corresponding to the input image, which means that only the text area is redrawn in the text redrawing image, and the background area is not redrawn, and the background area in the text redrawing image is the same as the background area in the input image.
[0070] By filling the text area in the input image with the first color, the text redrawing model can easily find the area to be redrawn from the filled input image, thereby ensuring the effective redrawing of the text and improving the efficiency of the text redrawing.
[0071] Step 250 , redrawing the image according to the text using an image redrawing model to obtain an overall redrawn image corresponding to the input image.
[0072] The image redrawing model here can be any publicly available image redrawing model, such as a model based on a deep learning structure trained with a large amount of data. The large amount of data can reach a sample level of more than 100 million, and this application does not limit this.
[0073] The text redrawn image is input into the image redrawing model, and the overall redrawn image corresponding to the input image is output. The image redrawing model is used to redraw the entire image area of the input image, so the overall redrawn image obtained is an image obtained by redrawing the entire image content of the text redrawn image.
[0074] In some embodiments, when the input image does not contain text, an overall redrawn image corresponding to the input image is obtained based on the input image through an image redrawing model.
[0075] The technical solution provided by the embodiment of the present application determines, for an input image containing text, a prompt word corresponding to the input image and a text area of the input image, so that the text area of the input image can be redrawn according to the prompt word corresponding to the input image through a text redrawing model, and the text in the input image is removed while the image content of the input image is improved, so that the text-redrawn image is used to represent the original image meaning of the input image, and the text-redrawn image is input into the image redrawing model for overall image redrawing, which can eliminate the influence of the text in the input image on the image redrawing, avoid defects in the generated overall redrawn image, and improve the image quality of the overall redrawn image.
[0076] In some embodiments, when the input image contains a person, step 250 includes at least one of sub-steps 251 to 253. When the input image does not contain a person, sub-steps 251 to 253 do not need to be performed.
[0077] Sub-step 251 , segmenting the character and the background in the text-redrawn image, filling the background area in the text-redrawn image with a first color, and obtaining a character image corresponding to the character in the text-redrawn image.
[0078] The character and background in the text-redrawn image are segmented by an image segmentation model to obtain a character segmentation image corresponding to the character in the text-redrawn image, wherein the background region in the character segmentation image is vacant. The vacant background region in the character segmentation image is filled with a first color to obtain a character image. The character image includes the character region in the text-redrawn image and the background region in the first color.
[0079] Optionally, the background area in the text redrawn image may be filled with a second color to obtain a character image corresponding to the character in the text redrawn image. The second color is different from the first color, which is not limited in this application. For example, if the first color is white, the second color is a color other than white. The corresponding character image includes the character area in the text redrawn image and the background area in the second color.
[0080] The image segmentation model here can be any publicly available image segmentation model, such as a model based on a deep learning structure trained with a large amount of data. The large amount of data can reach a sample level of more than 100 million, and this application does not limit this.
[0081] In sub-step 252, a prompt word corresponding to the character image is obtained based on the character image by using a large language model. The prompt word corresponding to the character image is used to indicate the character style in the character image.
[0082] The large language model here can be any publicly available large language model, such as a natural language model based on a transformer structure trained with a large amount of data. The large amount of data can reach a sample level of more than 100 million, and this application does not limit this.
[0083] Exemplarily, the prompt word corresponding to the character image is obtained by the large language model according to the character image and the prompt information. The prompt information is used to prompt the large language model to extract words used to indicate the character style in the character image. Exemplarily, the prompt information may be "Please extract words based on the character image, and the extracted words focus on describing the character style in the character image."
[0084] In some embodiments, the features of the character image and at least one candidate style vocabulary are extracted respectively through a multimodal learning model to obtain the image features of the character image and the text features corresponding to the at least one candidate style vocabulary. The similarity between the image features of the character image and the text features corresponding to the at least one candidate style vocabulary is calculated to obtain the similarity corresponding to the at least one candidate style vocabulary. Among the similarities corresponding to the at least one candidate style vocabulary, the candidate style vocabulary corresponding to the maximum value of the similarities is determined as the prompt word corresponding to the character image.
[0085] The candidate style vocabulary is a vocabulary in the candidate style vocabulary library. Each vocabulary in the candidate style vocabulary library is used to indicate different character styles. The character image is matched with at least one candidate style vocabulary in the candidate style vocabulary library to obtain the candidate style vocabulary with the highest matching degree, which is the prompt word corresponding to the character image.
[0086] Sub-step 253, obtaining an overall redrawn image corresponding to the input image through an image redrawing model according to the character image and the prompt word corresponding to the character image, wherein the overall redrawn image is an image obtained by overall redrawing the character area and the background area in the character image.
[0087] The character image and the prompt words corresponding to the character image are input into the image redrawing model, and the overall redrawn image is output, which is an image obtained by redrawing the entire image content of the character image, specifically, an image obtained by overall redrawing the character area and the background area in the character image. The overall redrawing of the overall redrawn image includes redrawing the character area in the character image and generating the background area in the character image.
[0088] By obtaining the prompt words corresponding to the character image when the text redrawn image includes a character, the overall redrawn image is a redrawn image based on the character style in the character image. The regenerated image background can conform to the character style, maintaining the style unity and coordination of the image content in the overall redrawn image, thereby improving the image quality of the overall redrawn image.
[0089] In some embodiments, sub-step 253 includes at least one of sub-steps 2531 - 2533 .
[0090] Sub-step 2531, obtaining the image type of the person image according to the person image through a category detection model, and the image type of the person image is a realistic image type or a virtual image type.
[0091] The category detection model is a pre-trained binary classification model. The category detection model uses the differences in image features (such as texture, color distribution, edge characteristics, etc.) to distinguish between realistic image styles and virtual image styles.
[0092] Image types include realistic image types and virtual image types. Realistic image types refer to images based on actual human images, while virtual image types refer to images based on non-existent human images. The human images in realistic images actually exist, including but not limited to images of ordinary people, actors, singers, athletes, entrepreneurs, and characters in film and television dramas. The human images in virtual images do not actually exist, including but not limited to self-created characters such as game characters and animation characters. Generally speaking, realistic images have more complex colors and textures, richer details, and more natural edges and shapes, while virtual images have smooth color blocks, fewer texture details, and obvious contour lines.
[0093] For the training process of the category detection model, it is necessary to first collect multiple sample images with category labels, including sample realistic images and sample virtual images, and then filter the sample images whose category labels do not conform to the corresponding image types in the multiple sample images to ensure that the category labels of each filtered sample image are accurate. Image enhancement is performed on each filtered sample image, including rotation, cropping, flipping and other operations, adjusting the image size, normalizing each sample image, increasing data diversity, and improving model robustness. After the image preprocessing is completed, a set of sample images with category labels is obtained. The binary classification model includes a convolutional neural network (CNN) and a fully connected layer. The features of the sample image are extracted by the convolutional neural network to obtain the image features of the sample image. Then, the sample image is subjected to category detection by the fully connected layer to obtain the predicted category result of the sample image. When the predicted category result of the sample image is the first result, the image type of the sample image is predicted to be a realistic image type. When the predicted category result of the sample image is the second result, the image type of the sample image is predicted to be a virtual image type. According to the difference between the predicted category results and the actual category labels of the sample images, a binary classification model is trained to obtain a category detection model.
[0094] This application does not limit the setting of the first result and the second result. For example, the first result is 1 and the second result is 0. When the predicted category result of the sample image is 1, the image type of the sample image is predicted to be a realistic image type. When the predicted category result of the sample image is 0, the image type of the sample image is predicted to be a virtual image type.
[0095] The fully connected layer in the binary classification model can also be replaced by a support vector machine (SVM), and the sample image is classified by the support vector machine to obtain the predicted category result of the sample image.
[0096] Exemplarily, according to the difference between the predicted category result and the actual category label of the sample image, the cross entropy loss function is calculated, and the Adam or SGD (Stochastic Gradient Descent) optimizer is used to adjust the weights to minimize the loss function value. Optionally, the classification effect of the category detection model can be evaluated by evaluation indicators such as accuracy, precision, recall, F1 score, etc. to improve the classification effect of the category detection model.
[0097] The person image is input into the category detection model, and the category result of the person image is output. The category result of the person image is used to indicate the image type of the person image. If the category result of the person image is the first result, the image type of the person image is a realistic image type. If the category result of the person image is the second result, the image type of the person image is a virtual image type.
[0098] In sub-step 2532, when the image type of the character image is a realistic image type, the overall redrawn image is obtained according to the character image and the prompt words corresponding to the character image through the realistic image redrawing model. The realistic image redrawing model is a model obtained by pre-training the image redrawing model based on training samples of the realistic image type.
[0099] In some embodiments, the character image and the prompt words corresponding to the character image are input into the realistic image redrawing model, and the overall redrawn image is directly output.
[0100] The training samples of the realistic image type include sample realistic images, prompt words corresponding to the sample realistic images, and sample redrawn images of the sample realistic images. For the training process of the realistic image redrawing model, at least one training sample of the realistic image type is obtained, and a predicted redrawn image is obtained through the image redrawing model according to the sample realistic image and the prompt words corresponding to the sample realistic image. With the training goal of reducing the difference between the predicted redrawn image and the sample redrawn image, the parameters of the image redrawing model are adjusted to obtain a realistic image redrawing model.
[0101] In some embodiments, a realistic redrawn image corresponding to the character image is generated by a realistic image redrawing model according to the character image and the prompt word corresponding to the character image. Based on the candidate realistic image, the character image and the candidate realistic image are aligned by the face-changing model according to the key points in the character image and the candidate realistic image, and the key features in the candidate realistic image are mapped to the key points in the character image to generate an overall redrawn image; wherein the key points are used to indicate the key positions on the face of the character in the image, and the key features are the facial features of the character at the key points in the candidate realistic image.
[0102] The character image and the prompt words corresponding to the character image are input into the realistic image redrawing model, and the realistic redrawn image corresponding to the character image is output. Since the face area in the realistic redrawn image will become blurred, in order to ensure the face quality of the character in the overall redrawn image, it is necessary to perform a face swap operation on the face area in the realistic redrawn image, replace the face in the realistic redrawn image with the face in other high-quality images, and improve the image quality of the face area of the overall redrawn image.
[0103] The candidate realistic image is a pre-configured high-quality realistic image. Exemplarily, the candidate realistic image is a 4k pixel realistic image. Optionally, the candidate realistic image can be a realistic image of any person, that is, there is no limitation on the age, gender, identity, action and other elements of the person in the candidate realistic image. Optionally, the candidate realistic image can be a realistic image with the same element as the person in the person image, for example, the candidate realistic image is a realistic image with the same gender as the person in the person image, or the candidate realistic image is a realistic image with the same age as the person in the person image, and so on. Optionally, the candidate realistic image can be a realistic image with multiple elements identical to the person in the person image, for example, the candidate realistic image is a realistic image with the same gender and age as the person in the person image, or the candidate realistic image is a realistic image with the same gender and action as the person in the person image, and so on.
[0104] The face-changing model needs to first perform face detection on the person image and the candidate realistic image respectively, locate the key points in the person image and the candidate realistic image, and the key points are used to indicate the key positions on the face of the person in the image, such as the eyes, nose, mouth and other facial positions. Secondly, according to the key points in the person image and the candidate realistic image, the person image and the candidate realistic image are aligned. For example, according to the facial positions such as eyes, nose, mouth and other facial positions in the person image and the eyes, nose, mouth and other facial positions in the candidate realistic image, the person in the person image and the person in the candidate realistic image are aligned, so that the facial features of the person in the person image and the candidate realistic image, such as the posture and expression of the person, are aligned. Then, the key features in the candidate realistic image are mapped to the key points in the person image. The key features are the facial features of the person at the key points in the candidate realistic image. For example, the eye features in the candidate realistic image are mapped to the eyes of the person in the person image, and the mouth features in the candidate realistic image are mapped to the mouth of the person in the person image, and so on. Finally, after the key feature mapping in the candidate realistic image is completed, the boundaries of each key point in the character image are processed by a hybrid algorithm (such as a Gaussian blur algorithm) so that the synthesized face is integrated with the original image to obtain an overall redrawn image.
[0105] Sub-step 2533, when the image type of the character image is a virtual image type, a virtual image redrawing model is used to generate an overall redrawn image according to the character image and the prompt words corresponding to the character image. The virtual image redrawing model is a model obtained by pre-training the image redrawing model based on training samples of the virtual image type.
[0106] The character image and the prompt words corresponding to the character image are input into the virtual image redrawing model to output the overall redrawn image. The virtual redrawn image generated by the virtual image redrawing model does not need to perform a face-changing operation, and the virtual redrawn image can be directly determined as the overall redrawn image.
[0107] The training samples of the virtual image type include sample virtual images, prompt words corresponding to the sample virtual images, and sample redrawn images of the sample virtual images. For the training process of the virtual image redrawing model, at least one training sample of the virtual image type is obtained, and a predicted redrawn image is obtained through the image redrawing model according to the sample virtual image and the prompt words corresponding to the sample virtual image. With the training goal of reducing the difference between the predicted redrawn image and the sample redrawn image, the parameters of the image redrawing model are adjusted to obtain the virtual image redrawing model.
[0108] By classifying character images into realistic image types and virtual image types, different image redrawing models are used for character images of different image types, so that the generated overall redrawn image can better represent the image content, highlight the character's facial area in the realistic image, and highlight the unity of the character and background in the virtual image, thereby improving the image quality of the overall redrawn image and improving the coordination and integrity of the overall redrawn image.
[0109] In some embodiments, step 250 is followed by step 260 , and step 260 includes at least one of sub-steps 261 - 263 .
[0110] Sub-step 261, obtaining a deformity detection result of the overall redrawn image through a quality detection model according to the overall redrawn image and the deformity detection parameter, wherein the deformity detection parameter is a minimum required parameter for the image quality of the overall redrawn image.
[0111] The quality detection model is a pre-trained binary classification model. The overall redrawn image and deformity detection parameters are input into the quality detection model, and the deformity detection result of the overall redrawn image is output. The deformity detection result is a first numerical value or a second numerical value. The first numerical value is used to indicate that the overall redrawn image passes the deformity detection, and the second numerical value is used to indicate that the overall redrawn image fails the deformity detection. This application does not limit the specific values of the first numerical value and the second numerical value. For example, if the first numerical value is 0 and the second numerical value is 1, then when the deformity detection result is 0, it is determined that the overall redrawn image passes the deformity detection, and when the deformity detection result is 1, it is determined that the overall redrawn image fails the deformity detection.
[0112] The purpose of image deformity detection is to identify whether there are quality problems such as content distortion, quality abnormality, structural errors, etc. in the image. Its core is to use computer vision and image quality assessment technology to analyze the content characteristics and pixel characteristics of the image.
[0113] In some embodiments, the deformity detection parameter includes at least one of the following: content parameter, quality parameter, and format parameter. The content parameter is used to indicate the rationality of the content logic in the overall redrawn image, the quality parameter includes at least one of the following: clarity, resolution, blurriness, and distortion tolerance, and the format parameter is used to indicate the integrity of the image format of the overall redrawn image.
[0114] The quality detection model needs to perform quality assessment on the overall redrawn image according to the deformity detection parameters, perform content analysis on the overall redrawn image according to the content parameters to obtain the content score of the overall redrawn image, perform quality analysis on the overall redrawn image according to the quality parameters to obtain the quality score of the overall redrawn image, and perform format analysis on the overall redrawn image according to the format parameters to obtain the format score of the overall redrawn image. Based on the content score, quality score and format score of the overall redrawn image, the deformity detection result of the overall redrawn image is obtained.
[0115] For content analysis, a deep learning network (such as CNN, Transformer) is used to analyze whether the image content conforms to common sense logic, for example, to determine whether the proportions of the characters in the image are unbalanced, whether the number of fingers is abnormal, etc., and to detect whether there are generation defects in the image, for example, to determine whether there are repeated textures, strange shapes, etc. in the image, and obtain a content score. For quality analysis, edge detection, contrast evaluation and other methods are used to perform clarity analysis to determine whether the image is blurred, and resolution detection is performed by detecting whether the image pixels are high enough and whether they meet the requirements of the application scenario. Image quality evaluation indicators (such as PSNR (Peak Signal to Noise Ratio) and SSIM (Structural Similarity Index Measure)) are used to perform compression distortion analysis to determine whether the image is distorted due to excessive compression and obtain a quality score. For format analysis, the image is checked for format damage (such as black blocks, blanks, data loss) to obtain a format score.
[0116] Optionally, whether the content of the overall redrawn image meets the set requirements is judged according to the set threshold of the content parameter, whether the quality of the overall redrawn image meets the set requirements is judged according to the set threshold of the quality parameter, and whether the format of the overall redrawn image meets the set requirements is judged according to the set threshold of the format score. In the case where the content score is greater than or equal to the set threshold of the content parameter, and the quality score is greater than or equal to the set threshold of the quality parameter, and the format score is greater than or equal to the set threshold of the format parameter, the deformity detection result is a first value, and the overall redrawn image passes the deformity detection. In the case where one of the content score, quality score, and format score is less than the corresponding set threshold, the deformity detection result is a second value, and the overall redrawn image fails the deformity detection.
[0117] Optionally, the content score, the quality score, and the format score are added according to their respective weights to obtain a comprehensive score of the overall redrawn image. When the comprehensive score is greater than or equal to a set threshold of the comprehensive score, the deformity detection result is a first value, and the overall redrawn image passes the deformity detection. When the comprehensive score is less than the set threshold of the comprehensive score, the deformity detection result is a second value, and the overall redrawn image fails the deformity detection.
[0118] Sub-step 262, when the deformity detection result is the first value, determining the entire redrawn image as the redrawn image to be finally output.
[0119] When the deformity detection result is the first value, it means that the entire redrawn image passes the deformity detection, and the entire redrawn image can be determined as the redrawn image to be finally output.
[0120] In sub-step 263, when the deformity detection result is a second value, a super-resolution overall redrawn image is generated based on the overall redrawn image through the image super-resolution model; when the deformity detection result of the super-resolution overall redrawn image is a first value, the super-resolution overall redrawn image is determined as the final output redrawn image.
[0121] When the deformity detection result is the second value, it indicates that the overall redrawn image fails the deformity detection, and the overall redrawn image needs to be enhanced. Exemplarily, the image super-resolution model is used to generate a super-resolved overall redrawn image based on the overall redrawn image. The quality detection model is used to obtain the deformity detection result of the super-resolved overall redrawn image based on the super-resolved overall redrawn image and the deformity detection parameter. When the deformity detection result of the super-resolved overall redrawn image is the first value, the super-resolved overall redrawn image is determined as the redrawn image that is finally output.
[0122] In some embodiments, when the number of super-resolution times of the overall redrawn image reaches a second threshold and each super-resolution image fails the deformity detection, the overall redrawn image corresponding to the maximum value of the comprehensive score of the super-resolution image is determined as the redrawn image to be finally output.
[0123] By adopting a quality detection model to perform deformity detection on the overall redrawn image and performing super-resolution on the overall redrawn image that fails the deformity detection, the image quality is enhanced and the image quality of the final output redrawn image is improved.
[0124] Figure 3The schematic diagram of the complete process of image redrawing is shown, and the input image is an image containing a person. First, the input image is detected to determine whether the input image contains text. If the input image contains text, the input image is image reversed to obtain the target prompt word corresponding to the input image, and the target prompt word is filtered for violations. If the target prompt word does not contain any illegal content, the target prompt word is determined as the prompt word corresponding to the input image. If the target prompt word contains illegal content, the prompt word corresponding to the input image is obtained from a preset vocabulary library according to the image content of the input image. And if the input image contains text, text detection is performed on the input image to obtain the text area of the input image, the text area and other areas are segmented, and the text area in the input image is filled with a first color to obtain the filled input image. The text area in the input image is redrawn according to the filled input image and the prompt word corresponding to the input image through the text redrawing model to generate a text redrawing image. Then, the text redrawing image is segmented into characters. If the input image does not contain text, the input image is directly segmented into characters to obtain a character image. Style extraction is performed on the character image to obtain the prompt word corresponding to the character image. The category detection model is used to detect the category of the person image to obtain the image type of the person image. When the image type of the person image is a realistic image type, the realistic image redrawing model is used to generate a realistic redrawn image corresponding to the person image according to the person image and the corresponding prompt word of the person image. Then, based on the candidate realistic image, the face-changing model is used to align the person image and the candidate realistic image according to the key points in the person image and the candidate realistic image, and the key features in the candidate realistic image are mapped to the key points in the person image to generate an overall redrawn image. When the image type of the person image is a virtual image type, the virtual image redrawing model is used to generate an overall redrawn image according to the person image and the corresponding prompt word of the person image. Finally, the overall redrawn image is subjected to deformity detection through the quality detection model. If the overall redrawn image passes the deformity detection, the overall redrawn image is determined as the final output redrawn image. If the overall redrawn image fails the deformity detection, the overall redrawn image is super-resolved to obtain the super-resolved overall redrawn image. If the super-resolved overall redrawn image passes the deformity detection, the super-resolved overall redrawn image is determined as the final output redrawn image.
[0125] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0126] Please refer to Figure 4, which shows a block diagram of an image redrawing device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned image redrawing method, and the function can be implemented by hardware, or by hardware executing corresponding software. The device can be the server introduced above, or it can be set in the server. Figure 4 As shown, the device 400 may include: an image acquisition module 410 , a prompt word determination module 420 , a text detection module 430 , a text redrawing module 440 and an overall redrawing module 450 .
[0127] The image acquisition module 410 is used to acquire an input image.
[0128] The prompt word determination module 420 is used to obtain a prompt word corresponding to the input image according to the input image when the input image contains text, wherein the prompt word corresponding to the input image is used to indicate the image content of the input image.
[0129] The text detection module 430 is used to perform text detection on the input image to obtain the text area of the input image.
[0130] The text redrawing module 440 is used to generate a text redrawing image of the input image according to the input image, the text area of the input image and the prompt word corresponding to the input image through a text redrawing model, wherein the text redrawing image is an image obtained by redrawing the text area of the input image.
[0131] The overall redrawing module 450 is used to redraw the image according to the text using the image redrawing model to obtain an overall redrawn image corresponding to the input image.
[0132] In some embodiments, the prompt word determination module 420 is used to:
[0133] Extracting features of the input image and at least one candidate prompt word respectively through a multimodal learning model to obtain image features of the input image and text features corresponding to the at least one candidate prompt word respectively;
[0134] Calculating the similarity between the image feature of the input image and the text feature respectively corresponding to the at least one candidate prompt word, to obtain the similarity respectively corresponding to the at least one candidate prompt word;
[0135] Determine the candidate prompt word corresponding to the maximum value of the similarities corresponding to the at least one candidate prompt word as the target prompt word;
[0136] In a case where the target prompt word does not contain any illegal content, the target prompt word is determined as the prompt word corresponding to the input image.
[0137] In some embodiments, the prompt word determination module 420 is further used to:
[0138] In the case that the target prompt word contains illegal content, the prompt word corresponding to the input image is obtained from a preset vocabulary library according to the image content of the input image.
[0139] In some embodiments, the text redrawing module 440 is used to:
[0140] Filling the text area in the input image with a first color to obtain a filled input image;
[0141] The text redrawing image is generated by the text redrawing model according to the filled input image and the prompt word corresponding to the input image.
[0142] In some embodiments, the overall redrawing module 450 is used to:
[0143] Segmenting the character and background in the text-redrawn image, and filling the background area in the text-redrawn image with a first color to obtain a character image corresponding to the character in the text-redrawn image;
[0144] Obtaining a prompt word corresponding to the character image according to the character image through a large language model, wherein the prompt word corresponding to the character image is used to indicate a character style in the character image;
[0145] The image redrawing model is used to obtain an overall redrawn image corresponding to the input image according to the character image and the prompt word corresponding to the character image. The overall redrawn image is an image obtained by overall redrawing the character area and the background area in the character image.
[0146] In some embodiments, the overall redrawing module 450 is used to:
[0147] Obtaining an image type of the character image according to the character image through a category detection model, wherein the image type of the character image is a realistic image type or a virtual image type;
[0148] In the case where the image type of the person image is the realistic image type, the overall redrawn image is obtained according to the person image and the prompt word corresponding to the person image by using a realistic image redrawing model, wherein the realistic image redrawing model is a model obtained by pre-training the image redrawing model based on training samples of the realistic image type;
[0149] When the image type of the character image is the virtual image type, the overall redrawn image is generated according to the character image and the prompt words corresponding to the character image through a virtual image redrawing model, and the virtual image redrawing model is a model obtained by pre-training the image redrawing model based on training samples of the virtual image type.
[0150] In some embodiments, the overall redrawing module 450 is used to:
[0151] Generate a realistic redrawn image corresponding to the character image according to the character image and the prompt word corresponding to the character image by using a realistic image redrawing model;
[0152] Based on the candidate realistic image, the character image and the candidate realistic image are aligned according to the key points in the character image and the candidate realistic image through a face-changing model, and the key features in the candidate realistic image are mapped to the key points in the character image to generate the overall redrawn image; wherein the key points are used to indicate the key positions on the face of the character in the image, and the key features are the facial features of the character at the key points in the candidate realistic image.
[0153] In some embodiments, the apparatus 400 further includes a deformity detection module, wherein the deformity detection module is configured to:
[0154] Obtaining a deformity detection result of the overall redrawn image according to the overall redrawn image and a deformity detection parameter through a quality detection model, wherein the deformity detection parameter is a minimum required parameter of the image quality of the overall redrawn image;
[0155] When the deformity detection result is a first value, determining the overall redrawn image as a redrawn image to be finally output;
[0156] When the deformity detection result is a second value, a super-resolution overall redrawn image is generated based on the overall redrawn image through an image super-resolution model; and when the deformity detection result of the super-resolution overall redrawn image is the first value, the super-resolution overall redrawn image is determined as the final output redrawn image.
[0157] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0158] Please refer to Figure 5 , which shows a block diagram of a computer device 500 provided in one embodiment of the present application. The computer device 500 may be any electronic device with data calculation, processing and storage functions. The computer device 500 may be used to implement the image redrawing method provided in the above embodiment.
[0159] Typically, the computer device 500 includes a processor 501 and a memory 502 .
[0160] The processor 501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 501 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 501 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 501 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 501 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0161] The memory 502 may include one or more computer-readable storage media, which may be non-transitory. The memory 502 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 502 is used to store a computer program, which is configured to be executed by one or more processors to implement the above-mentioned image redrawing method.
[0162] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation on the computer device 500, and the computer device 500 may include more or less components than those shown in the figure, or combine some components, or adopt a different arrangement of components.
[0163] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein a computer program is stored in the storage medium, and the computer program implements the above-mentioned image redrawing method when executed by a processor of a computer device. Optionally, the above-mentioned computer-readable storage medium may be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0164] In an exemplary embodiment, a computer program product is also provided, the computer program product includes a computer program, the computer program is stored in a computer-readable storage medium, a processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned image redrawing method.
[0165] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.
[0166] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. An image redrawing method, characterized in that: The method comprises: Get the input image; In the case where the input image contains text, obtaining a prompt word corresponding to the input image according to the input image, wherein the prompt word corresponding to the input image is used to indicate the image content of the input image; Performing text detection on the input image to obtain a text area of the input image; Generate a text redrawing image of the input image according to the input image, the text area of the input image and the prompt word corresponding to the input image by a text redrawing model, wherein the text redrawing image is an image obtained by redrawing the text area of the input image; The image is redrawn according to the text using the image redrawing model to obtain an overall redrawn image corresponding to the input image.
2. The method according to claim 1, characterized in that: The obtaining, according to the input image, a prompt word corresponding to the input image includes: Extracting features of the input image and at least one candidate prompt word respectively through a multimodal learning model to obtain image features of the input image and text features corresponding to the at least one candidate prompt word respectively; Calculating the similarity between the image feature of the input image and the text feature respectively corresponding to the at least one candidate prompt word, to obtain the similarity respectively corresponding to the at least one candidate prompt word; Determine the candidate prompt word corresponding to the maximum value of the similarities corresponding to the at least one candidate prompt word as the target prompt word; In a case where the target prompt word does not contain any illegal content, the target prompt word is determined as the prompt word corresponding to the input image.
3. The method according to claim 2, characterized in that The method further comprises: In the case that the target prompt word contains illegal content, the prompt word corresponding to the input image is obtained from a preset vocabulary library according to the image content of the input image.
4. The method according to claim 1, characterized in that: The step of generating a text redrawing image of the input image according to the input image, the text area of the input image and the prompt word corresponding to the input image by using a text redrawing model includes: Filling a text area in the input image with a first color to obtain a filled input image; The text redrawing image is generated by the text redrawing model according to the filled input image and the prompt word corresponding to the input image.
5. The method according to claim 1, characterized in that The step of redrawing the image according to the text by using the image redrawing model to obtain an overall redrawn image corresponding to the input image includes: Segmenting the character and background in the text-redrawn image, and filling the background area in the text-redrawn image with a first color to obtain a character image corresponding to the character in the text-redrawn image; Obtaining a prompt word corresponding to the character image according to the character image through a large language model, wherein the prompt word corresponding to the character image is used to indicate a character style in the character image; The image redrawing model is used to obtain an overall redrawn image corresponding to the input image according to the character image and the prompt word corresponding to the character image. The overall redrawn image is an image obtained by overall redrawing the character area and the background area in the character image.
6. The method according to claim 5, characterized in that The step of obtaining an overall redrawn image corresponding to the input image according to the character image and the prompt word corresponding to the character image by using the image redrawing model includes: Obtaining an image type of the character image according to the character image through a category detection model, wherein the image type of the character image is a realistic image type or a virtual image type; In the case where the image type of the person image is the realistic image type, the overall redrawn image is obtained according to the person image and the prompt word corresponding to the person image by using a realistic image redrawing model, wherein the realistic image redrawing model is a model obtained by pre-training the image redrawing model based on training samples of the realistic image type; When the image type of the character image is the virtual image type, the overall redrawn image is generated according to the character image and the prompt words corresponding to the character image through a virtual image redrawing model, and the virtual image redrawing model is a model obtained by pre-training the image redrawing model based on training samples of the virtual image type.
7. The method according to claim 6, characterized in that The method of obtaining the overall redrawn image by redrawing the model of the realistic image according to the character image and the prompt word corresponding to the character image includes: Generate a realistic redrawn image corresponding to the character image according to the character image and the prompt word corresponding to the character image by using a realistic image redrawing model; Based on the candidate realistic image, the character image and the candidate realistic image are aligned according to the key points in the character image and the candidate realistic image through a face-changing model, and the key features in the candidate realistic image are mapped to the key points in the character image to generate the overall redrawn image; wherein the key points are used to indicate the key positions on the face of the character in the image, and the key features are the facial features of the character at the key points in the candidate realistic image.
8. The method according to claim 1, characterized in that: After redrawing the image according to the text by using the image redrawing model to obtain the overall redrawn image corresponding to the input image, the method further includes: Obtaining a deformity detection result of the overall redrawn image according to the overall redrawn image and a deformity detection parameter through a quality detection model, wherein the deformity detection parameter is a minimum required parameter of the image quality of the overall redrawn image; When the deformity detection result is a first value, determining the overall redrawn image as a redrawn image to be finally output; When the deformity detection result is a second value, a super-resolution overall redrawn image is generated based on the overall redrawn image through an image super-resolution model; and when the deformity detection result of the super-resolution overall redrawn image is the first value, the super-resolution overall redrawn image is determined as the final output redrawn image.
9. An image redrawing device, characterized in that: The device comprises: An image acquisition module, used for acquiring an input image; a prompt word determination module, configured to obtain a prompt word corresponding to the input image according to the input image when the input image contains text, wherein the prompt word corresponding to the input image is used to indicate the image content of the input image; A text detection module, used to perform text detection on the input image to obtain a text area of the input image; a text redrawing module, configured to generate a text redrawing image of the input image according to the input image, the text area of the input image and the prompt word corresponding to the input image through a text redrawing model, wherein the text redrawing image is an image obtained by redrawing the text area of the input image; The overall redrawing module is used to redraw the image according to the text using the image redrawing model to obtain an overall redrawn image corresponding to the input image.
10. A computer device, characterized in that: The computer device comprises a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the image redrawing method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the image redrawing method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The computer program product comprises a computer program, and the computer program is loaded and executed by a processor to implement the image redrawing method according to any one of claims 1 to 8.
