WO2021026775A1 - 神经网络数据流加速方法、装置、计算机设备及存储介质 - Google Patents
神经网络数据流加速方法、装置、计算机设备及存储介质 Download PDFInfo
- Publication number
- WO2021026775A1 WO2021026775A1 PCT/CN2019/100402 CN2019100402W WO2021026775A1 WO 2021026775 A1 WO2021026775 A1 WO 2021026775A1 CN 2019100402 W CN2019100402 W CN 2019100402W WO 2021026775 A1 WO2021026775 A1 WO 2021026775A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data stream
- hardware
- neural network
- video data
- acceleration
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
- H04N19/436—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation using parallelised computational arrangements
Definitions
- This application relates to the field of artificial intelligence technology, in particular to neural network data stream acceleration methods, devices, computer equipment, and storage media.
- the mainstream streaming media (such as video stream, audio stream, etc.) acceleration framework on the market uses a main control CPU, which will call a dedicated video stream video codec chip or SOC module for video acquisition and video decoding, and then decode it
- the finished picture uses GPU or TPU acceleration chips for artificial intelligence analysis, especially the use of deep learning neural networks for recognition, prediction, etc.
- the final result will be analyzed or stored by the main control CPU.
- the existing technical solutions have disadvantages such as high cost and high power consumption by using GPU or TPU for hardware acceleration.
- problems such as insufficient hardware utilization, too much communication data between chips, and low efficiency.
- the commonly used GPU for neural network acceleration also has high cost and high power consumption. problem.
- the purpose of the embodiments of the present application is to propose a neural network data stream acceleration method, device, computer equipment, and storage medium, so as to reduce the cost and power consumption of neural network data stream processing, and improve the data stream processing efficiency.
- an embodiment of the present application provides a neural network data flow method, which adopts the following technical solutions:
- the step of obtaining a video data stream includes:
- step of hardware decoding the video data stream includes:
- the video data stream is decoded by the built-in graphics processing unit of the chip.
- the method further includes the steps:
- the step of configuring hardware resources based on the neural network structure, and performing hardware acceleration of the data stream on the video data stream decoded by the hardware through the configured hardware resources includes:
- the method further includes the steps:
- the output result of the neural network is post-processed.
- an embodiment of the present application also provides a neural network data stream acceleration device, which adopts the following technical solutions:
- the neural network data stream acceleration device includes:
- a decoding module for hardware decoding the video data stream
- An acceleration module configured to configure hardware resources based on the structure of a neural network, and perform data stream hardware acceleration on the video data stream decoded by the hardware through the configured hardware resources;
- the output module is used to input the data accelerated by the data stream hardware to the neural network and output the result.
- the acquisition module includes:
- the obtaining subunit is used to obtain the video data stream from a webcam or a video stream server.
- the embodiments of the present application also provide a computer device, which adopts the following technical solutions:
- the computer device includes a memory and a processor, and a computer program is stored in the memory.
- the processor executes the computer program, the neural network data stream acceleration method according to any one of the embodiments of the present application is implemented A step of.
- the embodiments of the present application also provide a computer-readable storage medium, which adopts the following technical solutions:
- a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the neural network data stream acceleration method proposed in any one of the embodiments of the present application are implemented.
- the embodiments of the present application mainly have the following beneficial effects: obtain a video data stream; perform hardware decoding on the video data stream; configure hardware resources based on the structure of a neural network, and decode the video after the hardware
- the data flow is hardware accelerated through the configured hardware resources; the data after the hardware acceleration of the data flow is input to the neural network and the result is output.
- the neural network processing data stream is improved Efficiency and reduce cost and power consumption.
- Fig. 1 is a flowchart of an embodiment of a neural network data stream acceleration method according to the present application
- FIG. 2 is a flowchart of a specific implementation of step 103 in FIG. 1;
- Fig. 3 is a schematic structural diagram of an embodiment of a neural network data stream acceleration device according to the present application.
- Fig. 4 is a schematic structural diagram of an embodiment of a computer device according to the present application.
- Fig. 1 shows a flowchart of an embodiment of a neural network data flow acceleration method according to the present application.
- the neural network data flow acceleration method includes the following steps:
- Step 101 Obtain a video data stream.
- the video data stream is a continuous picture frame, such as an RGB picture, which is divided into blocks and then encoded.
- the method of obtaining can be obtained from a local or web camera, from other video streaming servers, etc., through wired or wireless methods. .
- Step 102 Perform hardware decoding on the video data stream.
- decoding basically performs the completely opposite process of the encoding process, and the design of the video codec is usually standardized, that is, the published encoding document accurately regulates how the decoding is performed.
- the video data stream can be decoded by hardware through the chip's built-in graphics processing unit or a dedicated decoder, which improves decoding efficiency and resource utilization.
- Step 103 Configure hardware resources based on the structure of the neural network, and perform data stream hardware acceleration on the video data stream decoded by the hardware through the configured hardware resources.
- the neural network includes a neural network graph (neural network structure) and parameters corresponding to the structure.
- the structure of the neural network uses layers as the calculation unit, including but not limited to convolutional layers, pooling layers, and ReLU (Activation function), fully connected layer, etc.
- each layer in the neural network structure also has a large number of parameters, including but not limited to: weight (weight), bias (bias), etc.
- weight weight
- bias bias
- Step 104 Input the hardware accelerated data of the data stream to the neural network and output the result.
- the neural network may be a deep learning model for object detection, target recognition, position prediction, etc., such as faster-RCNN, Yolo, SSD, etc.
- the video data stream is acquired; the video data stream is decoded by hardware; the hardware resources are configured based on the structure of the neural network, and the video data stream after the hardware decoding is performed through the configured hardware resources Data stream hardware acceleration; input the data after the data stream hardware acceleration to the neural network and output the result.
- the neural network processing data stream is improved Efficiency and reduce cost and power consumption.
- step 101 may include:
- Step 1011 Obtain the video data stream from a webcam or a video stream server.
- the method of obtaining the video data stream can be obtained from a local or web camera or network video streaming server through a wired or wireless method through a video streaming protocol such as HTTP or RTSP, and save it to the local memory In space.
- a video streaming protocol such as HTTP or RTSP
- step 102 may include the following steps:
- Step 1021 The video data stream is decoded by the built-in graphics processing unit of the chip.
- the first step of a typical digital video codec is to convert the video input from the camera from RGB color space to YCbCr color space, and it is usually accompanied by chroma sampling to generate 4:2:0 format video. (Sometimes 4:2:2 sampling is used in the case of interlaced scanning). Converting to YCbCr chrominance space will bring two benefits: first, this partially removes the correlation in the chrominance signal and improves the compressibility; second, it separates the luminance signal, and the luminance signal is The visual perception is the most important. Relatively speaking, the chrominance signal is not so important to the visual perception. It can be sampled to a lower resolution (4:2:0 or 4:2:2) without affecting the perception of people.
- sampling the space or time domain can effectively reduce the data volume of the original video data.
- the input video image is usually divided into macroblocks for encoding respectively, and the size of the macroblock is usually 16x16 luminance block information and corresponding chrominance block information.
- block motion compensation to predict the data of the current frame from the encoded frame.
- block transform or subband decomposition is used to reduce the statistical correlation in the spatial domain.
- the most common transform is the 8x8 discrete cosine transform (DCT fordiscrete cosine transform).
- DCT discrete cosine transform
- the quantized two-dimensional coefficients when using DCT transform, usually use Zig-zag scanning to express the coefficients as one-dimensional, and then encode the number of consecutive 0 coefficients and the size of non-zero coefficients (Level) Get a symbol, usually there is also a special symbol to indicate that all the remaining coefficients are equal to 0.
- Entropy coding at this time usually uses variable length coding.
- the design of the video codec is usually standardized, that is to say, the published code document accurately regulates how the decoding is performed.
- the code stream coded by the A encoder can be decoded by the B decoder, and vice versa
- the encoding process is not completely defined by a standard. Users have the freedom to design their own encoder, as long as the code stream generated by the encoder designed by the user conforms to the decoding specification.
- the decoding process is basically the opposite of the encoding process, that is, the graphics processing unit GPU that comes with the chip (such as Intel central processing unit, etc.) can be used to decode the obtained video data stream according to the encoding specification, so as to obtain the decoded Continuous RGBA picture frame or YUV420 picture frame.
- the graphics processing unit GPU that comes with the chip (such as Intel central processing unit, etc.) can be used to decode the obtained video data stream according to the encoding specification, so as to obtain the decoded Continuous RGBA picture frame or YUV420 picture frame.
- step 102 of hardware decoding the video data stream hardware resources are configured based on the structure of the neural network, and the video data stream after the hardware decoding is processed through the configured hardware resources.
- step 103 of streaming hardware acceleration the method further includes the steps:
- step 103 specifically includes the following steps:
- Step 1031 Obtain the structure of the neural network.
- the structure of the neural network is based on the layer as the computing unit, including but not limited to the input layer, convolutional layer, pooling layer, ReLU (activation function), fully connected layer, etc.
- different neural networks use different types and different numbers
- the layers are combined to form a neural network structure with different functions.
- each layer in the neural network structure also has a large number of parameters, including but not limited to: weight (weight), bias (bias), etc.
- Step 1032 Dynamically allocate hardware resources according to the structure of the neural network and optimize the timing of the hardware resources.
- Step 1033 Use the hardware resource to perform data stream acceleration on the video data stream decoded by the hardware.
- the hardware resources required by the corresponding structure can be dynamically allocated.
- the corresponding calculation unit is allocated to perform Calculate operations and store the calculation results through the register cache unit, which is convenient for the next layer to quickly read, save data copy time, accelerate the calculation speed of the neural network, and optimize the timing of the neural network calculation through the pipeline unit.
- Hardware acceleration is performed on the video data stream, thereby improving the efficiency of the neural network to process the data stream and reducing power consumption.
- the method further includes the steps:
- the output result of the neural network is post-processed.
- the output result of the neural network is the feature value, which can be understood as an abstract representation of the input picture or data.
- Post-processing is mainly to convert the abstract representation, that is, the feature value into a meaningful output, such as classification.
- the computer program can be stored in a computer readable storage medium. When executed, it may include the processes of the above-mentioned method embodiments.
- the aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disc, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.
- this application provides an embodiment of a neural network data stream acceleration device.
- the device embodiment corresponds to the method embodiment shown in FIG.
- the device can be specifically applied to various electronic devices.
- the neural network data stream acceleration device 200 in this embodiment includes: an acquisition module 201, a decoding module 202, an acceleration module 203, and an output module 204. among them:
- the obtaining module 201 is used to obtain a video data stream
- the decoding module 202 is configured to perform hardware decoding on the video data stream
- the acceleration module 203 is configured to configure hardware resources based on the structure of a neural network, and perform data stream hardware acceleration on the video data stream decoded by the hardware through the configured hardware resources;
- the output module 204 is configured to input the data accelerated by the data stream hardware to the neural network and output the result.
- the above-mentioned obtaining module 201 includes: an obtaining subunit, configured to obtain the video data stream from a webcam or a video stream server.
- the above-mentioned apparatus 200 may further include: a pre-processing module and a post-processing module, where:
- the pre-processing module is used for pre-processing the video data stream after hardware decoding.
- the post-processing module is used for post-processing the output result of the neural network.
- the neural network data stream acceleration device provided by the embodiment of the present application can realize the various implementation manners in the method embodiment of FIG. 1 and the corresponding beneficial effects. To avoid repetition, details are not repeated here.
- FIG. 4 is a block diagram of the basic structure of the computer device in this embodiment.
- the computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are connected to each other in communication via a system bus. It should be pointed out that the figure only shows the computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions. Its hardware includes but is not limited to microprocessors, dedicated Integrated Circuit (Application Specific Integrated Circuit, ASIC), Programmable Gate Array (Field-Programmable Gate Array, FPGA), Digital Processor (Digital Signal Processor, DSP), embedded devices, etc.
- ASIC Application Specific Integrated Circuit
- FPGA Field-Programmable Gate Array
- DSP Digital Processor
- the computer device may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
- the computer device can interact with the user through a keyboard, a mouse, a remote control, a touch panel, or a voice control device.
- the memory 41 includes at least one type of readable storage medium, the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static Random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disks, optical disks, etc.
- the memory 41 may be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4.
- the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 16, a smart media card (SMC), a secure digital (Secure Digital, SD) card, Flash Card, etc.
- the memory 41 may also include both the internal storage unit of the computer device 4 and its external storage device.
- the memory 41 is generally used to store the operating system and various application software installed in the computer device 4, such as the program code of the neural network data stream acceleration method.
- the memory 41 can also be used to temporarily store various types of data that have been output or will be output.
- the processor 42 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments.
- the processor 42 is generally used to control the overall operation of the computer device 4.
- the processor 42 is configured to run the program code stored in the memory 41 or process data, for example, run the program code of the neural network data flow acceleration method.
- the network interface 43 may include a wireless network interface or a wired network interface, and the network interface 43 is usually used to establish a communication connection between the computer device 4 and other electronic devices.
- This application also provides another implementation manner, that is, a computer-readable storage medium that stores a neural network data stream acceleration program, and the neural network data stream acceleration program can be processed by at least one The processor executes, so that the at least one processor executes the steps of the neural network data stream acceleration method described above.
- the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. ⁇
- the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, The optical disc) includes several instructions to enable a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the method described in each embodiment of the present application.
Landscapes
- Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
Claims (10)
- 一种神经网络数据流加速方法,其特征在于,包括:获取视频数据流;将所述视频数据流进行硬件解码;基于神经网络的结构配置硬件资源,并将所述硬件解码后的视频数据流通过所述配置后的硬件资源进行数据流硬件加速;将所述数据流硬件加速后的数据输入到所述神经网络并输出结果。
- 如权利要求1所述的方法,其特征在于,所述获取视频数据流的步骤包括:从网络摄像头或视频流服务器获取所述视频数据流。
- 如权利要求1所述的方法,其特征在于,所述将所述视频数据流进行硬件解码的步骤包括:将所述视频数据流通过芯片自带图形处理单元进行解码。
- 如权利要求3所述的方法,其特征在于,在所述将所述视频数据流进行硬件解码的步骤之后,基于神经网络的结构配置硬件资源,并将所述硬件解码后的视频数据流通过所述配置后的硬件资源进行数据流硬件加速的步骤之前,所述方法还包括步骤:将所述进行硬件解码后的视频数据流进行前处理。
- 如权利要求4所述的方法,其特征在于,所述基于神经网络的结构配置硬件资源,并将所述硬件解码后的视频数据流通过所述配置后的硬件资源进行数据流硬件加速的步骤包括:获取所述神经网络的结构;根据所述神经网络的结构动态分配硬件资源并对硬件资源进行时序优化;使用所述硬件资源对所述硬件解码后的视频数据流进行数据流加速。
- 如权利要求5所述的方法,其特征在于,在所述将所述数据流硬件加速后的数据输入到所述神经网络并输出结果的步骤之后,所述方法还包括步骤:将所述神经网络的输出结果进行后处理。
- 一种神经网络数据流加速装置,其特征在于,包括:获取模块,用于获取视频数据流;解码模块,用于将所述视频数据流进行硬件解码;加速模块,用于基于神经网络的结构配置硬件资源,并将所述硬件解码后的视频数据流通过所述配置后的硬件资源进行数据流硬件加速;输出模块,用于将所述数据流硬件加速后的数据输入到所述神经网络并输出结果。
- 如权利要求7所述装置,其特征在于,所述获取模块包括:获取子单元,用于从网络摄像头或视频流服务器获取所述视频数据流。
- 一种计算机设备,其特征在于,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器执行所述计算机程序时实现如权利要求1至6中任一项所述的神经网络数据流加速方法的步骤。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至6中任一项所述的神经网络数据流加速方法的步骤。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201980066983.XA CN115462079A (zh) | 2019-08-13 | 2019-08-13 | 神经网络数据流加速方法、装置、计算机设备及存储介质 |
PCT/CN2019/100402 WO2021026775A1 (zh) | 2019-08-13 | 2019-08-13 | 神经网络数据流加速方法、装置、计算机设备及存储介质 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/100402 WO2021026775A1 (zh) | 2019-08-13 | 2019-08-13 | 神经网络数据流加速方法、装置、计算机设备及存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021026775A1 true WO2021026775A1 (zh) | 2021-02-18 |
Family
ID=74570853
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/100402 WO2021026775A1 (zh) | 2019-08-13 | 2019-08-13 | 神经网络数据流加速方法、装置、计算机设备及存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115462079A (zh) |
WO (1) | WO2021026775A1 (zh) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160179898A1 (en) * | 2011-11-24 | 2016-06-23 | Alibaba Group Holding Limited | Distributed data stream processing method and system |
CN107067365A (zh) * | 2017-04-25 | 2017-08-18 | 中国石油大学(华东) | 基于深度学习的分布嵌入式实时视频流处理系统及方法 |
CN108012156A (zh) * | 2017-11-17 | 2018-05-08 | 深圳市华尊科技股份有限公司 | 一种视频处理方法及控制平台 |
CN108520296A (zh) * | 2018-03-20 | 2018-09-11 | 福州瑞芯微电子股份有限公司 | 一种基于深度学习芯片动态cache分配的方法和装置 |
-
2019
- 2019-08-13 CN CN201980066983.XA patent/CN115462079A/zh active Pending
- 2019-08-13 WO PCT/CN2019/100402 patent/WO2021026775A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160179898A1 (en) * | 2011-11-24 | 2016-06-23 | Alibaba Group Holding Limited | Distributed data stream processing method and system |
CN107067365A (zh) * | 2017-04-25 | 2017-08-18 | 中国石油大学(华东) | 基于深度学习的分布嵌入式实时视频流处理系统及方法 |
CN108012156A (zh) * | 2017-11-17 | 2018-05-08 | 深圳市华尊科技股份有限公司 | 一种视频处理方法及控制平台 |
CN108520296A (zh) * | 2018-03-20 | 2018-09-11 | 福州瑞芯微电子股份有限公司 | 一种基于深度学习芯片动态cache分配的方法和装置 |
Also Published As
Publication number | Publication date |
---|---|
CN115462079A (zh) | 2022-12-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108780499B (zh) | 基于量化参数的视频处理的系统和方法 | |
EP3746944A1 (en) | Use of non-linear function applied to quantization parameters in machine-learning models for video coding | |
WO2021208247A1 (zh) | 一种视频图像的拟态压缩方法、装置、存储介质及终端 | |
CN105163127A (zh) | 视频分析方法及装置 | |
CN111182303A (zh) | 共享屏幕的编码方法、装置、计算机可读介质及电子设备 | |
CN111614956B (zh) | Dc系数符号代码化方案 | |
CN112203088B (zh) | 用于非基带信号代码化的变换选择 | |
WO2019027523A1 (en) | SCANNING ORDER ADAPTATION FOR ENTROPY ENCODING IMAGE DATA BLOCKS | |
CN107018416B (zh) | 用于视频和图像压缩的自适应贴片数据大小编码 | |
CN109429066A (zh) | 视频编码装置和视频编码系统 | |
WO2018222238A1 (en) | Improved coding of intra-prediction modes | |
CN109495742B (zh) | 一种视频帧编码方法、装置及设备 | |
WO2023142715A1 (zh) | 视频编码方法、实时通信方法、装置、设备及存储介质 | |
WO2023143349A1 (zh) | 一种面部视频编码方法、解码方法及装置 | |
Zhang et al. | Globally variance-constrained sparse representation and its application in image set coding | |
WO2021026775A1 (zh) | 神经网络数据流加速方法、装置、计算机设备及存储介质 | |
CN116567246A (zh) | Avc编码方法和装置 | |
WO2022100140A1 (zh) | 一种压缩编码、解压缩方法以及装置 | |
CN115442617A (zh) | 一种基于视频编码的视频处理方法和装置 | |
WO2022258055A1 (zh) | 点云属性信息编码方法、解码方法、装置及相关设备 | |
WO2023025024A1 (zh) | 点云属性编码方法、点云属性解码方法及终端 | |
WO2022258009A1 (zh) | 熵编码、解码方法及装置 | |
WO2024007977A1 (zh) | 图像处理方法、装置及设备 | |
WO2023078204A1 (zh) | 数据处理方法、装置、设备、可读存储介质及程序产品 | |
WO2023098807A1 (zh) | 点云编、解码处理方法、装置、编码设备及解码设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19941138 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19941138 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 05-04-2022) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19941138 Country of ref document: EP Kind code of ref document: A1 |