Method and device for intelligently generating video cover, equipment and storage medium
By extracting video elements and using generative adversarial networks for style migration and feature matching, the problem of lack of attractiveness and representation of covers in traditional video cover generation methods is solved, and efficient and personalized video cover generation is achieved, improving user experience.
Patent Information
- Application Number
- CN202411181547.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-12-13
AI Technical Summary
Traditional video cover generation methods cannot accurately capture the core content of the video, resulting in a lack of attractiveness and representation of the cover, and user editing and generating covers is time-consuming and labor-intensive, and not personalized enough.
By obtaining video features, extracting the overall visual style characteristics of the video, using a generative adversarial network to transfer the preset cover templates, and matching the features to generate a personalized video cover.
It realizes more accurately capturing the core content of the video and generating attractive and representative covers, reducing user editing time, providing a personalized and beautiful cover generation method, and improving the quality and user experience of the video cover.
Smart Images

Figure CN119136012A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence technology, and specifically relates to a method, device, equipment and storage medium for intelligently generating video covers. Background Art
[0002] In the current digital age, video has become a widely used and shared media form. However, an attractive video cover is crucial to attracting the audience's attention. Traditional methods of generating video covers include capturing key frames and using fixed templates to display video titles, but these methods have some defects. Therefore, a solution for intelligently generating video covers based on video elements and poster templates has emerged.
[0003] The traditional method of capturing keyframes often fails to accurately capture the core content of the video, resulting in the generated cover being unattractive and unrepresentative. The method of using fixed templates to display video titles lacks personalization and aesthetics, and cannot meet the needs of different video content and styles. In addition, the method of allowing users to edit and generate covers is time-consuming and labor-intensive, and is not user-friendly for users who are not familiar with design software. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose a method, device, computer equipment and storage medium for intelligently generating video covers, so as to solve the technical problems that the existing video cover production methods are time-consuming and labor-intensive, and the generated covers lack attractiveness and representativeness.
[0005] In order to solve the above technical problems, the embodiment of the present application provides a method for intelligently generating video covers, which adopts the following technical solutions:
[0006] A method for intelligently generating a video cover, comprising:
[0007] Obtain a target video for which a video cover is to be generated, and extract video elements of the target video;
[0008] Describe the style of the target video based on the video elements to obtain the overall visual style characteristics of the target video;
[0009] Get the preset initial cover template, perform style transfer on the initial cover template based on the overall visual style features, and use the pre-trained generative adversarial network to generate the target cover template;
[0010] Obtaining the cover elements of the target cover template, and performing element matching between the video elements and the cover elements;
[0011] Fill the video elements into the target cover template according to the element matching results to obtain the video cover corresponding to the target video.
[0012] Furthermore, the video elements include text elements, visual elements and screen layout elements. The steps of obtaining a target video for which a video cover is to be generated and extracting the video elements of the target video specifically include:
[0013] Use natural language processing technology to extract text features of the target video to obtain text elements of the target video;
[0014] Extract the key frames of the video based on the pre-trained convolutional neural network to obtain the key frames of the target video;
[0015] Use the target detection algorithm to identify the key frames of the target video and obtain the screen layout elements of the target video;
[0016] A pre-trained recurrent neural network is used to extract the visual features of the key frames, and a clustering algorithm is used to cluster the visual features to obtain the visual elements of the target video.
[0017] Furthermore, the step of describing the style of the target video based on the video elements to obtain the overall visual style features of the target video specifically includes:
[0018] Vectorizing the text elements, visual elements and screen layout elements respectively to obtain element vector combinations;
[0019] Perform clustering operations on the element vector combinations to obtain initial style features;
[0020] The initial style features are reduced in dimension to obtain the overall visual style features of the target video.
[0021] Further, the steps of obtaining a preset initial cover template, performing style transfer on the initial cover template based on the overall visual style features, and using a pre-trained generative adversarial network to generate a target cover template specifically include:
[0022] Initialize the parameters of the initial cover template;
[0023] The parameters of the initial cover template are updated using the image style transfer technology based on the overall visual style features of the target video to obtain a new cover template.
[0024] Use the adversarial network to perform adversarial training on the new cover template until the cover template output by the generated adversarial network fully learns the overall visual style characteristics of the target video, and outputs the target cover template.
[0025] Furthermore, the steps of updating the parameters of the initial cover template using the image style transfer technology based on the overall visual style features of the target video to obtain a new cover template specifically include:
[0026] Load the pre-trained style transfer model;
[0027] Transfer learning of the overall visual style features of the target video based on the pre-trained style transfer model;
[0028] During the transfer learning process, the parameters of the initial cover template are updated using a preset optimizer until the output cover template contains the overall visual style features of the target video, thereby obtaining a new cover template.
[0029] Further, the adversarial network is used to perform adversarial training on the new cover template until the cover template output by the adversarial network is fully learned to have the overall visual style characteristics of the target video, and the step of outputting the target cover template specifically includes:
[0030] Obtain a pre-trained dataset, where the dataset is a collection of cover images of various styles and themes;
[0031] Define the generator and discriminator of the generative adversarial network, and define the loss function of the generative adversarial network;
[0032] Initialize the generative adversarial network and use the dataset to iteratively train the initialized generative adversarial network;
[0033] Generate the predicted cover image corresponding to the dataset through the generator;
[0034] The predicted cover image is compared one by one with the cover image set corresponding to the dataset through the discriminator;
[0035] The loss function is used to calculate the loss value of the output result of the generative adversarial network, and the parameters of the generative adversarial network are optimized according to the loss value until the loss value of the generative adversarial network is less than the preset threshold position, thereby obtaining a pre-trained generative adversarial network;
[0036] The overall visual style features of the target video are imported into the pre-trained generative adversarial network, and the target cover template is output.
[0037] Furthermore, the step of obtaining the cover element of the target cover template and matching the video element with the cover element specifically includes:
[0038] Use text similarity algorithm to match text elements of video elements and cover elements;
[0039] Use the cosine similarity algorithm to match the visual elements of the video elements and the cover elements;
[0040] A layout optimization algorithm is used to match the layout elements of the video elements and the cover elements.
[0041] In order to solve the above technical problems, the embodiment of the present application further provides a device for intelligently generating video cover, which adopts the following technical solution:
[0042] A device for intelligently generating a video cover, comprising:
[0043] An element extraction module is used to obtain a target video for generating a video cover and extract video elements of the target video;
[0044] A style description module is used to describe the style of the target video based on video elements to obtain the overall visual style characteristics of the target video;
[0045] The template updating module is used to obtain a preset initial cover template, perform style transfer on the initial cover template based on the overall visual style features, and generate a target cover template using a pre-trained generative adversarial network;
[0046] An element matching module, used to obtain the cover elements of the target cover template and perform element matching between the video elements and the cover elements;
[0047] The cover generation module is used to fill the video elements into the target cover template according to the element matching results to obtain the video cover corresponding to the target video.
[0048] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0049] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the method for intelligently generating a video cover as described in any one of the above items are implemented.
[0050] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0051] A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by a processor, implement the steps of the method for intelligently generating a video cover as described in any one of the above.
[0052] The present application discloses a method, device, equipment and storage medium for intelligently generating video covers, which belongs to the field of artificial intelligence technology. Compared with the traditional method, the intelligent generation of video covers of the present application has the following improvements and innovations: first, by analyzing the video elements, it can more accurately capture the core content of the video and generate an attractive and representative cover; second, by using the video elements to update the preset initial cover template, it can generate personalized cover templates according to different video elements, providing more diversity and beauty; finally, the video elements are filled into the cover template to form a personalized video cover. The intelligently generated cover reduces the time and labor of user editing, and provides an efficient and automated cover generation method.
[0053] In summary, the intelligent generation of video cover based on video elements and cover templates provides an improved and innovative solution, which can address the defects of traditional methods, improve the quality and attractiveness of video covers, and also improve the user experience and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0055] Figure 1 An exemplary system architecture diagram is shown in which the present application can be applied;
[0056] Figure 2 A flowchart of an embodiment of a method for intelligently generating a video cover according to the present application is shown;
[0057] Figure 3 A schematic structural diagram of an embodiment of a device for intelligently generating video cover according to the present application is shown;
[0058] Figure 4 A schematic structural diagram of an embodiment of a computer device according to the present application is shown. DETAILED DESCRIPTION
[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0060] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0061] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0062] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0063] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0064] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers and desktop computers, etc.
[0065] Server 105 can be a server that provides various services, such as a background server that provides support for pages displayed on terminal devices 101, 102, and 103. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDNs), and big data and artificial intelligence platforms.
[0066] It should be noted that the method for intelligently generating video cover provided in the embodiment of the present application is generally executed by a server, and accordingly, the device for intelligently generating video cover is generally set in the server.
[0067] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0068] Continue to refer Figure 2 , showing a flow chart of an embodiment of the method for intelligently generating video covers according to the present application. The present application embodiment can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0069] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0070] The method for intelligently generating a video cover comprises the following steps:
[0071] S201, obtaining a target video for which a video cover is to be generated, and extracting video elements of the target video.
[0072] Specifically, video elements include text elements, visual elements and screen layout elements. Natural language processing technology can be used to extract the text features of the target video to obtain the text elements of the target video; the key frames of the video can be extracted based on a pre-trained convolutional neural network to obtain the key frames of the target video; the target detection algorithm can be used to perform target recognition on the key frames of the target video to obtain the screen layout elements of the target video; the visual features of the key frames can be extracted using a pre-trained recurrent neural network, and the visual features can be clustered using a clustering algorithm to obtain the visual elements of the target video.
[0073] In this step, you first need to obtain the target video for the cover to be generated, and then extract various elements of the video from it. Video elements include but are not limited to text elements (such as titles, subtitles, description text, etc.), visual elements (such as the main image, color and texture features in the video frame), and screen layout elements (such as the main characters and scenes appearing in the video). Text elements can be extracted from the metadata or subtitles of the video through natural language processing (NLP) technology; visual elements can be extracted from video frames through computer vision technology, such as convolutional neural networks (CNN); character scene elements can be used through facial recognition and object detection algorithms (such as Faster R-CNN, YOLO, etc.) to identify the main characters and scenes in the video. After these elements are extracted, they will provide basic data support for the style description and cover template generation in the subsequent steps.
[0074] For example, in an insurance sales video, the text elements extracted through the above steps include keywords such as "insurance" and "security", key frames may include images of sales agents interacting with customers, object detection identifies the main characters and office scenes, and visual features extracted and clustered The visual elements may include different scene colors and character postures. Through these steps, the text, visual, and layout elements of the insurance sales video can be fully obtained.
[0075] S202, describing the style of the target video based on the video elements to obtain the overall visual style features of the target video.
[0076] Specifically, the style description of the target video can be implemented based on a pre-trained style transfer model and based on transfer learning technology. The parameters of the initial cover template are updated using image style transfer technology to match the overall visual style characteristics of the target video to intelligently generate a video cover. The style transfer model can use a style transfer model based on a convolutional neural network (CNN), such as a style transfer model trained based on a neural style transfer algorithm.
[0077] In this step, the overall visual style features of the target video are generated by analyzing the extracted video elements. First, the text features of the target video are extracted using natural language processing technology to obtain the text features of the target video; secondly, the color and texture features of the video frame are extracted through color histogram, texture analysis and other technologies. These features can reflect the visual style of the video; finally, the characters and scenes in the video are analyzed, and the main characters and scene features in the video are obtained through facial recognition and object detection technology. By comprehensively analyzing these elements and using clustering analysis processing technology, a feature vector that describes the overall visual style of the video is generated, which provides a basis for subsequent cover template generation and style transfer.
[0078] S203, obtaining a preset initial cover template, performing style transfer on the initial cover template based on the overall visual style features, and generating a target cover template using a pre-trained generative adversarial network.
[0079] Specifically, in this step, it is first necessary to obtain a preset initial cover template, which is usually designed based on different themes and styles. Next, based on the overall visual style features extracted in step S202, the image style transfer technology is used to transfer the style of the initial cover template. Image style transfer technology (such as the neural style transfer algorithm of Gatys et al.) can apply the visual style features of the video to the initial cover template so that its visual effect is consistent with the target video. For example, if the initial cover template has a red hue and the video has a blue and white hue, the hue of the cover template will also be adjusted to blue and white after style transfer, so that its visual effect is consistent with the video. Afterwards, the pre-trained generative adversarial network (GAN, such as StyleGAN) is used to further optimize the migrated template. GAN can generate high-quality, visually styled cover templates through adversarial training of the generator and the discriminator, ensuring that the final generated cover has both personalized beauty and represents the content and style of the target video.
[0080] S204, obtaining the cover elements of the target cover template, and performing element matching between the video elements and the cover elements.
[0081] Specifically, in this step, various cover elements are first extracted from the target cover template, including text placeholders (such as titles, subtitles, description text, etc.), visual placeholders (such as images and icons, etc.), and layout elements (such as the position, size, alignment of elements, etc.). These cover elements are then matched with the video elements extracted from the target video. Text element matching uses natural language processing technology to calculate the semantic similarity between the text elements of the video and the text placeholders of the cover template, and fill in the most appropriate text. Visual element matching uses computer vision technologies such as convolutional neural networks to feature match and adjust the main images and icons in the video with the visual placeholders of the cover template. Layout element matching uses layout optimization algorithms (such as simulated annealing and genetic algorithms) to adjust the position and size of each element in the cover template so that the final generated cover is visually coordinated and beautiful.
[0082] S205, filling the video elements into the target cover template according to the element matching result, and obtaining the video cover corresponding to the target video.
[0083] Specifically, according to the element matching results in step S204, the video elements are filled into the target cover template to generate the final video cover. First, the matched text elements are filled into the corresponding text placeholders of the cover template to ensure that the text content is consistent with the video theme, and the font, color and size of the text are adjusted to make it consistent with the design style of the cover template. Secondly, the matched visual elements (such as main images and icons) are filled into the corresponding visual placeholders of the cover template, and the image size and position are adjusted using image processing technology to ensure that the visual effect is consistent with the video content and style. Finally, the layout optimization algorithm is applied to fine-tune the overall layout of the cover template to ensure that the arrangement and alignment of each element conform to the aesthetic design principles and to ensure the overall coordination and beauty of the cover. After the above steps, the final generated video cover will be able to accurately reflect the content and style of the video, and have high visual appeal and personalized features.
[0084] In the above embodiments, the intelligent generation of video cover based on video elements and cover templates provides an improved and innovative solution, which can address the defects of traditional methods, improve the quality and attractiveness of video covers, and also improve the user experience and efficiency.
[0085] Furthermore, the video elements include text elements, visual elements and screen layout elements. The steps of obtaining a target video for which a video cover is to be generated and extracting the video elements of the target video specifically include:
[0086] Use natural language processing technology to extract text features of the target video to obtain text elements of the target video;
[0087] Extract the key frames of the video based on the pre-trained convolutional neural network to obtain the key frames of the target video;
[0088] Use the target detection algorithm to identify the key frames of the target video and obtain the screen layout elements of the target video;
[0089] A pre-trained recurrent neural network is used to extract the visual features of the key frames, and a clustering algorithm is used to cluster the visual features to obtain the visual elements of the target video.
[0090] In this embodiment, first, natural language processing technology (such as BERT, GPT) is used to extract text features of the video to generate text elements, such as the title and description of the video. Next, a pre-trained convolutional neural network (CNN, such as ResNet, VGG) is used to extract the key frames of the video, which represent representative and important moments in the video. Then, a target detection algorithm (such as YOLO, Faster R-CNN) is used to identify the key frames and obtain the layout elements of the picture, including the main characters, objects and their position distribution in the picture. Finally, a pre-trained recurrent neural network (RNN, such as LSTM) is used to extract the visual features of the key frames, and these visual features are clustered by a clustering algorithm (such as K-means) to obtain visual elements such as color, texture and style features.
[0091] In the above embodiment, video element extraction is achieved through natural language processing technology, convolutional neural network, target detection algorithm and clustering algorithm, so that video elements that can describe the target video can be obtained, providing a basis for the subsequent generation of a cover template that conforms to the video style and content.
[0092] Furthermore, the step of describing the style of the target video based on the video elements to obtain the overall visual style features of the target video specifically includes:
[0093] Vectorizing the text elements, visual elements and screen layout elements respectively to obtain element vector combinations;
[0094] Perform clustering operations on the element vector combinations to obtain initial style features;
[0095] The initial style features are reduced in dimension to obtain the overall visual style features of the target video.
[0096] In this embodiment, first, the text elements, visual elements and screen layout elements of the video are vectorized and converted into numerical representations. For example, the text elements can be vectorized by the TF-IDF or BERT model, the visual elements can be represented by the feature vectors extracted by the convolutional neural network (CNN), and the screen layout elements can be vectorized by the position and size parameters. Next, these element vectors are combined together to form a comprehensive element vector combination. Then, a clustering algorithm (such as K-means or DBSCAN) is applied to cluster these comprehensive element vectors to generate initial style features. Finally, the initial style features are subjected to dimensionality reduction operations (such as PCA principal component analysis or t-SNE dimensionality reduction) to simplify and refine the features to obtain more representative overall visual style features of the target video.
[0097] In the above embodiments, element vectorization processing, clustering operations, and dimensionality reduction operations can help identify the main visual and content patterns in the video.
[0098] Further, the steps of obtaining a preset initial cover template, performing style transfer on the initial cover template based on the overall visual style features, and generating a target cover template using a pre-trained generative adversarial network specifically include:
[0099] Initialize the parameters of the initial cover template;
[0100] The parameters of the initial cover template are updated using the image style transfer technology based on the overall visual style features of the target video to obtain a new cover template.
[0101] Use the adversarial network to perform adversarial training on the new cover template until the cover template output by the generated adversarial network fully learns the overall visual style characteristics of the target video, and outputs the target cover template.
[0102] In this embodiment, first, the parameters of the preset initial cover template are initialized, and these parameters include the layout, color, font and other design elements of the template. Then, based on the overall visual style characteristics of the target video, the image style transfer technology is used to update the parameters of the initial cover template so that its style gradually approaches the visual characteristics of the target video. The image style transfer technology achieves consistency of visual effects by extracting the style characteristics of the video and applying them to the cover template. Then, the updated cover template is adversarially trained using a pre-trained generative adversarial network (GAN, such as StyleGAN). GAN includes a generator and a discriminator. The generator continuously improves the quality and style consistency of the cover template, and the discriminator evaluates whether the generated template meets the style characteristics of the target video.
[0103] In the above embodiment, the training process continues until the generated cover template completely learns and reflects the visual style characteristics of the target video, and finally outputs a high-quality target cover template.
[0104] Furthermore, the steps of updating the parameters of the initial cover template using the image style transfer technology based on the overall visual style features of the target video to obtain a new cover template specifically include:
[0105] Load the pre-trained style transfer model;
[0106] Transfer learning of the overall visual style features of the target video based on the pre-trained style transfer model;
[0107] During the transfer learning process, the parameters of the initial cover template are updated using a preset optimizer until the output cover template contains the overall visual style features of the target video, thereby obtaining a new cover template.
[0108] In this embodiment, first, a pre-trained style transfer model is loaded. This model is usually trained based on a convolutional neural network (such as VGG) and can capture and transfer the style features of the image. Then, based on the model, the overall visual style features of the target video are transferred and learned. In this step, the model will gradually learn and extract the style features of the video, such as text, color, texture, shape, scene, and characters. Next, in the process of transfer learning, the parameters of the initial cover template are updated using a preset optimizer (such as the Adam optimizer) to adjust the design elements such as text, color, texture, and layout in the template. The optimizer minimizes the style loss function through continuous iteration to ensure that the visual effect of the template gradually approaches the style of the target video. The training process continues until the output cover template can fully reflect the overall visual style features of the target video and obtain a new cover template.
[0109] In the above embodiment, the style transfer model pre-trained by the transfer learning method learns the overall visual style features of the target video, and then outputs a cover template adapted to the target video.
[0110] Further, the adversarial network is used to perform adversarial training on the new cover template until the cover template output by the adversarial network is fully learned to have the overall visual style characteristics of the target video, and the step of outputting the target cover template specifically includes:
[0111] Obtain a pre-trained dataset, where the dataset is a collection of cover images of various styles and themes;
[0112] Define the generator and discriminator of the generative adversarial network, and define the loss function of the generative adversarial network;
[0113] Initialize the generative adversarial network and use the dataset to iteratively train the initialized generative adversarial network;
[0114] Generate the predicted cover image corresponding to the dataset through the generator;
[0115] The predicted cover image is compared one by one with the cover image set corresponding to the dataset through the discriminator;
[0116] The loss function is used to calculate the loss value of the output result of the generative adversarial network, and the parameters of the generative adversarial network are optimized according to the loss value until the loss value of the generative adversarial network is less than the preset threshold position, thereby obtaining a pre-trained generative adversarial network;
[0117] The overall visual style features of the target video are imported into the pre-trained generative adversarial network, and the target cover template is output.
[0118] In this embodiment, first, a pre-trained data set is obtained, which contains a collection of cover images of various styles and themes, and these images will be used as the basis for training GAN. Next, the generator and discriminator of GAN are defined. The generator is responsible for generating a new cover template, while the discriminator is used to evaluate whether the generated template conforms to the target style. The loss function is defined, and a combination of adversarial loss and style loss is usually used to measure the quality and style consistency of the generated template. Then, the generative adversarial network is initialized and iteratively trained using the pre-trained data set. During the training process, the generator generates predicted cover images based on the input data, and the discriminator compares these predicted images with the cover images in the real data set. By calculating the loss value of the output result of the generative adversarial network, the parameters of the generator and the discriminator are optimized using the back propagation algorithm. This process continues until the loss value of the generative adversarial network is less than the preset threshold, indicating that the network has been able to generate high-quality cover templates. Finally, the overall visual style features of the target video are imported into the pre-trained generative adversarial network to generate a cover template that conforms to the style of the target video.
[0119] In the above embodiment, through deep learning technology and generative adversarial network (GAN), automatic, efficient and intelligent cover template generation is achieved. The generated cover template can accurately reflect the overall visual style characteristics of the target video, enhance the attractiveness and representativeness of the cover, and significantly improve the user experience and efficiency.
[0120] Furthermore, the step of obtaining the cover element of the target cover template and matching the video element with the cover element specifically includes:
[0121] Use text similarity algorithm to match text elements of video elements and cover elements;
[0122] Use the cosine similarity algorithm to match the visual elements of the video elements and the cover elements;
[0123] A layout optimization algorithm is used to match the layout elements of the video elements and the cover elements.
[0124] In this embodiment, the video elements and the cover elements are matched by using a text similarity algorithm, a cosine similarity algorithm and a layout optimization algorithm, thereby generating a high-quality cover template.
[0125] First, use a text similarity algorithm (such as TF-IDF or BERT) to match the text in the video elements with the text elements in the cover template to ensure that the text content such as keywords and titles are consistent. For example, the keywords "insurance" and "protection" in an insurance sales video will match the corresponding text in the cover template.
[0126] Then, the cosine similarity algorithm is used to match the visual features in the video elements and the cover elements. Visual features can be extracted through a pre-trained convolutional neural network (such as VGG) and converted into feature vectors, and their cosine similarity is calculated to match the most similar visual elements. For example, the blue background and icons that appear in the video will be matched with similar blue elements in the cover template.
[0127] Finally, use layout optimization algorithms (such as Simulated Annealing or Genetic Algorithm) to optimize the layout of video elements and cover elements to ensure that the layout of the cover template is beautiful and meets the design specifications. For example, the positions of characters and text in the video need to be consistent on the cover to ensure the clarity of visual effects and information communication.
[0128] In the above embodiment, through the combination of multiple algorithms, the video elements and cover elements are effectively matched and optimized to ensure that the generated cover template is highly consistent with the target video in terms of text, vision and layout. The text similarity algorithm ensures that the text on the cover is consistent with the video content, the cosine similarity algorithm matches the visual elements in the video, and the layout optimization algorithm ensures that the positions of the characters, background and text on the cover are reasonable, thereby generating a professional and attractive cover template.
[0129] In the above embodiments, the present application discloses a method for intelligently generating video covers, which belongs to the field of artificial intelligence technology. Compared with the traditional method, the intelligent generation of video covers of the present application has the following improvements and innovations: First, by analyzing the video elements, it can more accurately capture the core content of the video and generate an attractive and representative cover; second, by using the video elements to update the preset initial cover template, a personalized cover template can be generated according to different video elements, providing more diversity and beauty; finally, the video elements are filled into the cover template to form a personalized video cover. The intelligently generated cover reduces the time and labor of user editing, and provides an efficient and automated cover generation method.
[0130] In summary, the intelligent generation of video cover based on video elements and cover templates provides an improved and innovative solution, which can address the defects of traditional methods, improve the quality and attractiveness of video covers, and also improve the user experience and efficiency.
[0131] In this embodiment, the method for intelligently generating a video cover runs on an electronic device (eg, Figure 1 The server shown in the figure) can receive instructions or obtain data through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.
[0132] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned target video, the above-mentioned target video can also be stored in a blockchain node.
[0133] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0134] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0135] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0136] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a device for intelligently generating video cover, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0137] like Figure 3 As shown, the apparatus 300 for intelligently generating a video cover according to this embodiment includes:
[0138] The element extraction module 301 is used to obtain the target video for which the video cover is to be generated, and extract the video elements of the target video;
[0139] A style description module 302 is used to describe the style of the target video based on the video elements to obtain the overall visual style characteristics of the target video;
[0140] The template updating module 303 is used to obtain a preset initial cover template, perform style transfer on the initial cover template based on the overall visual style features, and generate a target cover template using a pre-trained generative adversarial network;
[0141] An element matching module 304 is used to obtain the cover element of the target cover template and perform element matching between the video element and the cover element;
[0142] The cover generation module 305 is used to fill the video elements into the target cover template according to the element matching results to obtain the video cover corresponding to the target video.
[0143] In the above embodiments, the present application discloses a device for intelligently generating video covers, which belongs to the field of artificial intelligence technology. First, by analyzing video elements, the present application can more accurately capture the core content of the video and generate an attractive and representative cover; second, by using video elements to update the preset initial cover template, a personalized cover template can be generated according to different video elements to provide more diversity and beauty; finally, the video elements are filled into the cover template to form a personalized video cover. The intelligently generated cover reduces the time and labor of user editing and provides an efficient and automated cover generation method.
[0144] In summary, the intelligent generation of video cover based on video elements and cover templates provides an improved and innovative solution, which can address the defects of traditional methods, improve the quality and attractiveness of video covers, and also improve the user experience and efficiency.
[0145] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0146] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc.
[0147] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0148] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of a method for intelligently generating video covers, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0149] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the method for intelligently generating video covers.
[0150] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0151] In the above embodiment, the present application discloses a computer device, which belongs to the field of artificial intelligence technology. First, by analyzing video elements, the present application can more accurately capture the core content of the video and generate an attractive and representative cover; second, by using the video elements to update the preset initial cover template, a personalized cover template can be generated according to different video elements to provide more diversity and beauty; finally, the video elements are filled into the cover template to form a personalized video cover. The intelligently generated cover reduces the time and labor of user editing and provides an efficient and automated cover generation method.
[0152] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the method for intelligently generating video covers as described above.
[0153] In the above embodiments, the present application discloses a computer-readable storage medium, which belongs to the field of artificial intelligence technology. First, by analyzing video elements, the present application can more accurately capture the core content of the video and generate an attractive and representative cover; second, by using the video elements to update the preset initial cover template, a personalized cover template can be generated according to different video elements to provide more diversity and beauty; finally, the video elements are filled into the cover template to form a personalized video cover. The intelligently generated cover reduces the time and labor of user editing, and provides an efficient and automated cover generation method.
[0154] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0155] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0156] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A method for intelligently generating a video cover, characterized in that: include: Obtain a target video for which a video cover is to be generated, and extract video elements of the target video; Based on the video elements, the style of the target video is described to obtain the overall visual style features of the target video; Obtain a preset initial cover template, perform style transfer on the initial cover template based on the overall visual style feature, and generate a target cover template using a pre-trained generative adversarial network; Acquire the cover element of the target cover template, and perform element matching between the video element and the cover element; Fill the video elements into the target cover template according to the element matching results to obtain the video cover corresponding to the target video.
2. The method for intelligently generating a video cover according to claim 1, characterized in that: The video elements include text elements, visual elements and screen layout elements. The step of obtaining the target video for generating the video cover and extracting the video elements of the target video specifically includes: Extracting text features of the target video using natural language processing technology to obtain text elements of the target video; Extracting key frames of the video based on a pre-trained convolutional neural network to obtain key frames of the target video; Using a target detection algorithm to perform target recognition on the key frames of the target video to obtain the screen layout elements of the target video; A pre-trained recurrent neural network is used to extract visual features of the key frame, and a clustering algorithm is used to perform clustering operations on the visual features to obtain visual elements of the target video.
3. The method for intelligently generating a video cover according to claim 2, characterized in that: The step of describing the style of the target video based on the video elements to obtain the overall visual style features of the target video specifically includes: Vectorizing the text elements, the visual elements, and the screen layout elements respectively to obtain element vector combinations; Performing clustering operation on the element vector combination to obtain initial style features; A dimensionality reduction operation is performed on the initial style features to obtain the overall visual style features of the target video.
4. The method for intelligently generating a video cover according to claim 1, characterized in that: The steps of obtaining a preset initial cover template, performing style transfer on the initial cover template based on the overall visual style feature, and generating a target cover template using a pre-trained generative adversarial network specifically include: Initializing parameters of the initial cover template; Using the image style transfer technology to update the parameters of the initial cover template based on the overall visual style features of the target video to obtain a new cover template; The new cover template is subjected to adversarial training using an adversarial network until the cover template output by the generative adversarial network fully learns the overall visual style features of the target video, and the target cover template is output.
5. The method for intelligently generating a video cover according to claim 4, characterized in that: The step of updating the parameters of the initial cover template by using the image style transfer technology according to the overall visual style features of the target video to obtain a new cover template specifically includes: Load the pre-trained style transfer model; Performing transfer learning on the overall visual style features of the target video based on the pre-trained style transfer model; In the transfer learning process, the parameters of the initial cover template are updated using a preset optimizer until the output cover template contains the overall visual style features of the target video, thereby obtaining the new cover template.
6. The method for intelligently generating a video cover according to claim 4, characterized in that: The step of using an adversarial network to perform adversarial training on the new cover template until the cover template output by the generative adversarial network completely learns the overall visual style features of the target video and outputting the target cover template specifically includes: Obtain a pre-trained data set, wherein the data set is a collection of cover images of various styles and themes; Defining a generator and a discriminator of the generative adversarial network, and defining a loss function of the generative adversarial network; Initializing the generative adversarial network, and iteratively training the initialized generative adversarial network using the data set; Generate a predicted cover image corresponding to the data set by the generator; Using the discriminator, one-to-one compare the predicted cover image with the set of cover images corresponding to the data set; Using the loss function to calculate the loss value of the output result of the generative adversarial network, and optimizing the parameters of the generative adversarial network according to the loss value, until the loss value of the generative adversarial network is less than a preset threshold position, thereby obtaining a pre-trained generative adversarial network; The overall visual style features of the target video are imported into the pre-trained generative adversarial network, and the target cover template is output.
7. The method for intelligently generating a video cover according to claim 2, characterized in that: The step of obtaining the cover element of the target cover template and performing element matching on the video element and the cover element specifically includes: Perform text element matching on the video element and the cover element using a text similarity algorithm; Performing visual element matching between the video element and the cover element using a cosine similarity algorithm; A layout optimization algorithm is used to perform layout element matching on the video element and the cover element.
8. A device for intelligently generating video cover, characterized in that: include: An element extraction module is used to obtain a target video for which a video cover is to be generated, and extract video elements of the target video; A style description module, used to describe the style of the target video based on the video elements to obtain the overall visual style features of the target video; A template updating module, used to obtain a preset initial cover template, perform style transfer on the initial cover template based on the overall visual style feature, and generate a target cover template using a pre-trained generative adversarial network; An element matching module, used for acquiring the cover element of the target cover template, and performing element matching between the video element and the cover element; The cover generation module is used to fill the video elements into the target cover template according to the element matching results to obtain the video cover corresponding to the target video.
9. A computer device, characterized in that: It comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the method for intelligently generating video covers as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the method for intelligently generating a video cover as described in any one of claims 1 to 7.
Citation Information
Cited By
Automatic poster generation method and system based on deep learning
CN119648866A
Automatic poster generation method and system based on deep learning
CN119648866B
