提交 2c70a684 编写于 作者: B BohaoWu

Add Doc for hwvideoframe.

上级 5b17d40c
# hwvideoframe
hwvideoframe是一个基于cuda的图片预处理库。项目利用GPU进行图片预处理操作,加快处理速度的同时,提高GPU的使用率。
## 项目结构
hwvideoframe通过cpp的
hwvideoframe目前提供以下图片预处理功能:
* Image2Gpubuffer
* Gpubuffer2Image
* RGB2BGR
* BGR2RGB
* Div
* Sub
* Normalize
* CenterCrop
* Resize
* ResizeByFactor
## 快速开始
按照Paddle Serving文档编译,编译结果在reader中。
## 测试
测试文件:Serving/python/paddle_serving_app/reader/test_preprocess.py
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
Hwvideoframe provides a variety of data preprocessing methods for photo preprocess:
- class Image2Gpubuffer
- `__call__(img)`
- img(np.array):Image data.
- class Gpubuffer2Image
- `__call__(img)`
- img(np.array):Image data.
- class Div
- `__init__(value)`
- value(float):Constant value to be divided.
- `__call__(img)`
- img(np.array):Image data.
- class Sub
- `__init__(subtractor)`
- subtractor(list/float):Three 32-bit floating point channel image subtract constant. When the input is a list type, length of list must be three.
- `__call__(img)`
- img(np.array):Image data in (C,H,W) channels.
- class Normalize
- `__init__(mean,std)`
- mean(list):Length of list must be three.
- std(list):Length of list must be three.
- `__call__(img)`
- img(np.array):Image data in (C,H,W) channels.
- class CenterCrop
- `__init__(size)`
- size(int):Crops the given Image at the center while the size must not bigger than any inputs' height and width.
- `__call__(img)`
- img(np.array):Image data in (C,H,W) channels.
- class Resize
- `__init__(size, max_size=2147483647, interpolation=None)`
- size(list/int):The expected image size, when the input is a list type, it needs to contain the expected length and width. When the input is int type, the short side will be set to the length of size, and the long side will be scaled proportionally.
- `__call__(img)`
- img(numpy array):Image data in (C,H,W) channels.
## 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
# hwvideoframe
hwvideoframe是一个基于cuda的图片预处理库。项目利用GPU进行图片预处理操作,在加快处理速度的同时,提高GPU的使用率。
## 项目结构
hwvideoframe目前提供以下图片预处理功能:
- class Image2Gpubuffer
- `__call__(img)`
- img(np.array):输入图像。
- class Gpubuffer2Image
- `__call__(img)`
- img(np.array):输入图像。
- class Div
- `__init__(value)`
- value(float):根据固定值切割图像。
- `__call__(img)`
- img(np.array):输入图像。
- class Sub
- `__init__(subtractor)`
- subtractor(list/float):list的长度必须为3。
- `__call__(img)`
- img(np.array):(C,H,W)排列的图像数据。
- class Normalize
- `__init__(mean,std)`
- mean(list):均值。 list长度必须为3。
- std(list):方差。 list长度必须为3。
- `__call__(img)`
- img(np.array):(C,H,W)排列的图像数据。
- class CenterCrop
- `__init__(size)`
- size(int):预期的裁剪后的大小,list类型时需要包含预期的长和宽,int类型时会返回边长为size的正方形图片。size不能大于原始图片大小。
- `__call__(img)`
- img(np.array):(C,H,W)排列的图像数据
- class Resize
- `__init__(size, max_size=2147483647, interpolation=None)`
- size(list/int):预期的图像大小,短边会设置为size的长度,长边按比例缩放.
- `__call__(img)`
- img(numpy array):(C,H,W)排列的图像数据
## 快速开始
按照Paddle Serving文档编译,编译结果在reader中。
## 测试
测试文件:Serving/python/paddle_serving_app/reader/test_preprocess.py
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册