CN113486853B - Video detection method and device, electronic equipment and medium - Google Patents
Video detection method and device, electronic equipment and medium Download PDFInfo
- Publication number
- CN113486853B CN113486853B CN202110865078.XA CN202110865078A CN113486853B CN 113486853 B CN113486853 B CN 113486853B CN 202110865078 A CN202110865078 A CN 202110865078A CN 113486853 B CN113486853 B CN 113486853B
- Authority
- CN
- China
- Prior art keywords
- video
- detected
- training
- average
- 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
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 65
- 238000012549 training Methods 0.000 claims abstract description 68
- 238000000034 method Methods 0.000 claims description 42
- 238000007781 pre-processing Methods 0.000 claims description 7
- 230000004044 response Effects 0.000 claims description 7
- 238000010606 normalization Methods 0.000 claims description 4
- 238000012544 monitoring process Methods 0.000 claims 2
- 238000004590 computer program Methods 0.000 abstract description 13
- 238000013135 deep learning Methods 0.000 abstract description 4
- 238000004891 communication Methods 0.000 description 13
- 238000005516 engineering process Methods 0.000 description 13
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 8
- 238000013473 artificial intelligence Methods 0.000 description 5
- 238000013527 convolutional neural network Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 2
- 238000007667 floating Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 238000011176 pooling Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 238000012550 audit Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000010267 cellular communication Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003924 mental process Effects 0.000 description 1
- 230000003278 mimic effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 210000000653 nervous system Anatomy 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000013439 planning Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Image Analysis (AREA)
Abstract
The disclosure provides a video detection method, a video detection device, electronic equipment, computer readable storage media and a computer program product, and relates to the field of computers, in particular to the technical fields of computer vision and deep learning. The implementation scheme is as follows: acquiring a plurality of video frames of a video to be detected; inputting a plurality of video frames into a video detection model to obtain identification results which are output by the video detection model and respectively correspond to each video frame; and determining whether the video to be detected is a stretched video according to a plurality of identification results respectively corresponding to the video frames. The video detection model is obtained by training a preset model based on training data comprising supervision data, wherein the supervision data comprises label data of whether a sample video frame contains key video elements.
Description
Technical Field
The present disclosure relates to the field of computers, and more particularly, to the field of computer vision and deep learning technologies, and in particular, to a video detection 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.
With the improvement of the living standard of people and the development of technology, the ways of people to acquire information and leisure and entertainment are gradually changed, and the video rapidly occupies the broken time in the life of people due to the characteristics of rich content, high information density, strong interest and the like. In the search and recommendation related products, videos are a new content presentation mode which is preferred by users. In the video production process, because video creators are uneven horizontally, partial video aspect ratio parameter setting is abnormal in the video editing and transcoding process, and picture stretching distortion of the video is caused. The characters and objects in the video with stretching distortion present abnormal aspect ratio, which affects the user experience of the product.
Disclosure of Invention
The present disclosure provides a video detection 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 detection method including: acquiring a plurality of video frames of a video to be detected; inputting the plurality of video frames into a video detection model to obtain identification results which are output by the video detection model and respectively correspond to each video frame, wherein the video detection model is obtained by training a preset model based on training data comprising supervision data, and the supervision data comprises label data of whether a sample video frame contains key video elements or not; and determining whether the video to be detected is a stretched video according to a plurality of identification results respectively corresponding to the video frames.
According to another aspect of the present disclosure, there is provided a model training method including: acquiring a plurality of pictures and determining whether each picture of the plurality of pictures is a stretched picture to generate training data; determining whether each picture of the plurality of pictures contains a key picture element to generate supervision data for the training data; and training a preset model based on the training data including the supervision data, so that the model recognizes whether the inputted picture is a stretched picture.
According to another aspect of the present disclosure, there is provided a video detection apparatus including: an acquisition unit configured to acquire a plurality of video frames of a video to be detected; the detection unit is configured to input the plurality of video frames into a video detection model to obtain identification results which are output by the video detection model and respectively correspond to each video frame, wherein the video detection model is obtained by training a preset model based on training data comprising supervision data, and the supervision data comprises label data of whether a sample video frame contains key video elements or not; and a determining unit configured to determine whether the video to be detected is a stretched video according to a plurality of the recognition results respectively corresponding to the plurality of video frames.
According to another aspect of the present disclosure, there is provided a model training apparatus including: an acquisition unit configured to acquire a plurality of pictures and determine whether each of the plurality of pictures is a stretched picture to generate training data; a determining unit configured to determine whether each of the plurality of pictures contains a key picture element to generate supervision data of the training data; and a training unit configured to train a preset model based on the training data including the supervision data so that the model recognizes whether the inputted picture is a stretched picture.
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; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods described in 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 a computer to perform the method described in the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method described in the present disclosure.
According to one or more embodiments of the present disclosure, applying the trained model to video stretching distortion detection may improve the stretching distortion detection efficiency of the video, and reduce the operation cost of the product.
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 illustrates a flow chart of a video detection method according to an embodiment of the present disclosure;
FIG. 3 illustrates a flow chart of a model training method according to an embodiment of the present disclosure;
FIG. 4 illustrates a schematic diagram of a convolutional neural network for video stretch detection in accordance with an embodiment of the present disclosure;
FIG. 5 illustrates a flowchart of determining whether a video to be detected is a stretched video, according to an embodiment of the present disclosure;
fig. 6 shows a block diagram of a video detection apparatus according to an embodiment of the present disclosure;
FIG. 7 shows a block diagram of a model training 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, server 120 may run one or more services or software applications that enable the execution of video detection methods and/or model training methods.
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 use client devices 101, 102, 103, 104, 105, and/or 106 to upload video to be detected or to obtain video detection results, and so on. 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, 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, appli OS, 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 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 the databases 130 may be used to store data such as inspection videos, recognition results, training data, and the like. 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.
The tensile distortion of the video brings great harm to the experience of watching the video by the user, even causes physiological discomfort, long-term falling of the corresponding video products and loss of the user can be caused, and great influence is caused on the income of the company. The method of rejecting by using manual screening is inefficient, requires employment of a large number of auditors, and has high cost for service training. In addition, manual auditing is often used because the auditor is not focused on resulting in missed audits. Therefore, how to identify a video having a stretch distortion from among a large number of videos becomes a problem that needs to be solved urgently for video-type products. Video stretching distortion is typically caused by video aspect ratio setup anomalies during video compression transcoding, and it is a difficult problem how to identify stretching distortion in a picture of a video that has lost the correct aspect ratio.
Accordingly, embodiments in accordance with the present disclosure provide a video detection method. Fig. 2 shows a flowchart 200 of a video detection method according to an embodiment of the present disclosure. As shown in fig. 2, the method 200 may include: acquiring a plurality of video frames of a video to be detected (step 210); inputting a plurality of video frames into a video detection model to obtain identification results which are output by the video detection model and respectively correspond to each video frame, wherein the video detection model is obtained by training a preset model based on training data comprising supervision data, and the supervision data comprises label data (220) of whether a sample video frame comprises key video elements or not; and determining whether the video to be detected is a stretched video according to a plurality of the recognition results corresponding to the plurality of video frames, respectively (step 230).
In recent years, a video image detection technology based on a neural network has become a hot trend in the field of computer vision in recent years, and in a manner similar to the operation of a human nervous system, a computer can extract an effective feature combination from an image.
In some examples, the video detection model is a trained deep learning based convolutional neural network. It should be understood that other possible network models are possible and are not limiting herein.
Embodiments according to the present disclosure provide a model training method, which may be used for training of the video detection model described above, for example. As shown in fig. 3, the model training method 300 may include: acquiring a plurality of pictures and determining whether each of the plurality of pictures is a stretched picture to generate training data (step 310); determining whether each picture of the plurality of pictures contains a key picture element to generate supervision data for the training data (step 320); and training the preset model based on the training data including the supervision data such that the model recognizes whether the inputted picture is a stretched picture (step 330).
According to the embodiment of the disclosure, the model obtained through training can more accurately identify whether the picture is a stretched picture or not through supervision data based on key picture elements.
In embodiments where the video detection model is trained using the model training method described above, a large number of pictures may be used for stretching and scaling to generate training data for the video detection model. For example, the training data with the labels can be obtained by stretching and scaling the multiple pictures to different degrees by a linear interpolation method. The label is the degree of stretch of the picture, for example, transverse stretch or longitudinal stretch.
In some embodiments, the degree of stretch may be a numerical value. For example, the stretch case label is a floating point number: a smaller value than 1 is a transverse stretching, and a smaller value means a larger stretching degree; a machine direction stretch greater than 1 indicates a greater degree of stretch; a value equal to 1 indicates that the picture has not been stretched.
The training data of the video detection model includes, in addition to the above-mentioned label indicating the degree of stretching, a label whether the sample picture contains a key picture element. According to some embodiments, the key picture element (i.e., key video element) may include a face. Since the user is more sensitive to stretching distortion of the face while watching the video, the user is not sensitive to stretching distortion of the video without a reference. Therefore, the label with or without the face can be used as the auxiliary supervision when the model training is performed.
In some examples, the weights at which the model learns the stretch degree of the picture with or without a face may be adjusted so that the model can explicitly learn face-related features for stretch degree recognition. Experiments prove that the auxiliary supervision loss function is more accurate for stretching identification containing faces.
For example, a face detection algorithm may be used to face detect pictures in the training data. An auxiliary label is set for the picture with the detected face, for example, an auxiliary label of 1 indicates that the face exists in the picture, and an auxiliary label of 0 indicates that no face exists.
In some embodiments, the tagged pictures are used as training data and input into a deep convolutional neural network specifically designed for stretch distortion detection for training. The auxiliary label determines the coefficient of the learning stretching degree during training, which is equivalent to the attention mechanism of the human face added in the training, wherein the loss function can be as follows:
wherein p is i 、t i 、l i And q i The predicted value of the stretching degree of the picture, the label value of the stretching degree, the predicted value of whether a face exists or not and the label value of whether the face exists or not are respectively shown; alpha, beta and lambda are constant coefficients, e.g. 0.1, 0.5 and 0.5, respectively. It will be appreciated that other possible loss functions are applicable and are not limiting herein. The corresponding stretching degree learning coefficients are different when the human face exists or not, so that the video detection model can learn the relevant characteristics of the human face in the training process, and is more sensitive to stretching of the human face. And after multiple rounds of training, the model converges to obtain a video detection model capable of predicting the stretching distortion degree of the video picture.
After the trained video detection model is obtained, the video to be detected can be detected based on the video detection model.
First, a plurality of video frames of a video to be detected are acquired. In some examples, the video to be detected may be decoded to obtain a plurality of video frames. For example, when detecting short videos in the short video platform, 20 frames may be extracted for each short video, where the extraction interval is t=t/20, and T is the short video duration.
According to some embodiments, a method according to the present disclosure may further comprise: the plurality of video frames are preprocessed to input the preprocessed plurality of video frames into the video detection model. The preprocessing may include, for example: normalization, equal aspect ratio scaling, boundary zero padding, etc. Since the stretching distortion identifies the stretching distortion of the picture to be identified, the preprocessing is to use equal aspect ratio scaling that does not change the scale of the picture (video frame) to be detected. For example, a zero padding operation may be performed on non-square pictures after equal aspect ratio scaling to obtain pictures of a corresponding size (e.g., 224 x 224).
In some examples, the predetermined model may include a convolutional neural network model. Fig. 4 shows a schematic structural diagram of a convolutional neural network for video stretching degree detection according to an embodiment of the present disclosure. As shown in fig. 4, the input (input) picture is 224×224×3, and then is output through the full connection layer (FC) via the plurality of convolution layers (Conv) and Pooling layers (Pooling). It will of course be appreciated that other forms of network architecture are possible and are not limiting herein.
According to some embodiments, when the recognition result is a numerical value, as shown in fig. 5, determining whether the video to be detected is a stretched video (step 230) may include: acquiring a first number of recognition results with the highest numerical value and a second number of recognition results with the lowest numerical value in the plurality of recognition results (step 510); determining a first average of the first number of recognition results and a second average of the second number of recognition results, respectively (step 520); and determining whether the video to be detected is a stretched video based on the first average value and the second average value (step 530).
Considering that the existence of a key video element (e.g. a human face) in a video segment affects the judgment of the stretching degree, the element in a video segment may not always exist, so that the stretching degree of the whole video can be judged more accurately according to the maximum average value and the minimum average value of the recognition results.
It will be appreciated that the key video elements in accordance with embodiments of the present disclosure are not just faces, other elements are possible, such as buildings. In some examples, the video detection model may be trained in a helper based on one or more key video elements.
According to some embodiments, determining whether the video to be detected is a stretched video based on the first average value and the second average value may include: determining that the video to be detected is one of longitudinal stretching and transverse stretching in response to the first average value being greater than a first threshold value and the second average value being greater than a second threshold value; and determining that the video to be detected is the other of the longitudinal stretching and the transverse stretching in response to the first average value being less than the third threshold and the second average value being less than the fourth threshold.
In one embodiment according to the present disclosure, after preprocessing (normalization, equal aspect ratio scaling, boundary zero padding) the extracted picture, the preprocessed picture is identified frame by frame using a trained video detection model to obtain a single frame picture stretching degree score. The tensile value output by the video detection model is a floating point number: small sizeThe smaller the transverse stretching at 1, the greater the degree of stretching; a machine direction stretch greater than 1 indicates a greater degree of stretch; a value equal to 1 indicates that the picture has not been stretched. Sequencing the stretching results of 20 frames of pictures according to the numerical value, taking the average Score of 8 frames of pictures with the maximum numerical value as Score large_average Taking average Score of 8 frames of pictures with minimum values and marking the average Score as Score small_average The method comprises the steps of carrying out a first treatment on the surface of the If Score large_average Greater than 1.4 and Score small_average Greater than 1.2, then the video is considered to be stretched longitudinally; if Score large_average Less than 0.9 and Score small_average Less than 0.85, then the video is considered to be stretched laterally; otherwise, the video is considered to be normal video.
According to the detection method disclosed by the invention, the video with stretching distortion in a large amount of videos can be effectively detected, and the detection method has the advantages of higher accuracy and good robustness, so that manpower and material resources are saved.
As shown in fig. 6, there is also provided a video detection apparatus 600 according to an embodiment of the present disclosure, including: an acquisition unit 610 configured to acquire a plurality of video frames of a video to be detected; the detecting unit 620 is configured to input the plurality of video frames into a video detection model to obtain a recognition result output by the video detection model and corresponding to each video frame, where the video detection model is obtained by training a preset model based on training data including supervision data, and the supervision data includes tag data of whether a sample video frame includes a key video element; and a determining unit 630 configured to determine whether the video to be detected is a stretched video according to a plurality of the recognition results respectively corresponding to the plurality of video frames.
Here, the operations of the above units 610 to 630 of the video detection apparatus 600 are similar to the operations of the steps 210 to 230 described above, respectively, and are not described again.
As shown in fig. 7, there is also provided a model training apparatus 700 according to an embodiment of the present disclosure, including: an acquisition unit 710 configured to acquire a plurality of pictures and determine whether each of the plurality of pictures is a stretched picture to generate training data; a determining unit 720 configured to determine whether each of the plurality of pictures contains a key picture element to generate supervision data of the training data; and a training unit 730 configured to train a preset model based on the training data including the supervision data, such that the model recognizes whether the inputted picture is a stretched picture.
Here, the operations of the above units 710 to 730 of the model training apparatus 700 are similar to the operations of the steps 310 to 330 described above, respectively, and are not repeated here.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related user personal information all conform to the regulations of related laws and regulations, and the public sequence is not violated.
According to embodiments of the present disclosure, there is also provided an electronic device, a readable storage medium and a computer program product.
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, 1302.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 or 300. For example, in some embodiments, the method 200 or 300 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 or 300 described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the method 200 or 300 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 detection method, comprising:
acquiring a plurality of video frames of a video to be detected;
inputting the plurality of video frames into a video detection model to obtain identification results which are output by the video detection model and respectively correspond to each video frame, wherein the video detection model is obtained by training a preset model based on training data comprising supervision data, the training data comprises labels which represent the stretching degree, and the supervision data comprises label data of whether a sample video frame comprises key video elements or not; and
and determining whether the video to be detected is a stretched video or not according to a plurality of identification results respectively corresponding to the video frames.
2. The method of claim 1, wherein the identification result is a numerical value,
wherein determining whether the video to be detected is a stretched video comprises:
acquiring a first number of identification results with the highest numerical value and a second number of identification results with the lowest numerical value in a plurality of identification results;
determining a first average value of the first number of recognition results and a second average value of the second number of recognition results respectively; and
and judging whether the video to be detected is a stretched video or not based on the first average value and the second average value.
3. The method of claim 2, wherein determining whether the video to be detected is a stretched video based on the first average and the second average comprises:
determining that the video to be detected is one of a longitudinal stretch and a transverse stretch in response to the first average being greater than a first threshold and the second average being greater than a second threshold; and
and determining the video to be detected as the other one of the longitudinal stretching and the transverse stretching in response to the first average value being smaller than a third threshold value and the second average value being smaller than a fourth threshold value.
4. The method of claim 1, further comprising: preprocessing the plurality of video frames to input the preprocessed plurality of video frames into a video detection model,
wherein the preprocessing comprises one or more of the group consisting of: normalization, equal aspect ratio scaling, boundary zero padding.
5. The method of any of claims 1-4, wherein the key video element comprises a human face.
6. A model training method, comprising:
acquiring a plurality of pictures and determining whether each of the plurality of pictures is a stretched picture to generate training data, wherein the training data comprises a label representing the stretching degree;
determining whether each picture of the plurality of pictures contains a key picture element to generate supervision data for the training data; and
training a preset model based on the training data including the supervision data such that the model identifies whether the inputted picture is a stretched picture.
7. A video detection apparatus comprising:
an acquisition unit configured to acquire a plurality of video frames of a video to be detected;
the detection unit is configured to input the plurality of video frames into a video detection model to obtain identification results which are output by the video detection model and respectively correspond to each video frame, wherein the video detection model is obtained by training a preset model based on training data comprising monitoring data, the training data comprises labels which represent stretching degrees, and the monitoring data comprises label data of whether a sample video frame comprises key video elements or not; and
and the determining unit is configured to determine whether the video to be detected is a stretched video according to a plurality of identification results respectively corresponding to the video frames.
8. The apparatus of claim 7, wherein the identification result is a numerical value,
wherein the determining unit includes:
means for obtaining a first number of recognition results having a highest numerical value and a second number of recognition results having a lowest numerical value among the plurality of recognition results;
means for determining a first average of the first number of recognition results and a second average of the second number of recognition results, respectively; and
and judging whether the video to be detected is a stretched video or not based on the first average value and the second average value.
9. The apparatus of claim 8, wherein means for determining whether the video to be detected is a stretched video based on the first average and the second average comprises:
means for determining that the video to be detected is one of a longitudinal stretch and a lateral stretch in response to the first average value being greater than a first threshold value and the second average value being greater than a second threshold value; and
and means for determining the video to be detected as the other of the longitudinal stretch and the transverse stretch in response to the first average being less than a third threshold and the second average being less than a fourth threshold.
10. The apparatus of claim 7, further comprising: a unit for preprocessing the plurality of video frames to input the preprocessed plurality of video frames into a video detection model,
wherein the preprocessing comprises one or more of the group consisting of: normalization, equal aspect ratio scaling, boundary zero padding.
11. The apparatus of any of claims 7-10, wherein the key video element comprises a human face.
12. A model training apparatus comprising:
an acquisition unit configured to acquire a plurality of pictures and determine whether each of the plurality of pictures is a stretched picture, to generate training data including a label indicating a degree of stretching;
a determining unit configured to determine whether each of the plurality of pictures contains a key picture element to generate supervision data of the training data; and
and the training unit is configured to train a preset model based on the training data containing the supervision data so that the model identifies whether the input picture is a stretched picture or not.
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-5 or claim 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-5 or claim 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110865078.XA CN113486853B (en) | 2021-07-29 | 2021-07-29 | Video detection method and device, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110865078.XA CN113486853B (en) | 2021-07-29 | 2021-07-29 | Video detection method and device, electronic equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113486853A CN113486853A (en) | 2021-10-08 |
CN113486853B true CN113486853B (en) | 2024-02-27 |
Family
ID=77943513
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110865078.XA Active CN113486853B (en) | 2021-07-29 | 2021-07-29 | Video detection method and device, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113486853B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114202728B (en) * | 2021-12-10 | 2022-09-02 | 北京百度网讯科技有限公司 | Video detection method, device, electronic equipment and medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108229331A (en) * | 2017-03-16 | 2018-06-29 | 北京市商汤科技开发有限公司 | Face false-proof detection method and system, electronic equipment, program and medium |
CN110889351A (en) * | 2019-11-18 | 2020-03-17 | 中国科学院深圳先进技术研究院 | Video detection method and device, terminal equipment and readable storage medium |
CN110991307A (en) * | 2019-11-27 | 2020-04-10 | 北京锐安科技有限公司 | Face recognition method, device, equipment and storage medium |
CN111291755A (en) * | 2020-02-13 | 2020-06-16 | 腾讯科技(深圳)有限公司 | Object detection model training method, object detection device, computer equipment and storage medium |
CN111541911A (en) * | 2020-04-21 | 2020-08-14 | 腾讯科技(深圳)有限公司 | Video detection method and device, storage medium and electronic device |
CN112150457A (en) * | 2020-10-09 | 2020-12-29 | 北京小米移动软件有限公司 | Video detection method, device and computer readable storage medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10019631B2 (en) * | 2015-11-05 | 2018-07-10 | Qualcomm Incorporated | Adapting to appearance variations when tracking a target object in video sequence |
US10282827B2 (en) * | 2017-08-10 | 2019-05-07 | Wipro Limited | Method and system for removal of rain streak distortion from a video |
-
2021
- 2021-07-29 CN CN202110865078.XA patent/CN113486853B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108229331A (en) * | 2017-03-16 | 2018-06-29 | 北京市商汤科技开发有限公司 | Face false-proof detection method and system, electronic equipment, program and medium |
CN110889351A (en) * | 2019-11-18 | 2020-03-17 | 中国科学院深圳先进技术研究院 | Video detection method and device, terminal equipment and readable storage medium |
CN110991307A (en) * | 2019-11-27 | 2020-04-10 | 北京锐安科技有限公司 | Face recognition method, device, equipment and storage medium |
CN111291755A (en) * | 2020-02-13 | 2020-06-16 | 腾讯科技(深圳)有限公司 | Object detection model training method, object detection device, computer equipment and storage medium |
CN111541911A (en) * | 2020-04-21 | 2020-08-14 | 腾讯科技(深圳)有限公司 | Video detection method and device, storage medium and electronic device |
CN112150457A (en) * | 2020-10-09 | 2020-12-29 | 北京小米移动软件有限公司 | Video detection method, device and computer readable storage medium |
Non-Patent Citations (2)
Title |
---|
基于深度学习的无人机目标识别算法研究;何志祥;胡俊伟;;滨州学院学报(02);全文 * |
针对畸变行人检测的神经网络;张姣;肖江剑;周传宏;;计量与测试技术(09);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113486853A (en) | 2021-10-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114648638B (en) | Training method of semantic segmentation model, semantic segmentation method and device | |
CN112749685B (en) | Video classification method, apparatus and medium | |
CN112749758B (en) | Image processing method, neural network training method, device, equipment and medium | |
CN113256583A (en) | Image quality detection method and apparatus, computer device, and medium | |
CN114004985B (en) | Character interaction detection method, neural network, training method, training equipment and training medium thereof | |
CN112650885A (en) | Video classification method, device, equipment and medium | |
CN114445667A (en) | Image detection method and method for training image detection model | |
CN113810765B (en) | Video processing method, device, equipment and medium | |
CN113486853B (en) | Video detection method and device, electronic equipment and medium | |
CN114547252A (en) | Text recognition method and device, electronic equipment and medium | |
CN113723305A (en) | Image and video detection method, device, electronic equipment and medium | |
CN115170887B (en) | Target detection model training method, target detection method and target detection device | |
CN116152607A (en) | Target detection method, method and device for training target detection model | |
CN114140852B (en) | Image detection method and device | |
CN114219046B (en) | Model training method, matching method, device, system, electronic equipment and medium | |
CN114842476A (en) | Watermark detection method and device and model training method and device | |
CN114494797A (en) | Method and apparatus for training image detection model | |
CN114998963A (en) | Image detection method and method for training image detection model | |
CN114550269A (en) | Mask wearing detection method, device and medium | |
CN114429678A (en) | Model training method and device, electronic device and medium | |
CN113627534A (en) | Method and device for identifying type of dynamic image and electronic equipment | |
CN114120420B (en) | Image detection method and device | |
CN114140851B (en) | Image detection method and method for training image detection model | |
CN116070711B (en) | Data processing method, device, electronic equipment and storage medium | |
CN114842474B (en) | Character recognition method, 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 |