CN114390366B - Video processing method and device - Google Patents

Video processing method and device Download PDF

Info

Publication number
CN114390366B
CN114390366B CN202210062299.8A CN202210062299A CN114390366B CN 114390366 B CN114390366 B CN 114390366B CN 202210062299 A CN202210062299 A CN 202210062299A CN 114390366 B CN114390366 B CN 114390366B
Authority
CN
China
Prior art keywords
video
processed
tag
frames
description data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210062299.8A
Other languages
Chinese (zh)
Other versions
CN114390366A (en
Inventor
龚震霆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210062299.8A priority Critical patent/CN114390366B/en
Publication of CN114390366A publication Critical patent/CN114390366A/en
Application granted granted Critical
Publication of CN114390366B publication Critical patent/CN114390366B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/84Generation or processing of descriptive data, e.g. content descriptors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream

Abstract

The disclosure provides a video processing method and a video processing device, relates to the field of artificial intelligence, and in particular relates to a computer vision, image recognition and deep learning technical scene. The implementation scheme is as follows: acquiring description data of the video, wherein the description data indicates a category corresponding to the video in a plurality of categories; based on the description data, obtaining a detection result indicating whether the video corresponds to the target classification; responding to the detection result to indicate that the video corresponds to the target classification, and determining the video as a video to be processed; and obtaining the video tag of the video to be processed from a plurality of tags corresponding to the target classification.

Description

Video processing method and device
Technical Field
The present disclosure relates to the field of artificial intelligence, and more particularly to computer vision, image recognition and deep learning technology scenarios, and in particular to a video processing method, apparatus, electronic device, computer readable storage medium and computer program product.
Background
Artificial intelligence is the discipline of studying the process of making a computer mimic certain mental processes and intelligent behaviors (e.g., learning, reasoning, thinking, planning, etc.) of a person, both hardware-level and software-level techniques. The artificial intelligence hardware technology generally comprises technologies such as a sensor, a special artificial intelligence chip, cloud computing, distributed storage, big data processing and the like, and the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, a machine learning/deep learning technology, a big data processing technology, a knowledge graph technology and the like.
Based on the artificial intelligence video processing technology, through understanding the video content, the form and dimension of information contained in the video acquired by the user are enriched, and the density of the information conveyed to the user is improved. In the process of understanding the video content, the image information in the video frames contained in the video is often identified to tag the video, so that a user can search for the video according to the tag of the video, or the server can push the video for the user according to the tag of the video.
The approaches described in this section are not necessarily approaches that have been previously conceived or pursued. Unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, the problems mentioned in this section should not be considered as having been recognized in any prior art unless otherwise indicated.
Disclosure of Invention
The present disclosure provides a video processing method, apparatus, electronic device, computer readable storage medium, and computer program product.
According to an aspect of the present disclosure, there is provided a video processing method including: acquiring description data of a video, wherein the description data indicates a category corresponding to the video in a plurality of categories; based on the description data, obtaining a detection result indicating whether the video corresponds to a target classification; determining the video as a video to be processed in response to the detection result indicating that the video corresponds to the target classification; and obtaining the video tag of the video to be processed from a plurality of tags corresponding to the target classification.
According to another aspect of the present disclosure, there is provided a video processing apparatus acquisition unit configured to acquire description data of a video, the description data indicating a category corresponding to the video among a plurality of categories; a detection unit configured to obtain a detection result indicating whether the video corresponds to a target classification based on the description data; a determining unit configured to determine the video as a video to be processed in response to the detection result indicating that the video corresponds to the target classification; and a processing unit configured to obtain a video tag of the video to be processed from a plurality of tags corresponding to the object classification.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method according to embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method according to an embodiment of the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements a method according to embodiments of the present disclosure.
According to one or more embodiments of the present disclosure, in the process of tagging a video, the data processing amount can be reduced, and the accuracy of tagging the video can be improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The accompanying drawings illustrate exemplary embodiments and, together with the description, serve to explain exemplary implementations of the embodiments. The illustrated embodiments are for exemplary purposes only and do not limit the scope of the claims. Throughout the drawings, identical reference numerals designate similar, but not necessarily identical, elements.
FIG. 1 illustrates a schematic diagram of an exemplary system in which various methods described herein may be implemented, in accordance with an embodiment of the present disclosure;
FIG. 2 shows a flow chart of a video processing method according to an embodiment of the present disclosure;
fig. 3 illustrates a flowchart of a process of acquiring a detection result indicating whether a video corresponds to a target classification in a video processing method according to an embodiment of the present disclosure;
fig. 4 is a flowchart illustrating a process of obtaining a video tag of a video to be processed from a plurality of tags corresponding to a target classification in a video processing method according to an embodiment of the present disclosure;
FIG. 5 illustrates a flow chart of a process by which a video tag of a video to be processed may be obtained in a video processing method according to an embodiment of the present disclosure;
FIG. 6 illustrates a flow chart of a process by which multiple video frames may be extracted from a video to be processed in a video processing method according to an embodiment of the disclosure;
fig. 7 shows a block diagram of a video processing apparatus according to an embodiment of the present disclosure; and
fig. 8 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, the use of the terms "first," "second," and the like to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of the elements, unless otherwise indicated, and such terms are merely used to distinguish one element from another. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, they may also refer to different instances based on the description of the context.
The terminology used in the description of the various illustrated examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, the elements may be one or more if the number of the elements is not specifically limited. Furthermore, the term "and/or" as used in this disclosure encompasses any and all possible combinations of the listed items.
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Fig. 1 illustrates a schematic diagram of an exemplary system 100 in which various methods and apparatus described herein may be implemented, in accordance with an embodiment of the present disclosure. Referring to fig. 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. Client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
In embodiments of the present disclosure, the server 120 may run one or more services or software applications that enable the video processing method to be performed.
In some embodiments, server 120 may also provide other services or software applications that may include non-virtual environments and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, for example, provided to users of client devices 101, 102, 103, 104, 105, and/or 106 under a software as a service (SaaS) model.
In the configuration shown in fig. 1, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or a combination thereof that are executable by one or more processors. A user operating client devices 101, 102, 103, 104, 105, and/or 106 may in turn utilize one or more client applications to interact with server 120 to utilize the services provided by these components. It should be appreciated that a variety of different system configurations are possible, which may differ from system 100. Accordingly, FIG. 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
The user may receive video processed according to the video processing method of the present disclosure using the client devices 101, 102, 103, 104, 105, and/or 106. The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Although fig. 1 depicts only six client devices, those skilled in the art will appreciate that the present disclosure may support any number of client devices.
Client devices 101, 102, 103, 104, 105, and/or 106 may include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, and the like. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, linux, or Linux-like operating systems (e.g., GOOGLE Chrome OS); or include various mobile operating systems such as MICROSOFT Windows Mobile OS, iOS, windows Phone, android. Portable handheld devices may include cellular telephones, smart phones, tablet computers, personal Digital Assistants (PDAs), and the like. Wearable devices may include head mounted displays (such as smart glasses) and other devices. The gaming system may include various handheld gaming devices, internet-enabled gaming devices, and the like. The client device is capable of executing a variety of different applications, such as various Internet-related applications, communication applications (e.g., email applications), short Message Service (SMS) applications, and may use a variety of communication protocols.
Network 110 may be any type of network known to those skilled in the art that may support data communications using any of a number of available protocols, including but not limited to TCP/IP, SNA, IPX, etc. For example only, the one or more networks 110 may be a Local Area Network (LAN), an ethernet-based network, a token ring, a Wide Area Network (WAN), the internet, a virtual network, a Virtual Private Network (VPN), an intranet, an extranet, a Public Switched Telephone Network (PSTN), an infrared network, a wireless network (e.g., bluetooth, WIFI), and/or any combination of these and/or other networks.
The server 120 may include one or more general purpose computers, special purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-end servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and/or combination. The server 120 may include one or more virtual machines running a virtual operating system, or other computing architecture that involves virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain virtual storage devices of the server). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
The computing units in server 120 may run one or more operating systems including any of the operating systems described above as well as any commercially available server operating systems. Server 120 may also run any of a variety of additional server applications and/or middle tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and/or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and/or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
In some implementations, the server 120 may be a server of a distributed system or a server that incorporates a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. The cloud server is a host product in a cloud computing service system, so as to solve the defects of large management difficulty and weak service expansibility in the traditional physical host and virtual private server (VPS, virtual Private Server) service.
The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of databases 130 may be used to store information such as audio files and video files. The data store 130 may reside in a variety of locations. For example, the data store used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The data store 130 may be of different types. In some embodiments, the data store used by server 120 may be a database, such as a relational database. One or more of these databases may store, update, and retrieve the databases and data from the databases in response to the commands.
In some embodiments, one or more of databases 130 may also be used by applications to store application data. The databases used by the application may be different types of databases, such as key value stores, object stores, or conventional stores supported by the file system.
The system 100 of fig. 1 may be configured and operated in various ways to enable application of the various methods and apparatus described in accordance with the present disclosure.
Referring to fig. 2, a video processing method 200 according to some embodiments of the present disclosure includes:
step S210: acquiring description data of a video, wherein the description data indicates a category corresponding to the video in a plurality of categories;
step S220: based on the description data, obtaining a detection result indicating whether the video corresponds to a target classification;
step S230: determining the video as a video to be processed in response to the detection result indicating that the video corresponds to the target classification;
step S240: and responding to the video corresponding to the target classification, and obtaining the video label of the video to be processed from a plurality of labels corresponding to the target classification.
Based on the description data corresponding to the video, determining whether the video corresponds to the target classification, and when the video corresponds to the target classification, determining the video as a video to be processed to determine video tags of the video to be processed from a plurality of tags corresponding to the target classification, so that the video can be screened to tag the video corresponding to the target classification.
In the related art, video analysis is often performed for a single video, for example, in the process of analyzing information contained in the video, a matched tag is obtained by directly importing the video or a video frame sequence obtained by the video into a model, extracting image information, and matching the image information with a plurality of tags. When the description data volume is large, the processing mode needs to analyze each video, so that the data processing volume is large, and the tag acquisition efficiency is low.
In the embodiment of the disclosure, the video is screened firstly based on the description data of the video to obtain the video to be processed corresponding to the target classification, and then the video label of the video to be processed is obtained from a plurality of labels corresponding to the target classification, so that the data processing amount is greatly reduced under the condition of large video amount.
For example, in one typical application according to the present disclosure, a server obtains video from an upstream server, and tags the video to include more information. When the user acquires the video of the upstream server, the upstream server calls the labeled video from the server and provides the labeled video to the user. The upstream server side can be used for uploading a large number of videos, such as tens of thousands of videos, and can screen a plurality of videos according to the method disclosed by the invention so as to label videos needing to be labeled, thereby greatly reducing the data processing amount when the videos are labeled and improving the efficiency of labeling the videos.
In some embodiments, the description data is, for example, such that it includes text data corresponding to the video, e.g., the description data includes several fields, such as "vid", "video_url", "cat", "sub_cat", and so forth. Wherein the "cat" field indicates a first level category of the video, the "sub_cat" field indicates a second level category of the video, and each "cat" field includes a corresponding "sub_cat" field.
In some embodiments, the "cat" field, for example, includes: synthetic arts, nature, entertainment, games, movies, music, constellation fortune, dance, culture, sports, numbers, hand, current, fashion, life, photography, society, three farmers, emotion, automobile, clapping, maternal and infant child care, food, travel, history, science, military, education, vehicles, health care, home, international, fun, cartoon, pet, financial and the like.
In some embodiments, the "sub_cat" field corresponding to the "cat" field is a "sub_cat" field of the composition, for example, including: the art comprises the following steps of synthesis, job site art, music art, show choosing program, small products, looks, relatives art, dance art, culture art, talk show, challenge art, fashion art, emotion art, parent-child art, magic, star genuine show, travel art, and treasure art.
In some embodiments, it is to be appreciated that embodiments of the present disclosure and video description data including a "cat" field indicating a first level category of video and a "sub_cat" field indicating a second level category of video are merely exemplary, and that video description data may also include only a field indicating a first level category or indicate a following level (e.g., a third level category subdivided in a second level category, a fourth level category subdivided in a third level category, etc.), without limitation herein.
Meanwhile, it should be understood that the category of the video is not the same as the target category. The category of the video is defined in the description data of the video, and the category is derived from a server of a video source end; the target classification is a classification for labeling the video according to the needs set by the needs, and is determined by a server of the video processing end.
In some embodiments, the description data includes a first field indicating a first level category corresponding to the video among a plurality of first level categories, each of the plurality of first level categories corresponding to a plurality of second level categories, the description data further including a second field indicating a second level category corresponding to the video among a respective plurality of second level categories. As shown in fig. 3, obtaining a detection result indicating whether the video corresponds to a target classification includes:
Step S310: combining the first field and the second field; and
step S320: and obtaining the detection result based on the combined fields and the target classification.
The data throughput is further reduced by combining fields in the description data and obtaining a detection result based on the combined fields and the target classification.
In some embodiments, for object classification, a corresponding screening rule may be set to screen the video. In some embodiments, a plurality of filter fields corresponding to the target classification are set, and the video corresponding to the combined field is determined to correspond to the target classification by traversing the combined field of the video through the plurality of filter fields of the target classification in response to the combined field corresponding to one of the plurality of filter fields. For example, targets are classified as "plants", and setting the screening field includes: "nature_plant", "home_plant", "home_gardening". After the video indicating that the "cate" field of the first-level category is "home" and the "sub_cate" field of the second-level category is "gardening" is obtained, since the combined field of the "cate" field and the "sub_cate" field of the video is "home_gardening", it can be determined that the video corresponds to the target category "plant".
In some embodiments, the detection result is obtained by obtaining a similarity of the combined field to the target class.
In some embodiments, after determining that the video corresponds to the target classification, a video connection is obtained based on a "video_url" field in the description data of the video, and image data of the video is obtained based on the link (e.g., by downloading).
Since the foregoing process of determining whether the video corresponds to the target classification only instructs to process the description data of the video, neither relates to the image data of the video, the foregoing process has a small data processing amount, a small resource consumption, and a high processing speed.
In the following, a process of further obtaining a video tag of a video to be processed after determining the video as the video to be processed in an embodiment according to the present disclosure is further described.
In some embodiments, as shown in fig. 4, obtaining the video tag of the video to be processed from the plurality of tags corresponding to the object classification includes:
step S410: for each video frame in a plurality of video frames of the video to be processed, acquiring a video frame tag of the video frame and a probability corresponding to the video frame tag from the plurality of tags; and
Step S420: and acquiring the video label of the video to be processed based on the video frame label of each video frame in the plurality of video frames and the probability corresponding to the video frame.
And obtaining the video label of the video to be processed by obtaining the video frame label of each video frame in the plurality of video frames of the video to be processed and the probability corresponding to the video frame label, so that the obtained video label of the video to be processed is further accurate.
In some embodiments, the video frame tag of the video frame and the probability corresponding to the video frame tag are obtained from the plurality of tags by a target tag model corresponding to a target classification
In some embodiments, the target tag model corresponding to the target classification is obtained by pre-training a neural network model.
In some embodiments, the neural network model employs a Res3Net neural network framework. The Res3Net neural network framework obtains a prediction result corresponding to the input image by carrying out multi-scale processing on the input image, and further reduces the data processing amount in the multi-scale processing process, so that the data processing amount in the video labeling process is less, the efficiency is high, and the accuracy of labeling is ensured.
The Bottleneck block module included in the Res3Net neural network framework according to some embodiments of the present disclosure further reduces the amount of computation in the computation process by first reducing and then increasing dimensions of the input features.
In some embodiments, the target tag model obtains a probability corresponding to each of the plurality of tags based on the input video frame, and takes a tag with a highest probability corresponding to the plurality of tags as a video frame tag of the video frame of the input target tag model.
In some embodiments, based on the video frame tag of each of the plurality of video frames and the probability that the video frame corresponds, obtaining the video tag of the processed video comprises: and taking the corresponding video frame label with the probability larger than the threshold value as the video frame label of the video to be processed.
In some embodiments, as shown in fig. 5, obtaining the video tag of the video to be processed includes:
step S510: for each video frame in the plurality of video frames, determining the video frame tag of the video frame as a candidate tag in response to determining that the probability corresponding to the video frame tag of the video frame is greater than a preset probability threshold, so as to obtain a candidate tag set of the video to be processed; and
step S520: for each candidate tag in the candidate tag set, determining the candidate tag as a video tag of the video to be processed in response to determining that a number of video frames corresponding to the candidate tag in the plurality of video frames is not less than a preset number threshold.
In the process of obtaining the video tags of the video to be processed, the video frame tags corresponding to each video frame in the plurality of video frames are screened, the video frame tags with the corresponding probability larger than the preset probability threshold value and the video frame tags with the number of the video frames larger than the preset number threshold value in the plurality of video frames are used as the video tags of the video to be processed, and the accuracy of the video tags is further improved.
In some embodiments, different preset probability thresholds and preset number thresholds may be set according to the accuracy requirements of the video tag. In one example, the preset probability threshold is 0.94 and the preset number threshold is 3.
In some embodiments, the obtaining of the category of the video to be processed in step S210 is only further extracting a plurality of video frames from the video to be processed to obtain a video frame tag and a probability corresponding to the video frame tag for each of the plurality of video frames in step S220.
In some embodiments, the "video_url" field in the description data is extracted to obtain a downloadable video link, after which a plurality of video frames are extracted from the video to be processed.
In some embodiments, the number of the plurality of video frames is not greater than a preset threshold.
The number of the plurality of video frames is set to be not more than a preset threshold value, so that excessive consumption of excessive computing resources caused by excessive number of the video frames processed in the processing process is avoided.
In some embodiments, the threshold setting 150 is preset.
In some embodiments, the length of the video to be processed is relatively short, for example, several tens of seconds to several minutes, and a frame of video frame is extracted by each preset duration, so as to obtain a plurality of video frames of the video to be processed. In one example, one video frame is extracted every 2 s.
In some embodiments, the length of the video to be processed is relatively long, e.g., one hour, by obtaining a video segment from the video to be processed and extracting the plurality of video frames from the video segment.
In some embodiments, as shown in fig. 6, extracting the plurality of video frames from the video to be processed includes:
step S610: responding to the time length of the video to be processed is larger than a preset time length, and acquiring a segment of the video to be processed based on a starting time point of the video to be processed, wherein the time length of the segment is the preset time length; and
step S620: the plurality of video frames are extracted from the segment based on a preset time interval.
The inventors have found that the content of the beginning segment of the video often can represent the content of the video as a whole, and that a segment based on the beginning of the video is sufficient to obtain a video tag that can represent the content of the video. Thus, in embodiments according to the present disclosure, by processing a plurality of video frames in a beginning segment of a video to be processed to obtain a video tag of the video, it is possible to avoid processing an excessive amount of data while excessively consuming system resources.
In some embodiments, the preset time period is 5 minutes and the preset time interval is 2 seconds.
In some embodiments, after obtaining the video tag of the video to be processed, the video tag of the video to be processed is associated with a corresponding video frame of the plurality of video frames, such that the video tag of the video to be processed is presented on the corresponding video frame when the video to be processed is played.
Through associating the video tag of the video to be processed with the corresponding video frame in the video to be processed, a user can display the video tag corresponding to the video when playing the video, so that the information density of the video is improved, the cognition and information expansion requirements of the user are met, and the user experience is improved.
In some embodiments, the description data of the video to be processed is processed to generate new description data, and the new description data is returned to the server, so that the server invokes the new description data when providing the video corresponding to the user. In some embodiments, the new description data includes a video tag and a time when a video frame corresponding to the video tag occurs.
There is also provided, in accordance with an embodiment of the present disclosure, a video processing apparatus, as shown in fig. 7, an apparatus 700 including: an acquisition unit 710 configured to acquire description data of a video, the description data indicating a category detection unit 720 corresponding to the video among a plurality of categories, and configured to obtain a detection result indicating whether the video corresponds to a target category based on the description data; a determining unit 730 configured to determine the video as a video to be processed in response to the detection result indicating that the video corresponds to the target classification; and a processing unit 740 configured to obtain a video tag of the video to be processed from a plurality of tags corresponding to the object classification.
In some embodiments, the description data includes a first field indicating a first level category corresponding to the video among a plurality of first level categories, each of the plurality of first level categories corresponding to a plurality of second level categories, the description data further includes a second field indicating a second level category corresponding to the video among a respective plurality of second level categories, the detection unit 720 includes: a combining unit configured to combine the first field and the second field to obtain a combined field; and a detection subunit configured to obtain the detection result based on the combined field and the target classification.
In some embodiments, the processing unit 740 includes: a calculating unit configured to obtain, for each of a plurality of video frames of the video to be processed, a video frame tag of the video frame and a probability corresponding to the video frame tag from the plurality of tags; and a video tag acquisition unit configured to acquire the video tag of the video to be processed based on the video frame tag of each of the plurality of video frames and a probability that the video frame corresponds to.
In some embodiments, the video tag acquisition unit includes: a first determining unit configured to determine, for each of the plurality of video frames, a video frame tag of the video frame as a candidate tag in response to determining that a probability corresponding to the video frame tag of the video frame is greater than a preset probability threshold, to obtain a candidate tag set of the video to be processed; and a second determining unit configured to determine, for each candidate tag in the candidate tag set, the candidate tag as a video tag of the video to be processed in response to determining that a number of video frames corresponding to the candidate tag among the plurality of video frames is not less than a preset number threshold.
In some embodiments, the processing unit 740 includes: and a video frame acquisition unit configured to extract the plurality of video frames from the video to be processed, wherein the number of the plurality of video frames is not greater than a preset threshold.
In some embodiments, the video frame acquisition unit comprises: a segment obtaining unit, configured to obtain segments of the video to be processed based on a start time point of the video to be processed, in response to a time length of the video to be processed being greater than a preset time length, the time length of the segments being the preset time length; and an extraction unit configured to extract the plurality of video frames from the segment based on a preset time interval.
There is also provided, in accordance with an embodiment of the present disclosure, an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method according to embodiments of the present disclosure.
There is also provided, in accordance with an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform a method according to an embodiment of the present disclosure.
According to an embodiment of the present disclosure, there is also provided a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements a method according to an embodiment of the present disclosure.
In the technical scheme of the disclosure, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the user accord with the regulations of related laws and regulations, and the public order colloquial is not violated.
Referring to fig. 8, a block diagram of an electronic device 800 that may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the apparatus 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
Various components in device 800 are connected to I/O interface 805, including: an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. The input unit 806 may be any type of device capable of inputting information to the device 800, the input unit 806 may receive input numeric or character information and generate key signal inputs related to user settings and/or function control of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a trackpad, a trackball, a joystick, a microphone, and/or a remote control. The output unit 807 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, video/audio output terminals, vibrators, and/or printers. The storage unit 808 may include, but is not limited to, magnetic disks, optical disks. The communication unit 809 allows the device 800 to exchange information/data with other devices over computer networks, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, 802.11 devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
The computing unit 801 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as method 200. For example, in some embodiments, the method 200 may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 800 via ROM 802 and/or communication unit 809. When a computer program is loaded into RAM 803 and executed by computing unit 801, one or more steps of method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the method 200 by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the foregoing methods, systems, and apparatus are merely exemplary embodiments or examples, and that the scope of the present invention is not limited by these embodiments or examples but only by the claims following the grant and their equivalents. Various elements of the embodiments or examples may be omitted or replaced with equivalent elements thereof. Furthermore, the steps may be performed in a different order than described in the present disclosure. Further, various elements of the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced by equivalent elements that appear after the disclosure.

Claims (14)

1. A video processing method performed by a video processing terminal, comprising:
Acquiring description data of a video from an upstream server, wherein the description data comprises a field for indicating a category corresponding to the video in a plurality of categories and a video link field, and the upstream server is a video source terminal;
based on the field in the description data, obtaining a detection result indicating whether the video corresponds to a target classification;
responding to the detection result to indicate that the video does not correspond to the target classification, and determining that the video does not need to be labeled by applying a target label model corresponding to the target classification;
responding to the detection result to indicate that the video corresponds to the target classification, and determining the video as a video to be processed of a target label model corresponding to the target classification;
acquiring image data of the video to be processed from the upstream server based on a video link field of the video to be processed, wherein the image data comprises a plurality of video frames of the video; and
obtaining a video tag of the video to be processed from a plurality of tags corresponding to the target classification based on the processing of the image data by the target tag model;
associating the video tag with a corresponding video frame of the plurality of video frames;
Adding the video tag and the appearance time of the corresponding video frame in the plurality of video frames to the description data of the video to be processed; and
and sending the marked video to be processed and the updated description data to the upstream server, so that the video to be processed displays video labels to users in corresponding video frames, and the next detection result is obtained based on the updated description data.
2. The method of claim 1, wherein the description data includes a first field indicating a first level category corresponding to the video among a plurality of first level categories, each of the plurality of first level categories corresponding to a plurality of second level categories, the description data further including a second field indicating a second level category corresponding to the video among a respective plurality of second level categories, the obtaining a detection result indicating whether the video corresponds to a target category comprising:
combining the first field and the second field to obtain a combined field; and
and obtaining the detection result based on the combined fields and the target classification.
3. The method of claim 1, wherein the obtaining the video tag of the video to be processed from a plurality of tags corresponding to the object classification comprises:
For each video frame in a plurality of video frames of the video to be processed, acquiring a video frame tag of the video frame and a probability corresponding to the video frame tag from the plurality of tags; and
and acquiring the video label of the video to be processed based on the video frame label of each video frame in the plurality of video frames and the probability corresponding to the video frame.
4. The method of claim 3, wherein the acquiring the video tag of the video to be processed comprises:
for each video frame in the plurality of video frames, determining the video frame tag of the video frame as a candidate tag in response to determining that the probability corresponding to the video frame tag of the video frame is greater than a preset probability threshold, so as to obtain a candidate tag set of the video to be processed; and
for each candidate tag in the candidate tag set, determining the candidate tag as a video tag of the video to be processed in response to determining that a number of video frames corresponding to the candidate tag in the plurality of video frames is not less than a preset number threshold.
5. The method of claim 3 or 4, wherein the obtaining the video tag of the video to be processed from the plurality of tags corresponding to the object classification further comprises:
And extracting the plurality of video frames from the video to be processed, wherein the number of the plurality of video frames is not more than a preset threshold value.
6. The method of claim 5, wherein extracting the plurality of video frames from the video to be processed comprises:
responding to the time length of the video to be processed is larger than a preset time length, and acquiring a segment of the video to be processed based on a starting time point of the video to be processed, wherein the time length of the segment is the preset time length; and
the plurality of video frames are extracted from the segment based on a preset time interval.
7. A video processing apparatus for execution by a video processing terminal, comprising:
an acquisition unit configured to acquire description data of a video from an upstream server, the description data including a field for indicating a category corresponding to the video among a plurality of categories and a video link field, the upstream server being a video source;
a detection unit configured to obtain a detection result indicating whether the video corresponds to a target classification based on the field in the description data;
a determining unit configured to determine that the video does not need to be labeled by applying a target label model corresponding to the target classification in response to the detection result indicating that the video does not correspond to the target classification; responding to the detection result to indicate that the video corresponds to the target classification, and determining the video as a video to be processed of a target label model corresponding to the target classification; and
A processing unit configured to:
acquiring image data of the video to be processed from the upstream server based on a video link field of the video to be processed, wherein the image data comprises a plurality of video frames of the video;
obtaining a video tag of the video to be processed from a plurality of tags corresponding to the target classification based on the processing of the image data by the target tag model;
associating the video tag with a corresponding video frame of the plurality of video frames;
adding the video tag and the appearance time of the corresponding video frame in the plurality of video frames to the description data of the video to be processed; and
and sending the marked video to be processed and the updated description data to the upstream server, so that the video to be processed displays video labels to users in corresponding video frames, and the next detection result is obtained based on the updated description data.
8. The apparatus of claim 7, wherein the description data includes a first field indicating a first level category corresponding to the video among a plurality of first level categories, each of the plurality of first level categories corresponding to a plurality of second level categories, the description data further including a second field indicating a second level category corresponding to the video among a corresponding plurality of second level categories, the detection unit comprising:
A combining unit configured to combine the first field and the second field to obtain a combined field; and
and a detection subunit configured to obtain the detection result based on the combined field and the target classification.
9. The apparatus of claim 7, wherein the processing unit comprises:
a calculating unit configured to obtain, for each of a plurality of video frames of the video to be processed, a video frame tag of the video frame and a probability corresponding to the video frame tag from the plurality of tags; and
a video tag obtaining unit configured to obtain a video tag of the video to be processed based on the video frame tag of each of the plurality of video frames and a probability corresponding to the video frame.
10. The apparatus of claim 9, wherein the video tag acquisition unit comprises:
a first determining unit configured to determine, for each of the plurality of video frames, a video frame tag of the video frame as a candidate tag in response to determining that a probability corresponding to the video frame tag of the video frame is greater than a preset probability threshold, to obtain a candidate tag set of the video to be processed; and
And a second determining unit configured to determine, for each candidate tag in the candidate tag set, the candidate tag as a video tag of the video to be processed in response to determining that a number of video frames corresponding to the candidate tag among the plurality of video frames is not less than a preset number threshold.
11. The apparatus of claim 9 or 10, wherein the processing unit further comprises:
and a video frame acquisition unit configured to extract the plurality of video frames from the video to be processed, wherein the number of the plurality of video frames is not greater than a preset threshold.
12. The apparatus of claim 10, wherein the video frame acquisition unit comprises:
a segment obtaining unit, configured to obtain segments of the video to be processed based on a start time point of the video to be processed, in response to a time length of the video to be processed being greater than a preset time length, the time length of the segments being the preset time length; and
an extraction unit configured to extract the plurality of video frames from the segment based on a preset time interval.
13. An electronic device, comprising:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein the method comprises the steps of
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-6.
CN202210062299.8A 2022-01-19 2022-01-19 Video processing method and device Active CN114390366B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210062299.8A CN114390366B (en) 2022-01-19 2022-01-19 Video processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210062299.8A CN114390366B (en) 2022-01-19 2022-01-19 Video processing method and device

Publications (2)

Publication Number Publication Date
CN114390366A CN114390366A (en) 2022-04-22
CN114390366B true CN114390366B (en) 2024-02-06

Family

ID=81204347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210062299.8A Active CN114390366B (en) 2022-01-19 2022-01-19 Video processing method and device

Country Status (1)

Country Link
CN (1) CN114390366B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104935966A (en) * 2015-06-03 2015-09-23 无锡天脉聚源传媒科技有限公司 Method and device for copying classified video information
CN110163115A (en) * 2019-04-26 2019-08-23 腾讯科技(深圳)有限公司 A kind of method for processing video frequency, device and computer readable storage medium
CN111222500A (en) * 2020-04-24 2020-06-02 腾讯科技(深圳)有限公司 Label extraction method and device
CN111711869A (en) * 2020-06-24 2020-09-25 腾讯科技(深圳)有限公司 Label data processing method and device and computer readable storage medium
CN112115299A (en) * 2020-09-17 2020-12-22 北京百度网讯科技有限公司 Video searching method and device, recommendation method, electronic device and storage medium
CN112948631A (en) * 2019-12-11 2021-06-11 北京金山云网络技术有限公司 Video tag generation method and device and electronic terminal
CN113010737A (en) * 2021-03-25 2021-06-22 腾讯科技(深圳)有限公司 Video tag classification method and device and storage medium
CN113705299A (en) * 2021-03-16 2021-11-26 腾讯科技(深圳)有限公司 Video identification method and device and storage medium
CN113761253A (en) * 2021-05-20 2021-12-07 腾讯科技(深圳)有限公司 Video tag determination method, device, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113132752B (en) * 2019-12-30 2023-02-24 阿里巴巴集团控股有限公司 Video processing method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104935966A (en) * 2015-06-03 2015-09-23 无锡天脉聚源传媒科技有限公司 Method and device for copying classified video information
CN110163115A (en) * 2019-04-26 2019-08-23 腾讯科技(深圳)有限公司 A kind of method for processing video frequency, device and computer readable storage medium
CN112948631A (en) * 2019-12-11 2021-06-11 北京金山云网络技术有限公司 Video tag generation method and device and electronic terminal
CN111222500A (en) * 2020-04-24 2020-06-02 腾讯科技(深圳)有限公司 Label extraction method and device
CN111711869A (en) * 2020-06-24 2020-09-25 腾讯科技(深圳)有限公司 Label data processing method and device and computer readable storage medium
CN112115299A (en) * 2020-09-17 2020-12-22 北京百度网讯科技有限公司 Video searching method and device, recommendation method, electronic device and storage medium
CN113705299A (en) * 2021-03-16 2021-11-26 腾讯科技(深圳)有限公司 Video identification method and device and storage medium
CN113010737A (en) * 2021-03-25 2021-06-22 腾讯科技(深圳)有限公司 Video tag classification method and device and storage medium
CN113761253A (en) * 2021-05-20 2021-12-07 腾讯科技(深圳)有限公司 Video tag determination method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114390366A (en) 2022-04-22

Similar Documents

Publication Publication Date Title
CN113836333B (en) Training method of image-text matching model, and method and device for realizing image-text retrieval
CN112579909A (en) Object recommendation method and device, computer equipment and medium
CN112836072A (en) Information display method and device, electronic equipment and medium
CN113723305A (en) Image and video detection method, device, electronic equipment and medium
CN113642740A (en) Model training method and device, electronic device and medium
CN113868453B (en) Object recommendation method and device
CN115600646B (en) Language model training method, device, medium and equipment
CN114219046B (en) Model training method, matching method, device, system, electronic equipment and medium
CN115170887B (en) Target detection model training method, target detection method and target detection device
CN114390366B (en) Video processing method and device
CN113596011B (en) Flow identification method and device, computing device and medium
CN113722594B (en) Training method and device of recommendation model, electronic equipment and medium
CN114842476A (en) Watermark detection method and device and model training method and device
CN115269989A (en) Object recommendation method and device, electronic equipment and storage medium
CN114998963A (en) Image detection method and method for training image detection model
CN114429678A (en) Model training method and device, electronic device and medium
CN113836939B (en) Text-based data analysis method and device
CN115578451B (en) Image processing method, training method and device of image processing model
CN113722534B (en) Video recommendation method and device
CN116070711B (en) Data processing method, device, electronic equipment and storage medium
CN114842474B (en) Character recognition method, device, electronic equipment and medium
CN114677691B (en) Text recognition method, device, electronic equipment and storage medium
CN114120420B (en) Image detection method and device
CN114861658B (en) Address information analysis method and device, equipment and medium
CN116257655A (en) Video aggregation method and device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant