Poster-based face super-division directional processing method and device

AI technology is used to recognize, crop and train neural network models on posters, which solves the problem of insufficient clarity of old movie posters and enables the generation of high-definition posters and better recommendations for high-quality content.

CN118736646APending Publication Date: 2024-10-01SHENZHEN COOCAA NETWORK TECH CO LTD

Patent Information

Application Number
CN202410858834.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The existing technology lacks effective poster processing technology, resulting in insufficient clarity of characters in old movie and TV series posters, which affects the audience's attention.

Method used

Using the AI-based super-resolution orientation processing method for poster faces, we collect high-definition material pictures for face recognition, cropping and alignment, train the neural network model, and generate high-definition posters.

Benefits of technology

Improved the clarity and visual quality of poster characters, allowing high-quality TV series to be better recommended.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736646A_ABST
    Figure CN118736646A_ABST
Patent Text Reader

Abstract

The invention discloses a poster-based face super-resolution directional processing method and device, and the method comprises the steps: collecting and obtaining high-definition material pictures of a preset number of actors, and carrying out the face recognition and face positioning, and obtaining a face image; performing picture cutting on the face image, aligning the cut face image to a preset standard position or shape, and outputting a face image with a preset resolution; inputting a face image with a predetermined resolution into the model as a training data set for training to obtain a trained directional image super-division neural network model; and acquiring a picture which needs to generate a poster and contains historical materials of a specified actor, inputting the picture into the trained directional image super-division neural network model for processing, and outputting to obtain a poster containing a high-definition image of the specified actor. According to the method, the poster of a long-time movie television can be subjected to super-resolution processing, and the AI technology is used for generating the super-definition poster, so that the high-quality television drama can be better recommended.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, intelligent terminal and storage medium for super-resolution directional processing of poster faces. Background Art

[0002] With the development of science and technology and the continuous improvement of people's living standards, the use of smart terminals such as smart TVs is becoming more and more popular. Users often use smart terminals to play various movies.

[0003] In the TV and film industry, there are many high-quality classic movies, TV series, and documentaries. Because these movies are very old, the clarity of the posters cannot meet the current operation needs. There is no good poster processing technology in the existing technology to process the clarity of the posters of old movies, TV series, and documentaries, especially the characters involved in the posters. A good content often does not get the attention of the audience because the poster quality resolution is not high enough and it looks low quality.

[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method, device, intelligent terminal and storage medium based on poster face super-resolution directional processing in view of the above-mentioned defects of the prior art, aiming to solve the problem of the lack of good poster processing technology in the prior art and the problem of processing the clarity of posters of old movies, TV series and documentaries, especially the characters involved in the posters. The present invention can perform super-resolution processing on posters and use AI technology to generate ultra-clear posters so that these high-quality TV series can be better recommended.

[0006] The technical solution adopted by the present invention to solve the problem is as follows:

[0007] A poster-based face super-resolution directional processing method, comprising:

[0008] Collecting and obtaining a predetermined number of high-definition material pictures of actors, wherein the resolution of the high-definition material pictures is greater than a preset resolution value and the faces are clear;

[0009] Performing face recognition and face positioning on the collected high-definition material pictures of a predetermined number of actors to obtain face images based on the recognition results;

[0010] Based on the facial image of the recognition result, cropping the facial image, aligning the cropped facial image to a preset standard position or shape, and outputting it as a facial image of a predetermined resolution;

[0011] The face image of the predetermined resolution is used as a training data set, and input into a predetermined neural network model for training to obtain a trained directional image super-resolution neural network model;

[0012] Obtain historical material pictures containing designated actors for which posters need to be generated, input the historical material pictures containing designated actors for which posters need to be generated into the trained directional image super-resolution neural network model for processing, and output a high-definition image poster containing the designated actors.

[0013] In the poster-based face super-resolution directional processing method, the step of collecting and obtaining a predetermined number of high-definition material pictures of actors, the resolution of the high-definition material pictures being above a preset resolution value and the faces being clear, comprises:

[0014] Collect and obtain historical posters, perform data cleaning on the collected historical posters, obtain high-definition material pictures of a predetermined number of actors, and process them to a resolution of 1024*1024 or above, with clear faces of the actors;

[0015] Image data containing certain designated actor portraits are captured from previously broadcasted television and / or movie videos, and data cleaning is performed on the captured image data containing certain designated actor portraits to obtain high-definition material images of a predetermined number of actors, which are processed to a resolution of 1024*1024 or above, with clear faces of the actors.

[0016] The poster-based face super-resolution directional processing method, wherein the step of performing face recognition and face positioning on the collected high-definition material pictures of a predetermined number of actors to obtain a face image based on the recognition result includes:

[0017] Use the face recognition algorithm in computer vision technology to analyze and identify each high-definition material image, detect the face area in the image, and select the face with a specified mark or frame;

[0018] Based on the results of face recognition, the identified face area is positioned, including adjusting the position, size and angle of the face to ensure that each actor's face is fully presented;

[0019] Based on recognition and positioning, the face area in each high-definition material picture is extracted to generate an independent face image;

[0020] The facial data of each actor is labeled, including adding labels, metadata, or related information about the associated actor to each facial image.

[0021] The method for super-resolution directional processing of poster faces, wherein the steps of cropping the face image based on the recognition result, aligning the cropped face image to a preset standard position or shape, and outputting the face image as a predetermined resolution include:

[0022] According to the face recognition results, the facial area of ​​each actor is determined and the face image is cut out;

[0023] Align the cropped face images to a preset standard position or shape, including adjusting the position, size, and angle of the face, so that all face images are consistent in style and size;

[0024] The aligned face image is scaled and output as a face image with a predetermined resolution.

[0025] The poster-based face super-resolution directional processing method, wherein the step of using the face image of the predetermined resolution as a training data set, inputting it into a predetermined neural network model for training, and obtaining the trained directional image super-resolution neural network model comprises:

[0026] Select the corresponding neural network model;

[0027] A plurality of face images of predetermined resolutions are obtained as training data sets and input into a predetermined neural network model for training. During training, the neural network model gradually adjusts its internal parameters and weights to adjust the gap between the generated image and the real high-resolution image, thereby obtaining a trained directional image super-resolution neural network model.

[0028] The method for directional processing of poster-based face super-resolution, wherein the steps of obtaining a historical material picture containing a designated actor for which a poster needs to be generated, inputting the historical material picture containing a designated actor for which a poster needs to be generated into the trained directional image super-resolution neural network model for processing, and outputting a poster containing a high-definition image of the designated actor include:

[0029] Get the historical material pictures containing the specified actors for which the poster needs to be generated, wherein the historical material pictures can be historical material pictures of TV and movies from a long time ago

[0030] The collected historical material pictures are used as input and input into the trained directional image super-resolution neural network model for processing, so as to convert the low-resolution historical material pictures into high-definition images;

[0031] Control the trained directional image super-resolution neural network model to output the converted high-definition image.

[0032] In the poster-based face super-resolution directional processing method, the step of collecting and obtaining a predetermined number of high-definition material pictures of actors comprises:

[0033] Data cleaning and collection of high-definition stock images of a specified number of celebrity actors.

[0034] A poster-based face super-resolution directional processing device, wherein the device comprises:

[0035] A collection and acquisition module, used to collect and acquire a predetermined number of high-definition material pictures of actors, wherein the resolution of the high-definition material pictures is greater than a preset resolution value and the faces are clear;

[0036] A face recognition and positioning module is used to perform face recognition and face positioning on the collected high-definition material pictures of a predetermined number of actors to obtain a face image based on the recognition result;

[0037] An image cropping module is used to crop the face image based on the face image of the recognition result, align the cropped face image to a preset standard position or shape, and output it as a face image of a predetermined resolution;

[0038] A training module, used to input the face image of the predetermined resolution as a training data set into a predetermined neural network model for training, so as to obtain a trained directional image super-resolution neural network model;

[0039] The poster generation control module is used to obtain historical material pictures containing designated actors for which posters need to be generated, input the historical material pictures containing designated actors for which posters need to be generated into the trained directional image super-resolution neural network model for processing, and output a high-definition image poster including the designated actors.

[0040] An intelligent terminal includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, including the method for executing any one of the methods described above.

[0041] A non-transitory computer-readable storage medium, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any one of the methods described above.

[0042] Beneficial effects of the invention: The invention provides a method, device, intelligent terminal and storage medium based on poster face super-resolution directional processing. The invention can realize super-resolution processing of posters of old movies and TV shows, and use AI technology to generate ultra-clear posters so that these high-quality TV series can be better recommended. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 It is a flowchart of a poster face super-resolution directional processing method provided by an embodiment of the present invention.

[0045] Figure 2 It is a schematic diagram of picture cropping based on the poster face super-resolution directional processing method provided by an embodiment of the present invention.

[0046] Figure 3 It is a principle block diagram of an embodiment of a poster face super-resolution directional processing device provided by the present invention.

[0047] Figure 4 It is a block diagram of the internal structure principle of the intelligent terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0049] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0050] There is no good poster processing technology in the prior art, and the technical problem of processing the clarity of posters of old movies, TV series, and documentaries, especially the movie characters involved in the posters, is solved.

[0051] Therefore, it is necessary to super-resolution the posters and use AI technology to allow these high-quality TV series to be better recommended.

[0052] like Figure 1 As shown, a poster face super-resolution directional processing method based on embodiment 1 of the present invention includes the following steps:

[0053] Step S100, collecting and acquiring a predetermined number of high-definition material pictures of actors, wherein the resolution of the high-definition material pictures is greater than a preset resolution value and the faces are clear;

[0054] In this step, collecting and obtaining a predetermined number of high-definition material images of actors means that before performing poster face super-resolution directional processing, a sufficient number of historical high-definition material images containing commonly used actors need to be collected for subsequent face analysis. The resolution of these high-definition material images usually needs to reach a preset value or above, such as the common 1080p or 4K resolution, and the face must be clear.

[0055] The benefits of this step are manifold. First, collecting historical high-definition stock images of commonly used actors can be better cut and edited in post-production, ensuring higher quality and better realism of the film. Second, stock images with clear faces can better provide basic data for the restoration of actor images of old TV or TV.

[0056] In the specific implementation, step S100 specifically includes the following steps:

[0057] S101. First, it is necessary to clearly determine how many high-definition stock images of actors need to be collected. The number of actors required is determined according to the needs of the film or video. For example, high-definition stock images of all actors in the past 50 years can be collected to facilitate the subsequent steps of high-definition restoration of some old TV and / or movie posters.

[0058] For example, you can collect high-definition material pictures of all the actors in old TV footage from a certain era. Of course, you can also collect all the material pictures of all the actors in old TV footage from a certain era, and then compare and filter them.

[0059] S102. Set resolution standards: Determine the resolution standards of the required material images, such as 1080p or 4K, etc. This ensures that post-production meets high-definition quality requirements.

[0060] Step S200, performing face recognition and face positioning on the collected high-definition material pictures of a predetermined number of actors to obtain a face image based on the recognition result;

[0061] In the embodiment of this step, face recognition and face positioning are performed on the collected high-definition material pictures, the main purpose of which is to recognize and position the actor's face image in a large number of high-definition material pictures; in the specific implementation, the following detailed steps are included:

[0062] S201. Use artificial intelligence technology or face recognition software to perform face recognition on each high-definition material image. Use algorithms to identify the face area and accurately locate the face of each actor.

[0063] For example, the face recognition algorithm in computer vision technology can be used to analyze and identify each high-definition material image. The algorithm can detect the face area in the image and select the face with a specific mark or frame.

[0064] S202: Based on the face recognition result, the identified face area is precisely positioned, which involves adjusting the position, size and angle of the face to ensure that each actor's face is fully presented.

[0065] This step makes fine adjustments to face positioning based on face recognition to ensure that each actor's facial features are obvious and the contours are clear.

[0066] S203: extract the face area in each high-definition material picture based on the recognition and positioning to generate independent face images. These face images can be saved separately and used for subsequent production and processing.

[0067] This step extracts the facial image of each actor based on the results of face recognition and positioning, and saves it as an independent file for subsequent production and use.

[0068] S204: Manage and label the facial data of each actor, which may include adding tags, metadata, or related information of the associated actor to each facial image, so as to make it easier to identify and use in the subsequent production process.

[0069] This step is mainly to mark facial information, marking each facial image, including the actor's name, role information, etc., to facilitate later identification and management.

[0070] In this embodiment, through face recognition and positioning technology, the facial information of each actor can be accurately extracted and saved as an independent face image, which is convenient for the restoration and reconstruction of the corresponding actor's face image in the subsequent poster image.

[0071] For example, when making a poster for an old TV show, such as the poster of Legend of White Snake, it is necessary to add the high-definition face of a designated leading actor to the poster. After performing face recognition and positioning on the designated leading actor in the previous historical high-definition material pictures, the facial information of the actor can be accurately extracted. Then, these face images can be merged with the poster in the following steps to achieve the effect of a high-definition poster. The details are described in the following steps S300-S500.

[0072] Step S300: based on the face image of the recognition result, cropping the face image, aligning the cropped face image to a preset standard position or shape, and outputting it as a face image of a predetermined resolution;

[0073] In this step, in the step of cropping and aligning the face image based on the recognition result, it is first necessary to locate the facial area of ​​each actor according to the face recognition and positioning results, and then perform cropping and alignment operations. In specific implementation, the detailed steps are as follows:

[0074] S301, first, according to the result of face recognition, determine the facial area of ​​each actor, and accurately cut out the face image. This step mainly cuts out the image with the face area, retaining only the face part, to ensure that the face image is clear and visible.

[0075] S302, aligning the cropped face images to a preset standard position or shape, including adjusting the position, size, and angle of the face, so that all face images are consistent in style and size.

[0076] S303: scaling the aligned face image and outputting it as a face image with a predetermined resolution. This can ensure that the face image is suitable for subsequent production and processing requirements by adjusting the image resolution and clarity.

[0077] In this step, through cropping, alignment and scaling, the facial images of each actor can be kept consistent in size, style and quality, which is conducive to the subsequent production process and unified visual effects. In addition, the cropped and aligned facial images can be directly used for subsequent synthesis, poster repair processing and other operations, saving the time and energy of the production staff and improving production efficiency.

[0078] Step S400: using the face image of the predetermined resolution as a training data set, inputting it into a predetermined neural network model for training, and obtaining a trained directional image super-resolution neural network model;

[0079] In the embodiment of this step, inputting the face image of predetermined resolution as a training data set into the predetermined neural network model for training, and finally obtaining the trained directional image super-resolution neural network model is a complex and valuable process.

[0080] Specifically, first, obtain the facial images of the predetermined resolution prepared in the previous step, including the facial images of each actor, which are processed by cropping, alignment and scaling in the previous step to ensure consistent predetermined resolution. These images will be input into the neural network model as a training data set. The data set can include high-resolution facial images and corresponding low-resolution versions.

[0081] Next, the prepared face images of predetermined resolution are used as training data sets and input into the predetermined neural network model for training. The task of the neural network model is to learn the mapping relationship between low-resolution images and high-resolution images, so as to achieve super-resolution reconstruction of the image.

[0082] Specifically, you can choose a suitable neural network architecture, such as a convolutional neural network (CNN) or a generative adversarial network (GAN), and input the prepared face image dataset into the model for training. The goal of the training is to learn how to convert low-resolution face images into high-resolution directional images.

[0083] A plurality of face images of predetermined resolutions are obtained as training data sets and input into a predetermined neural network model for training. During training, the neural network model gradually adjusts its internal parameters and weights to adjust the gap between the generated image and the real high-resolution image, thereby obtaining a trained directional image super-resolution neural network model.

[0084] Specifically, through the training data set, the neural network model gradually adjusts its internal parameters and weights to minimize the gap between the generated image and the real high-resolution image, thereby obtaining a trained directional image super-resolution neural network model.

[0085] After training, the resulting directional image super-resolution neural network model can generate high-resolution images based on low-resolution input images. This model can achieve fine enhancement and super-resolution processing of images by learning image features and patterns from a large amount of training data.

[0086] In this step, the trained super-resolution neural network model can effectively improve the visual quality of the face image and enhance the clarity, details and realism of the image. This directional image super-resolution processing can make the face image more vivid and delicate, meeting the high requirements of production.

[0087] And using neural network models for super-resolution processing can realize the automated processing of a large number of face images, saving labor costs and speeding up the production process. At the same time, the model can learn from rich training data and gradually improve the processing effect.

[0088] For example, when there is a dataset containing a large number of high-resolution face images and their corresponding low-resolution versions, these image pairs can be input into a Convolutional Neural Network (CNN) model for training, allowing the model to learn how to convert low-resolution images into high-resolution images.

[0089] Such processing can make special effects characters more realistic and detailed, and more consistent with the characteristics of the original actors, enhancing the highlights and viewing experience. The trained neural network model can improve the efficiency and accuracy of production while improving image quality, bringing better visual effects and experience to film and television special effects production.

[0090] Step S500, obtaining historical material pictures containing designated actors for which posters need to be generated, inputting the historical material pictures containing designated actors for which posters need to be generated into the trained directional image super-resolution neural network model for processing, and outputting a high-definition image poster containing the designated actors.

[0091] In the embodiment of this step, historical material pictures containing designated actors for which posters need to be generated are obtained, that is, historical material pictures of television and movies from a relatively long period of time can be found; these historical material pictures are then input into the trained directional image super-resolution neural network model for processing, and finally a high-definition image poster containing the designated actors is output, which is an important task with practical application significance.

[0092] When this step is implemented specifically, the following steps are included:

[0093] S501. Obtain historical material pictures containing designated actors for which posters need to be generated. That is, firstly, historical material pictures containing designated actors need to be collected. These historical material pictures may be historical material pictures of TV and movies from a relatively long period of time, or screenshots and publicity photos of the actors in different film and television works.

[0094] S502: The collected historical material pictures are used as inputs to the trained directional image super-resolution neural network model for processing. In the embodiment of the present invention, the low-resolution historical material pictures are converted into high-definition images according to the image mapping relationship learned during training.

[0095] S503. Outputting a high-definition image poster: After being processed by the model, the output result will be a high-definition image poster containing the designated actor. This poster will present a clearer and more detailed visual effect, making the image of the designated actor more vivid and eye-catching.

[0096] For example, if you want to generate a high-definition poster for an old TV show or movie to show the image of an actor in the movie, the embodiment of the present invention can collect various photos of an actor in different movies as historical material pictures, and then input these pictures into the trained super-resolution neural network model for processing. The final output high-definition image poster will show the image of Tom Cruise, with clearer and more delicate picture quality, which is very suitable for publicity, posters and other purposes.

[0097] In the embodiment of the present invention, generating a high-definition image poster can effectively improve the image quality of the designated actor and attract more audience attention. And through neural network processing, the image becomes clearer and more delicate, so that the poster presents a more refined visual effect. And using technology to generate high-definition image posters can save manpower and time costs and improve efficiency.

[0098] The method of the present invention is further described in detail below through a more specific application example:

[0099] A poster-based face super-resolution directional processing method of this specific application embodiment includes the following points:

[0100] S10. Collect high-definition posters of each core actor and clean them from historical posters;

[0101] Collect and obtain high-definition material images of a predetermined number of actors with a resolution of 1024*1024 or above and clear faces. They can be obtained by cleaning from historical posters or captured from previously broadcast television and / or movie videos.

[0102] For example, data collection is conducted on high-definition material images of more than 200 celebrity artists, requiring a resolution greater than 1024*1024 and clear faces.

[0103] S20. Perform face recognition and positioning on the collected high-definition material images of a predetermined number of actors. This is to prepare for face positioning in the data set, using a lightweight model, insightface.

[0104] InsightFace is a face recognition model, and lightweight models generally refer to reducing the size and computational complexity of the model while maintaining model performance. In the embodiments of the present invention, lightweight models are used to optimize the model architecture and parameters to reduce the size of the model and the computing resource requirements while maintaining recognition performance as much as possible. For face recognition models such as InsightFace, lightweighting may include technical means such as compressing the model, trimming model parameters, and quantizing the model.

[0105] The following is the core demo code:

[0106] frominsightface.detect import RetinaFaceimport cv2

[0107] detector=RetinaFace()

[0108] img=cv2.imread("image.jpg")frominsightface.utils import load_data

[0109] # Preprocess the image

[0110] data = load_data(img)

[0111] #Get the results of face detection and alignment

[0112] bbox, landmarks=detector.detect(data).

[0113] S30: based on the facial image obtained by the recognition, crop the facial image, and align the cropped facial image to a preset standard position or shape.

[0114] This step is mainly to align the face, aligning the recognized face part in the image to a standard position or shape;

[0115] Face alignment is an image processing technique that aims to align the facial parts in an image to a standard position or shape. In the embodiments of the present invention, face alignment involves aligning key points such as eyes, nose and mouth to specific positions. In this way, all face images can have a consistent direction and size, which facilitates subsequent processing and analysis.

[0116] The effects of face alignment in the embodiment of the present invention include:

[0117] (1) Standardization: Through alignment, all face images can have the same orientation, size and proportion, which helps subsequent analysis tasks such as face recognition and expression recognition.

[0118] (2) Enhanced features: Alignment can make the facial features in the image clearer and more stable, thereby improving the accuracy of tasks such as feature extraction, matching, and classification.

[0119] (3) Reduce noise and deformation: For face images from different sources or angles, alignment can reduce the deformation and noise introduced by factors such as perspective, lighting, and occlusion.

[0120] (4) Enhance the accuracy of face recognition: In face recognition tasks, aligned face images can provide more consistent and reliable features, thereby improving the accuracy and robustness of recognition.

[0121] In the embodiment of the present invention, according to the face recognition result of step S20, the picture is cropped and converted into 1024*1024 pixels. The effect is as follows: Figure 2 shown.

[0122] S40, then aligning the face image to a preset standard position or shape

[0123] S41. Create a preset neural network model: In PyTorch, you can define a model by defining a model class that inherits from the nn.Module class. The GFPGAN model can use common generators and discriminators similar to SRGAN and ESRGAN to study the structure of the model.

[0124] Among them, PyTorch is an open source Python machine learning library based on Torch, used for applications such as natural language processing; PyTorch is mainly used to create neural networks.

[0125] nn.Module is a base class in PyTorch, and all neural network modules inherit from this class. It provides many useful functions, such as parameter management, model serialization, etc.

[0126] The GFPGAN model is an open source face restoration algorithm model developed by a company, which is a GAN model used for face image generation and optimization.

[0127] SRGAN (Super-Resolution Generative Adversarial Network) is a super-resolution generative adversarial network that aims to improve the resolution of images. It is based on the network architecture of the Generative Adversarial Network (GAN) and generates high-resolution images by training the generator and the discriminator. SRGAN generates more realistic and clear high-resolution images by introducing perceptual loss and adversarial loss.

[0128] ESRGAN (Enhanced Super-Resolution Generative Adversarial Network) is an improved version of SRGAN, which improves the quality of generated images by introducing an improved generator architecture and a more complex network structure. ESRGAN adds a residual channel attention mechanism and an enhanced perceptual loss function on the basis of SRGAN, further improving the quality and realism of generated images. ESRGAN has achieved better results and performance in the field of image super-resolution.

[0129] import torch.nn as nnimport torch.nn.functional as F

[0130] class Generator(nn.Module):def init(self):

[0131] ...def forward(self,x): ...

[0133] class Discriminator(nn.Module):def init(self): ...

[0135] def forward(self,x): ...

[0137] S42. Define hyperparameters and optimizer: Define hyperparameters such as learning rate, number of iterations, batch size, etc. Choose an appropriate optimizer to minimize the loss function.

[0138] Among them, hyperparameters are mainly used to control the complexity of the model, prevent overfitting or underfitting, and adjust the behavior of the optimization algorithm. For example, the learning rate determines the speed at which the model learns new knowledge, and the batch size affects the training speed and effect of the model.

[0139] The optimizer in the neural network model is mainly used to optimize the loss function and change the trainable parameters in a way that minimizes the loss function. The working principle of the optimizer is to guide the optimizer to move in the right direction by comparing the gap between the output predicted by the neural network itself and the true label (i.e., the loss function), so as to find the optimal solution that minimizes the loss function.

[0140] The specific implementation code in this step is as follows:

[0141]

[0142]

[0143] S43, define training and testing functions: define training and testing functions, and train and test the model. In the training function, it is necessary to perform forward pass, calculate loss function, back propagate and optimize in sequence. In the test function, it is necessary to evaluate and predict the model and output the corresponding results.

[0144] The specific implementation code is as follows:

[0145]

[0146]

[0147] S44. Start training: Use a for loop to iterate training and testing, record the loss and evaluation indicators during training, and save the trained model.

[0148] for epoch in range(num_epochs):

[0149] train(generator,discriminator,train_loader,criterion,optimizer_G,optimizer_D,epoch)

[0150] test(generator,test_loader,criterion,epoch)

[0151] #Record loss and evaluation metrics

[0152] #Save the model.

[0153] As can be seen from the above, the present invention can realize super-resolution processing of posters of old movies and TV shows, and use AI technology to generate ultra-clear posters so that these high-quality TV series can be better recommended.

[0154] Exemplary Devices

[0155] like Figure 3 As shown, an embodiment of the present invention provides a poster-based face super-resolution directional processing device, the device comprising:

[0156] The collecting and acquiring module 310 is used to collect and acquire a predetermined number of high-definition material pictures of actors, wherein the resolution of the high-definition material pictures is greater than a preset resolution value and the faces are clear;

[0157] The face recognition and positioning module 320 is used to perform face recognition and face positioning on the collected high-definition material pictures of a predetermined number of actors to obtain a face image based on the recognition result;

[0158] The image cropping module 330 is used to crop the face image based on the face image of the recognition result, align the cropped face image to a preset standard position or shape, and output it as a face image with a predetermined resolution;

[0159] A training module 340 is used to input the face image of the predetermined resolution as a training data set into a predetermined neural network model for training to obtain a trained directional image super-resolution neural network model;

[0160] The poster generation control module 350 is used to obtain historical material pictures containing designated actors for which posters need to be generated, input the historical material pictures containing designated actors for which posters need to be generated into the trained directional image super-resolution neural network model for processing, and output a high-definition image poster of the designated actor, as described above.

[0161] Based on the above embodiments, the present invention further provides an intelligent terminal, whose principle block diagram can be shown as follows: Figure 4As shown. The intelligent terminal is a server, including a processor, a memory, a network interface, a display screen, and a database connected through a system bus. Among them, the processor of the intelligent terminal is used to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the intelligent terminal is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for super-resolution and directional processing of poster faces is implemented. The database of the intelligent terminal is used to store a program for super-resolution and directional processing of poster faces.

[0162] Those skilled in the art will understand that Figure 4 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the smart terminal to which the scheme of the present invention is applied. The specific smart terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0163] In one embodiment, a smart terminal is provided, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include instructions for performing the following operations:

[0164] Collecting and obtaining a predetermined number of high-definition material pictures of actors, wherein the resolution of the high-definition material pictures is greater than a preset resolution value and the faces are clear;

[0165] Performing face recognition and face positioning on the collected high-definition material pictures of a predetermined number of actors to obtain face images based on the recognition results;

[0166] Based on the face image of the recognition result, cropping the face image, aligning the cropped face image to a preset standard position or shape, and outputting it as a face image of a predetermined resolution;

[0167] The face image of the predetermined resolution is used as a training data set, and input into a predetermined neural network model for training to obtain a trained directional image super-resolution neural network model;

[0168] Obtain historical material pictures containing designated actors for which posters need to be generated, input the historical material pictures containing designated actors for which posters need to be generated into the trained directional image super-resolution neural network model for processing, and output a high-definition image poster containing the designated actors.

[0169] The step of collecting and obtaining a predetermined number of high-definition material pictures of actors, wherein the resolution of the high-definition material pictures is greater than a preset resolution value and the faces are clear, comprises:

[0170] Collect and obtain historical posters, perform data cleaning on the collected historical posters, obtain high-definition material pictures of a predetermined number of actors, and process them to a resolution of 1024*1024 or above, with clear faces of the actors;

[0171] Image data containing certain designated actor portraits are captured from previously broadcasted television and / or movie videos, and data cleaning is performed on the captured image data containing certain designated actor portraits to obtain high-definition material images of a predetermined number of actors, which are processed to a resolution of 1024*1024 or above, with clear faces of the actors.

[0172] The step of performing face recognition and face positioning on the collected high-definition material pictures of a predetermined number of actors to obtain a face image based on the recognition result includes:

[0173] Use the face recognition algorithm in computer vision technology to analyze and identify each high-definition material image, detect the face area in the image, and select the face with a specified mark or frame;

[0174] Based on the results of face recognition, the identified face area is positioned, including adjusting the position, size and angle of the face to ensure that each actor's face is fully presented;

[0175] Based on recognition and positioning, the face area in each high-definition material picture is extracted to generate an independent face image;

[0176] The facial data of each actor is labeled, including adding labels, metadata, or related information about the associated actor to each facial image.

[0177] The steps of cropping the facial image based on the recognition result, aligning the cropped facial image to a preset standard position or shape, and outputting the facial image as a predetermined resolution include:

[0178] According to the face recognition results, the facial area of ​​each actor is determined and the face image is cut out;

[0179] Align the cropped face images to a preset standard position or shape, including adjusting the position, size, and angle of the face, so that all face images are consistent in style and size;

[0180] The aligned face image is scaled and output as a face image with a predetermined resolution.

[0181] The step of taking the face image of the predetermined resolution as a training data set and inputting it into a predetermined neural network model for training to obtain a trained directional image super-resolution neural network model comprises:

[0182] Select the corresponding neural network model;

[0183] A plurality of face images of predetermined resolutions are obtained as training data sets and input into a predetermined neural network model for training. During training, the neural network model gradually adjusts its internal parameters and weights to adjust the gap between the generated image and the real high-resolution image, thereby obtaining a trained directional image super-resolution neural network model.

[0184] The steps of obtaining a historical material picture containing a designated actor for which a poster needs to be generated, inputting the historical material picture containing a designated actor for which a poster needs to be generated into the trained directional image super-resolution neural network model for processing, and outputting a poster containing a high-definition image of the designated actor include:

[0185] Get the historical material pictures containing the specified actors for which the poster needs to be generated, wherein the historical material pictures can be historical material pictures of TV and movies from a long time ago

[0186] The collected historical material pictures are used as input and input into the trained directional image super-resolution neural network model for processing, so as to convert the low-resolution historical material pictures into high-definition images;

[0187] Control the trained directional image super-resolution neural network model to output the converted high-definition image.

[0188] The step of collecting and obtaining a predetermined number of high-definition material pictures of actors includes:

[0189] Data cleaning and collection of high-definition material images of a specified number of celebrity actors are performed as described above.

[0190] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0191] In summary, the present invention provides a method, device, intelligent terminal and storage medium based on poster face super-resolution directional processing. The present invention can realize super-resolution processing of posters of old movies and TV shows, and use AI technology to generate ultra-clear posters so that these high-quality TV series can be better recommended.

Claims

1. A poster-based face super-resolution directional processing method, characterized in that: include: Collecting and obtaining a predetermined number of high-definition material pictures of actors, wherein the resolution of the high-definition material pictures is greater than a preset resolution value and the faces are clear; Performing face recognition and face positioning on the collected high-definition material pictures of a predetermined number of actors to obtain face images based on the recognition results; Based on the facial image of the recognition result, cropping the facial image, aligning the cropped facial image to a preset standard position or shape, and outputting it as a facial image of a predetermined resolution; The face image of the predetermined resolution is used as a training data set, and input into a predetermined neural network model for training to obtain a trained directional image super-resolution neural network model; Obtain historical material pictures containing designated actors for which posters need to be generated, input the historical material pictures containing designated actors for which posters need to be generated into the trained directional image super-resolution neural network model for processing, and output a high-definition image poster containing the designated actors.

2. The method for super-resolution orientation processing of poster faces according to claim 1, characterized in that: The step of collecting and obtaining a predetermined number of high-definition material pictures of actors, wherein the resolution of the high-definition material pictures is greater than a preset resolution value and the faces are clear, comprises: Collect and obtain historical posters, perform data cleaning on the collected historical posters, obtain high-definition material pictures of a predetermined number of actors, and process them to a resolution of 1024*1024 or above, with clear faces of the actors; Image data containing certain designated actor portraits are captured from previously broadcasted television and / or movie videos, and data cleaning is performed on the captured image data containing certain designated actor portraits to obtain high-definition material images of a predetermined number of actors, which are processed to a resolution of 1024*1024 or above, with clear faces of the actors.

3. The method for super-resolution directional processing of poster faces according to claim 1, characterized in that: The step of performing face recognition and face positioning on the collected high-definition material pictures of a predetermined number of actors to obtain a face image based on the recognition result comprises: Use the face recognition algorithm in computer vision technology to analyze and identify each high-definition material image, detect the face area in the image, and select the face with a specified mark or frame; Based on the results of face recognition, the identified face area is positioned, including adjusting the position, size and angle of the face to ensure that each actor's face is fully presented; Based on recognition and positioning, the face area in each high-definition material picture is extracted to generate an independent face image; The facial data of each actor is labeled, including adding labels, metadata, or related information about the associated actor to each facial image.

4. The method for super-resolution directional processing of poster faces according to claim 1, characterized in that: The steps of cropping the facial image based on the recognition result, aligning the cropped facial image to a preset standard position or shape, and outputting the facial image as a facial image with a predetermined resolution include: According to the face recognition results, the facial area of ​​each actor is determined and the face image is cut out; Align the cropped face images to a preset standard position or shape, including adjusting the position, size, and angle of the face, so that all face images are consistent in style and size; The aligned face image is scaled and output as a face image with a predetermined resolution.

5. The method for super-resolution orientation processing of poster faces according to claim 1, characterized in that: The step of taking the face image of the predetermined resolution as a training data set and inputting it into a predetermined neural network model for training to obtain a trained directional image super-resolution neural network model comprises: Select the corresponding neural network model; A plurality of face images of predetermined resolutions are obtained as training data sets and input into a predetermined neural network model for training. During training, the neural network model gradually adjusts its internal parameters and weights to adjust the gap between the generated image and the real high-resolution image, thereby obtaining a trained directional image super-resolution neural network model.

6. The method for super-resolution orientation processing of poster faces according to claim 1, characterized in that: The steps of obtaining a historical material picture containing a designated actor for which a poster needs to be generated, inputting the historical material picture containing a designated actor for which a poster needs to be generated into the trained directional image super-resolution neural network model for processing, and outputting a high-definition image poster containing the designated actor include: Obtaining historical material pictures containing designated actors for which posters need to be generated, wherein the historical material pictures may be historical material pictures of television or movies from a relatively long period of time; The collected historical material pictures are used as input and input into the trained directional image super-resolution neural network model for processing, so as to convert the low-resolution historical material pictures into high-definition images; Control the trained directional image super-resolution neural network model to output the converted high-definition image.

7. The method for super-resolution orientation processing of poster faces according to claim 1, characterized in that: The step of collecting and obtaining a predetermined number of high-definition material pictures of actors comprises: Data cleaning and collection of high-definition stock images of a specified number of celebrity actors.

8. A poster-based face super-resolution directional processing device, characterized in that: The device comprises: A collection and acquisition module, used to collect and acquire a predetermined number of high-definition material pictures of actors, wherein the resolution of the high-definition material pictures is greater than a preset resolution value and the faces are clear; A face recognition and positioning module is used to perform face recognition and face positioning on the collected high-definition material pictures of a predetermined number of actors to obtain a face image based on the recognition result; An image cropping module is used to crop the face image based on the face image of the recognition result, align the cropped face image to a preset standard position or shape, and output it as a face image of a predetermined resolution; A training module, used to input the face image of the predetermined resolution as a training data set into a predetermined neural network model for training, so as to obtain a trained directional image super-resolution neural network model; The poster generation control module is used to obtain historical material pictures containing designated actors for which posters need to be generated, input the historical material pictures containing designated actors for which posters need to be generated into the trained directional image super-resolution neural network model for processing, and output a high-definition image poster including the designated actors.

9. An intelligent terminal, characterized in that: The device comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include being used to execute the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Face image super-resolution reconstruction method based on an attribute description generative adversarial network

    CN109615582A

  • Human face image super-resolution method based on attention mechanism

    CN111080513A

  • Film and television poster automatic generation method and system based on deep learning

    CN113010711A

  • Poster generation model training method, poster generation method and related equipment

    CN115049043A

  • Model training and image processing method and device, equipment and storage medium

    CN116152631A

Cited By

  • Data acquisition method and device, model training method and device, equipment and medium

    CN121095991A