提交 63049587 编写于 作者: B BohaoWu

Add doc for hw-frame-extract.

上级 80002a36
# hwvideoframe # hwvideoframe
Hwvideoframe is a CV preprocessing library based on cuda. The project uses GPU for image preprocessing operations. It speeds up the processing speed while increasing the utilization rate of the GPU. Hwvideoframe is a CV preprocessing library based on cuda. The project uses GPU for image preprocessing operations. It speeds up the processing speed while increasing the utilization rate of the GPU.
## Preprocess API ## Preprocess API
Hwvideoframe provides a variety of data preprocessing methods for photo preprocess: Hwvideoframe provides a variety of data preprocessing methods for photo preprocess:
- class Image2Gpubuffer - class Image2Gpubuffer
...@@ -31,8 +33,8 @@ Hwvideoframe provides a variety of data preprocessing methods for photo preproce ...@@ -31,8 +33,8 @@ Hwvideoframe provides a variety of data preprocessing methods for photo preproce
- class Normalize - class Normalize
- `__init__(mean,std)` - `__init__(mean,std)`
- mean(list):Length of list must be three. - mean(list):Mean. Length of list must be three.
- std(list):Length of list must be three. - std(list):Variance. Length of list must be three.
- `__call__(img)` - `__call__(img)`
- img(np.array):Image data in (C,H,W) channels. - img(np.array):Image data in (C,H,W) channels.
...@@ -51,7 +53,9 @@ Hwvideoframe provides a variety of data preprocessing methods for photo preproce ...@@ -51,7 +53,9 @@ Hwvideoframe provides a variety of data preprocessing methods for photo preproce
- img(numpy array):Image data in (C,H,W) channels. - img(numpy array):Image data in (C,H,W) channels.
## Quick start ## Quick start
[After compiling from code](https://github.com/PaddlePaddle/Serving/blob/develop/doc/COMPILE.md),this project will be stored in reader。 [After compiling from code](https://github.com/PaddlePaddle/Serving/blob/develop/doc/COMPILE.md),this project will be stored in reader。
## How to Test ## How to Test
Test file:Serving/python/paddle_serving_app/reader/test_preprocess.py Test file:Serving/python/paddle_serving_app/reader/test_preprocess.py
# hw-frame-extract # hw-frame-extract
hw-frame-extract is a CV preprocessing library based on cuda. The project uses GPU for extracting frame from video. It speeds up the processing speed while increasing the utilization rate of the GPU.
## Preprocess API
Hwvideoframe provides a variety of cutting frame methods for different kind of video:
- class HwExtractFrameJpeg
- `init_handler(gpu_index)`
- gpu_index (int):Index of gpu.
- `extract_frame(file_path, n)`
- file_path (string): Video path.
- n (int): Cut n frames in one second.
- class HwExtractFrameBGRARaw
- `init_handler(gpu_index)`
- gpu_index (int):Index of gpu.
- `extract_frame(file_path, n)`
- file_path (string): Video path.
- n (int): Cut n frames in one second.
- class HwFrameResult
- `height()`
- Return height of frame.
- `width()`
- Return width of frame.
- `len()`
- Return len of frame.
- `free_memory()`
- Free memory of frames.
## Quick start
[After compiling from code](https://github.com/PaddlePaddle/Serving/blob/develop/doc/COMPILE.md),this project will be stored in reader。
## How to Test
Test file:Serving/python/paddle_serving_app/reader/test_preprocess.py
...@@ -20,4 +20,4 @@ from .lac_reader import LACReader ...@@ -20,4 +20,4 @@ from .lac_reader import LACReader
from .senta_reader import SentaReader from .senta_reader import SentaReader
from libgpupreprocess import Image2Gpubuffer, Gpubuffer2Image, RGB2BGR, BGR2RGB from libgpupreprocess import Image2Gpubuffer, Gpubuffer2Image, RGB2BGR, BGR2RGB
from libgpupreprocess import Div, Sub, Normalize, CenterCrop, Resize, ResizeByFactor from libgpupreprocess import Div, Sub, Normalize, CenterCrop, Resize, ResizeByFactor
from libhwextract import HwExtractFrameJpeg, HwExtractFrameBGRARaw from libhwextract import HwExtractFrameJpeg, HwExtractFrameBGRARaw, HwFrameResult
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册