Video generation method and apparatus, computer device, and storage medium
By obtaining the stylized description information of the target image and using the style model to generate multiple stylized images, it solves the problem of cumbersome and slow speeds in the existing technologies, and achieves the effect of quickly generating a variety of style videos.
Patent Information
- Application Number
- PCT/CN2024/107749
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-26
- Filing Date
- 2024-07-26
- Publication Date
- 2025-01-30
AI Technical Summary
When generating stylized videos, the prior art requires first shooting the video and then stylized it piece by piece. The process is cumbersome and slow, making it difficult to generate videos containing multiple styles.
By obtaining the target image and determining the corresponding multiple style description information, the image is processed based on these description information and style models, generated multiple stylized images, and then stitched into stylized videos.
A videos that directly describe the information based on the style of the target image generate a variety of styles, simplify the operation process and improve the generation speed.
Smart Images

Figure CN2024107749_30012025_PF_FP_ABST
Abstract
Description
Video generation method, device, computer equipment and storage medium
[0001] This application claims priority to Chinese patent application No. 202310927044.8 filed on July 26, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field
[0002] The present disclosure relates to a video generation method, apparatus, computer equipment, and storage medium. Background Art
[0003] Currently, stylized videos are typically generated by first shooting a video and then applying stylization to it. For example, a pre-trained neural network can be used to stylize the video. However, this method only generates videos with a single style. To generate videos with multiple styles, you need to first edit the video, then apply stylization to each edited segment using different neural networks, and then stitch the stylized segments together. This method is relatively cumbersome and slows down video generation.
[0004] Summary of the Invention
[0005] The embodiments of the present disclosure at least provide a video generation method, apparatus, computer equipment, and storage medium.
[0006] In a first aspect, an embodiment of the present disclosure provides a video generation method, comprising:
[0007] Acquire a target image and determine a plurality of stylized description information corresponding to the target image;
[0008] Based on the stylized description information and the corresponding stylized model, the target image is processed to obtain a plurality of stylized images corresponding to the stylized description information;
[0009] Based on the stylized image, a stylized video corresponding to the target image is generated.
[0010] In a second aspect, an embodiment of the present disclosure further provides a video generation device, including:
[0011] An acquisition module, configured to acquire a target image and determine a plurality of stylized description information corresponding to the target image;
[0012] a processing module, configured to process the target image based on the stylized description information and a corresponding stylized model to obtain a plurality of stylized images corresponding to the stylized description information;
[0013] A generation module is configured to generate a stylized video corresponding to the target image based on the stylized image.
[0014] In a third aspect, an embodiment of the present disclosure further provides a computer device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are performed.
[0015] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.
[0016] In the video generation method, apparatus, computer device, and storage medium provided by the embodiments of the present disclosure, after acquiring a target image, multiple stylized images can be directly generated according to the various stylized description information corresponding to the target image, and then a stylized video corresponding to the target image can be generated based on the multiple stylized images.
[0017] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without inventive effort.
[0019] FIG1 shows a flow chart of a video generation method provided by an embodiment of the present disclosure;
[0020] FIG2 shows a flow chart of another video generation method provided by an embodiment of the present disclosure;
[0021] FIG3 shows a schematic diagram of a video generation device provided by an embodiment of the present disclosure;
[0022] FIG4 shows a schematic structural diagram of a computer device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the disclosure for which protection is sought, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present disclosure.
[0024] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0025] The term "and / or" herein simply describes an association relationship, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, and the existence of B alone. In addition, the term "at least one" herein refers to any combination of at least two of any one or more of a plurality of items. For example, "at least one of A, B, and C" can represent any one or more elements selected from the set consisting of A, B, and C.
[0026] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0027] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0028] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0029] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0030] To facilitate understanding of this embodiment, a video generation method disclosed in an embodiment of the present disclosure is first introduced in detail. The execution subject of the video generation method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities. The computer device includes, for example, a terminal device or a server or other processing device. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, an in-vehicle device, a wearable device, etc. In some possible implementations, the video generation method can be implemented by a processor calling computer-readable instructions stored in a memory.
[0031] 1 , which is a flowchart of a video generation method provided by an embodiment of the present disclosure, the method includes steps 101 to 103 .
[0032] Step 101: Acquire a target image and determine multiple stylized description information corresponding to the target image.
[0033] Step 102: Process the target image based on the stylized description information and the corresponding stylized model to obtain multiple stylized images corresponding to the stylized description information.
[0034] Step 103: Generate a stylized video corresponding to the target image based on the stylized image.
[0035] The following is a detailed description of the above steps.
[0036] Regarding step 101:
[0037] The target image may be an image to be stylized, and the target image may be an image captured by a user, or an image uploaded locally by a user, etc. The present disclosure does not limit the method of acquiring the target image.
[0038] The stylized description information is description information of the style into which the target image needs to be processed. For example, the stylized description information may include cartoon style, stick figure style, oil painting style, etc.
[0039] In a possible implementation, the stylized description information corresponding to each image may be pre-set, and the stylized description information corresponding to each image is the same.
[0040] For example, fixed N types of stylized description information may be preset, and no matter which target image is received, the received target image may be processed according to the preset N types of stylized description information.
[0041] In another possible implementation, different users may have different stylization requirements, so the user can set stylization description information. When determining multiple stylization description information corresponding to the target image, the multiple stylization description information corresponding to the target image input by the user can be received.
[0042] Optionally, the user may input the multiple stylized description information simultaneously when uploading the target image, or may upload the stylized description information after uploading the target image.
[0043] However, since users may have different levels of understanding of various styles, if we rely entirely on users to input stylized description information, the final stylized video may not necessarily meet the user's needs. Therefore, we can also combine image features to match the most appropriate stylized description information for the target image.
[0044] Specifically, when determining the multiple stylized description information corresponding to the target image, the image features of the target image may be extracted first, and then the multiple stylized description information matching the target image features may be determined.
[0045] Here, the image features of the target image may be extracted, for example, by using a feature extraction network. When determining multiple stylized description information that matches the image features, semantic features of each preset stylized description information may be extracted, and then feature similarities between the image features of the target image and the semantic features of each preset stylized description information may be calculated. The stylized description information whose feature similarity satisfies a preset condition is then used as the stylized description information corresponding to the target image.
[0046] The similarity satisfies a preset condition, which may exemplarily mean that the similarity exceeds a preset similarity threshold, or is ranked in the top K positions after the similarities are sorted in descending order, where K is a preset positive integer.
[0047] Regarding step 102:
[0048] In one possible implementation, each stylized model may only perform one stylization process. In this implementation, the stylized description information corresponds one-to-one to the stylized model, and the number of stylized description information is the same as the number of stylized models that need to be called.
[0049] In another possible implementation, each stylized model can perform at least one stylized process, and some stylized models can perform multiple stylized processes. In this implementation, the amount of stylized description information is greater than or equal to the number of stylized models that need to be called.
[0050] In the case where the stylization model can perform multiple stylization processes, the same stylization process can be performed by multiple stylization models. For example, if the stylization description information is comic style, stylization model A can perform comic style processing, and stylization model B can also perform comic style processing.
[0051] In this case, when determining the stylized model corresponding to the stylized description information, for any stylized description information, if there are multiple models that perform stylized processing corresponding to the stylized description information, one of the models can be selected as the stylized model corresponding to the stylized description information based on the principle of load balancing.
[0052] In one possible implementation, when the target image is processed using a stylized model corresponding to the stylized description information, N sets of stylized parameters under any type of stylized description information can be determined, where N is a preset positive integer. Then, for any set of stylized parameters, the target image can be processed according to the set of stylized parameters using the stylized model corresponding to the stylized description information to obtain a stylized image under the stylized description information.
[0053] The above execution steps can be understood as a loop execution process, that is, the steps of processing the target image are executed in a loop. The stylization parameters applied in each loop process are different. In each loop process, the target image can be processed based on a set of stylization parameters and a stylization model.
[0054] The stylization parameters include stylization degree information and / or noise information; wherein the noise information is used to increase the difference between the multiple stylized images under the same stylization description information.
[0055] The stylization degree information is used to indicate the intensity of stylization processing. For example, the stylization degree information of complete stylization is 100%, and the stylization degree information of no stylization processing is 0.
[0056] The noise information may exemplarily be noise used to adjust hue, brightness, saturation, contrast, etc. for processing the target image, or may be Gaussian noise added to the intermediate processed feature image when the stylized model processes the target image.
[0057] For example, taking N as 10, if the stylized description information includes style A and style B, then for style A, the target image can be processed according to the various sets of stylized parameters under style A using the stylized model corresponding to style A to obtain 10 stylized images under style A; for style B, the target image can also be processed according to the various sets of stylized parameters under style B using the stylized model corresponding to style B to obtain 10 stylized images under style B.
[0058] When generating a stylized image, the target image, the stylization parameters, and the stylization description information (here, the stylization description information can serve as prompt information) can be input into a stylization model, and the stylization model can output a corresponding stylized image.
[0059] It should be noted here that if there are multiple stylized models corresponding to the multiple stylized description information, the process of stylizing the target image by multiple stylized models can be executed in parallel, so that the stylized image corresponding to the target image can be quickly generated, thereby improving the generation speed of the stylized video.
[0060] Regarding step 103:
[0061] In one possible implementation, when generating a stylized video corresponding to the target image based on the stylized image, multiple stylized images under multiple stylized description information may be randomly arranged to generate a stylized video corresponding to the target image.
[0062] For example, if there are a types of stylized description information and b stylized images under each type of stylized description information, then there are a*b stylized images in total. When generating a stylized video, the a*b stylized images can be directly randomly arranged to obtain the stylized video corresponding to the target image.
[0063] In another possible implementation, since the differences between stylized images under the same stylized description information are relatively small, if the stylized images under the same stylized description information are arranged together, an animation display effect can be formed. Therefore, when generating a stylized video corresponding to the target image based on the stylized image, it is also possible to first determine a first order between the multiple stylized description information; and determine a second order of the multiple stylized images under each stylized description information; and then arrange the multiple stylized images under each stylized description information according to the first order and the second order to obtain the stylized video corresponding to the target image.
[0064] For example, if there are three types of stylized description information, a, b, and c, and there are 10 stylized images under each type of stylized description information, then the first order of the three types of stylized description information can be determined first, for example, a→c→b, and then the second order of the stylized images under each type of stylized description information can be determined, that is, the order 1 of the stylized images a1 to a10, the order 2 of the stylized images b1 to b10, and the order 3 of the stylized images c1 to c10, and then the stylized images a1 to a10 are arranged first according to order 1, then the stylized images c1 to c10 are arranged according to order 3, and then the stylized images b1 to b10 are arranged according to order 2.
[0065] Optionally, since the number of the generated stylized images may be small, in order to improve the frame rate of the stylized video, frame interpolation may be performed based on the generated stylized images.
[0066] Specifically, for any stylized description information, frame interpolation processing can be performed based on multiple stylized images under the stylized description information to determine multiple interpolated frame images, and then a stylized video corresponding to the target image is generated based on the multiple stylized images and the interpolated frame images.
[0067] When performing frame interpolation based on multiple stylized images, a pixel weighting method can be used, for example. If interpolation is performed between stylized image 1 and stylized image 2, the pixel values at each pixel position in stylized image 1 and stylized image 2 can be weighted and summed (the weights can be related to the stylized description information or the image distance between the interpolated frame image to be interpolated and each stylized image). The weighted summation result is then used as the value of the interpolated frame image between stylized image 1 and stylized image 2 at the corresponding pixel position.
[0068] For any two stylized images, Image 1 and Image 2, if multiple video frames need to be interpolated between the two stylized images, the pixel weighting method can be used to interpolate between the two stylized images to obtain interpolated frame image 1. Then, interpolation is performed based on interpolated frame image 1 and Image 1, and based on array image 1 and Image 2... and so on, until the preset number of interpolated frames is reached.
[0069] Here, it should be noted that, when performing the frame interpolation process, the stylized images may be sorted according to the second order, and then the frame interpolation process may be performed between any two stylized images.
[0070] In another possible implementation, after determining a first order among the multiple types of stylized description information; and determining a second order among the multiple stylized images under each type of stylized description information, the multiple stylized images under each type of stylized description information are first arranged according to the first order and the second order to obtain an initial stylized video, and then frame interpolation processing is performed on any two video frames in the initial stylized video to finally obtain a stylized video corresponding to the target image.
[0071] When performing frame interpolation processing, you can first determine the target frame number of the stylized video, then determine the number of interpolation images to be interpolated based on the target frame number of the stylized video and the number of stylized images, and then perform frame interpolation processing according to the number of interpolation images to be interpolated.
[0072] The target frame number of the stylized video may be preset, or the target frame number of the stylized video may be determined according to device parameters.
[0073] In a possible scenario, the step of generating a stylized image may be performed by a server. After generating the stylized image, the server may send the stylized image to a user terminal, and the user terminal may generate a stylized video offline based on the stylized image.
[0074] Therefore, in this scenario, due to the different performance of devices on different user ends, if stylized videos are generated according to a unified frame rate standard, the performance of some devices may be insufficient, resulting in some devices taking too long to process the frames, and the speed of generating stylized videos may be slow.
[0075] Therefore, for different user terminals, different target frame numbers can be set in combination with different device performance parameters. The device performance parameters may include, for example, the utilization rate of the central processing unit.
[0076] Alternatively, in another possible implementation, different stylized description information may have different frame number requirements, and therefore, the target frame number of the stylized video may be determined according to the stylized description information.
[0077] Specifically, videos of different styles may require stylized images with different frame rates to represent them. For example, for a comic style, more frame rates of stylized images may be required to generate a stylized video, so that the generated stylized video can be more vivid; while for a stick figure style, fewer frame rates of stylized images may be required to generate a stylized video, so that the generated stylized video can be more concise.
[0078] When determining the target number of frames of the stylized video, the target number of frames of the stylized video may be determined based on the preset number of frames corresponding to various stylized description information and the various stylized description information obtained in step 101 .
[0079] Correspondingly, when performing frame interpolation processing, the number of interpolation frames required for each stylized description information can be determined based on the pre-set number of frames corresponding to each stylized description information and the number of stylized images under each stylized description information, and then the frame interpolation processing can be performed according to the number of interpolation frames.
[0080] The above-mentioned frame interpolation processing is not limited to interpolation between stylized images with the same stylized description information, but can also include interpolation between stylized images with different stylized description information. The above-mentioned frame interpolation processing method is merely an example, and the present disclosure is also applicable to other frame interpolation processing methods and is not limited here.
[0081] By performing frame interpolation processing, the number of frames of the stylized video can be increased, the smoothness of the stylized video can be ensured, and the display effect of the stylized video can be improved.
[0082] In an optional scenario, the above method can also be used to generate stylized videos based on videos. Referring to FIG2 , another video generation method provided by the embodiment of the present disclosure includes the following steps:
[0083] Step 201: Obtain the video to be processed.
[0084] Step 202: Extract frames from the video to be processed to obtain multiple target images.
[0085] Step 203: For any target image, based on the video generation method described in the above embodiment, generate multiple stylized images with multiple stylized description information corresponding to the target image.
[0086] Step 204: Generate a stylized video corresponding to the video to be processed based on the multiple stylized images under the multiple stylized description information corresponding to each target image.
[0087] Optionally, when generating a stylized video corresponding to the video to be processed based on multiple stylized images under multiple stylized description information corresponding to each target image, the third order of each target image in the video to be processed can be determined first, and then the stylized video corresponding to the video to be processed can be generated based on the stylized videos corresponding to each target image and the third order.
[0088] Specifically, a stylized video corresponding to each target image can be generated based on multiple stylized images under multiple stylized description information corresponding to each target image (refer to the description of the embodiment of Figure 1 for specific steps); then, based on the third order of each target image in the image to be processed, the stylized videos corresponding to each target image are spliced to obtain a stylized video corresponding to the video to be processed.
[0089] In a specific implementation, in order to improve processing efficiency, the same stylization parameters can be used for t adjacent target images when generating stylized images.
[0090] Here, since the target image is obtained by extracting frames from the video to be processed, the video frames that are not extracted from the video to be processed are not processed in this disclosure, and the stylized video finally generated does not include the video frames that are not extracted.
[0091] Therefore, in order to avoid excessive differences between the stylized video and the video to be processed, a higher number of frames can be set when extracting the target image from the video to be processed; alternatively, frame extraction can be performed based on the similarity between video frames in the video to be processed. For video clips with higher video frame similarity, a lower number of frames can be set, while for video clips with lower video frame similarity, a higher number of frames can be set.
[0092] Through this method, the video frames in the video to be processed can be quickly stylized, and the generated stylized video corresponding to the video to be processed contains multiple styles, thereby improving the diversity of the stylized video.
[0093] In the video generation method provided by the disclosed embodiments, after acquiring a target image, multiple stylized images can be directly generated based on the various stylized descriptions corresponding to the target image. Then, based on the multiple stylized images, a stylized video corresponding to the target image can be generated. This method automatically generates stylized videos containing multiple styles by simply determining any target image and its stylized descriptions. This method simplifies the process and speeds up the generation process.
[0094] Those skilled in the art will understand that in the above-mentioned method of the specific implementation method, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0095] Based on the same inventive concept, the embodiment of the present disclosure also provides a video generation device corresponding to the video generation method. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned video generation method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0096] 3 , which is a schematic diagram of the architecture of a video generating device provided by an embodiment of the present disclosure, the device includes: an acquisition module 301 , a processing module 302 , and a generation module 303 .
[0097] An acquisition module 301 is configured to acquire a target image and determine a plurality of stylized description information corresponding to the target image;
[0098] A processing module 302 is configured to process the target image based on the stylized description information and the corresponding stylized model to obtain a plurality of stylized images corresponding to the stylized description information;
[0099] The generating module 303 is configured to generate a stylized video corresponding to the target image based on the stylized image.
[0100] In a possible implementation, the acquisition module 301, when determining the multiple stylized description information corresponding to the target image, is configured to:
[0101] receiving a plurality of stylized description information corresponding to the target image input by a user; or
[0102] Extracting image features of the target image and determining a plurality of stylized description information matching the image features.
[0103] In one possible implementation, for any stylized description information, the processing module 302, when processing the target image based on the stylized description information and the corresponding stylized model to obtain multiple stylized images corresponding to the stylized description information, is configured to:
[0104] Determining the corresponding stylized model based on the stylized description information;
[0105] For a certain stylized description information, determine N sets of stylized parameters; where N is a preset positive integer;
[0106] Based on the stylization parameters, the target image is processed by the corresponding stylization model to obtain a stylized image corresponding to the stylization parameters under the certain stylization description information;
[0107] The above steps of processing the target image are executed cyclically to obtain multiple stylized images under the stylized description information.
[0108] In one possible implementation, when generating a stylized video corresponding to the target image based on the stylized image, the generating module 303 is configured to:
[0109] Determining a first order among the plurality of stylized description information; and determining a second order among the plurality of stylized images associated with each stylized description information;
[0110] Arrange the multiple stylized images under each stylized description information according to the first order and the second order to obtain a stylized video corresponding to the target image.
[0111] In one possible implementation, when generating a stylized video corresponding to the target image based on the stylized image, the generating module 303 is configured to:
[0112] For any stylized description information, performing frame interpolation processing based on multiple stylized images under the stylized description information to determine multiple interpolated frame images;
[0113] A stylized video corresponding to the target image is generated based on the multiple stylized images and the interpolated frame image.
[0114] In a possible implementation, the acquisition module 301, when acquiring the target image, is configured to:
[0115] Acquire a video to be processed, and extract frames from the video to be processed to obtain the target image;
[0116] The generating module 303 is further configured to:
[0117] Determining a third order of each target image in the video to be processed;
[0118] Based on the stylized videos corresponding to the target images and the third order, a stylized video corresponding to the video to be processed is generated.
[0119] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference can be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0120] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Referring to Figure 4, there is a schematic diagram of the structure of the computer device 400 provided in the embodiment of the present disclosure. The computer device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc., or various forms of servers, such as independent servers or server clusters. The computer device shown in Figure 4 is only an example and should not bring any limitations to the functions and scope of use of the embodiment of the present disclosure.
[0121] As shown in FIG4 , a computer device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory device (ROM) 402 or a program loaded from a storage device 408 into a random access memory device (RAM) 403. Various programs and data required for the operation of the computer device 400 are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0122] Typically, the following devices may be connected to I / O interface 405: input device 406 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output device 407 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage device 408 including, for example, a magnetic tape, hard disk, etc.; and communication device 409. Communication device 409 may allow computer device 400 to communicate with other devices wirelessly or by wire to exchange data. Although FIG4 illustrates computer device 400 with various devices, it should be understood that not all of the illustrated devices are required to be implemented or present. More or fewer devices may alternatively be implemented or present.
[0123] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing a word recommendation method. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device 409, or installed from a storage device 408, or installed from a ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0124] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program executes the steps of the video generation method described in the above method embodiment. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0125] The embodiments of the present disclosure also provide a computer program product, which carries program code. The instructions included in the program code can be used to execute the steps of the video generation method described in the above method embodiment. For details, please refer to the above method embodiment and will not be repeated here.
[0126] The computer program product may be implemented in hardware, software, or a combination thereof. In one embodiment, the computer program product is implemented as a computer storage medium. In another embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0127] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0128] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0129] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0130] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0131] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The scope of protection of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure shall be subject to the scope of protection of the claims.
Claims
1. A video generation method, comprising: Acquire a target image, and determine a plurality of stylized description information corresponding to the target image; Based on the stylized description information and the corresponding stylized model, the target image is processed to obtain a plurality of stylized images under the stylized description information; as well as Based on the stylized image, a stylized video corresponding to the target image is generated.
2. The method according to claim 1, wherein: The determining of a plurality of stylized description information corresponding to the target image includes: receiving a plurality of stylized description information corresponding to the target image input by a user; or, The image features of the target image are extracted, and a plurality of stylized description information matching the image features is determined.
3. The method according to claim 1 or 2, wherein: The step of processing the target image based on the stylized description information and the corresponding stylized model to obtain a plurality of stylized images under the stylized description information includes: Determine the corresponding stylized model based on the stylized description information; For a certain stylized description information, determine N groups of stylized parameters, where N is a preset positive integer; Based on the stylization parameters, the target image is processed by the corresponding stylization model to obtain a stylized image corresponding to the stylization parameters under the certain stylization description information; and The above steps of processing the target image are executed repeatedly to obtain multiple stylized images under the stylized description information.
4. The method according to claim 3, wherein: The stylization parameters include stylization degree information and / or noise information; The noise information is used to increase the difference between the multiple stylized images under the same stylized description information.
5. The method according to any one of claims 1 to 4, wherein: The step of generating a stylized video corresponding to the target image based on the stylized image includes: Determining a first order between the plurality of stylized description information; Determining a second order of the plurality of stylized images under each stylized description information; and Arrange the multiple stylized images under each stylized description information according to the first order and the second order to obtain a stylized video corresponding to the target image.
6. The method according to claim 1 or 5, wherein: The step of generating a stylized video corresponding to the target image based on the stylized image includes: For any stylized description information, performing frame interpolation processing based on multiple stylized images under the stylized description information to determine multiple interpolated frame images; and Based on the multiple stylized images and the interpolated frame images, a stylized video corresponding to the target image is generated.
7. The method according to any one of claims 1 to 6, wherein: The acquiring of the target image comprises: Acquire a video to be processed, and extract frames from the video to be processed to obtain the target image; The method further comprises: Determining a third order of each target image in the video to be processed; and Based on the stylized videos corresponding to the target images and the third order, a stylized video corresponding to the video to be processed is generated.
8. A video generating device, comprising: An acquisition module, used to acquire a target image and determine a plurality of stylized description information corresponding to the target image; A processing module, configured to process the target image based on the stylized description information and a corresponding stylized model to obtain a plurality of stylized images under the stylized description information; as well as A generating module is used to generate a stylized video corresponding to the target image based on the stylized image.
9. A computer device comprising: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the video generation method according to any one of claims 1 to 7 are performed.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, performs the steps of the video generation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Model training method and device, image stylization method and device, electronic equipment and storage medium
CN114511441A
Image processing method and device, electronic equipment and storage medium
CN114926326A
Method, system, and computer-readable medium for stylizing video frames
US20220092728A1