Skip to content

Commit

Permalink
polish to CUDA feature
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxinfeng committed Jun 13, 2024
1 parent b0768f4 commit 239710c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,15 @@ cap = ffmpegcv.VideoCaptureCAM("Integrated Camera")

Deeplearning pipeline.
```python
# video -> crop -> resize -> RGB -> CUDA:CHW float32 -> model
"""
—————————— NVIDIA GPU accelerating ⤴⤴ ———————
| |
V V
video -> decode -> crop -> resize -> RGB -> CUDA:CHW float32 -> model
"""
cap = ffmpegcv.toCUDA(
ffmpegcv.VideoCaptureNV(file, pix_fmt='nv12', resize=(W,H)),
tensor_format='CHW')
tensor_format='chw')

for frame_CHW_cuda in cap:
frame_CHW_cuda = (frame_CHW_cuda - mean) / std
Expand Down
9 changes: 7 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,15 @@ cap = ffmpegcv.VideoCaptureCAM("Integrated Camera")

深度学习流水线
```python
# video -> crop -> resize -> RGB -> CUDA:CHW float32 -> model
"""
—————————— NVIDIA GPU 加速 ⤴⤴ ———————
| |
V V
视频 -> 解码器 -> 裁剪 -> 缩放 -> RGB -> CUDA:CHW float32 -> 模型
"""
cap = ffmpegcv.toCUDA(
ffmpegcv.VideoCaptureNV(file, pix_fmt='nv12', resize=(W,H)),
tensor_format='CHW')
tensor_format='chw')

for frame_CHW_cuda in cap:
frame_CHW_cuda = (frame_CHW_cuda - mean) / std
Expand Down
2 changes: 1 addition & 1 deletion ffmpegcv/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__='0.3.13a'
__version__='0.3.14'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='ffmpegcv', # 应用名
version='0.3.13a', # 版本号
version='0.3.14', # 版本号
packages=find_packages(include=['ffmpegcv*']), # 包括在安装包内的 Python 包
author='chenxf',
author_email='[email protected]',
Expand Down

0 comments on commit 239710c

Please sign in to comment.