Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refining the README #31

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# DAIN ncnn Vulkan

ncnn implementation of DAIN, Depth-Aware Video Frame Interpolation.
An ncnn implementation of DAIN, Depth-Aware Video Frame Interpolation.

dain-ncnn-vulkan uses [ncnn project](https://github.com/Tencent/ncnn) as the universal neural network inference framework.
dain-ncnn-vulkan uses the [ncnn project](https://github.com/Tencent/ncnn) as the universal neural network inference framework.

## [Download]
## Download

Download Windows/Linux/MacOS Executable for Intel/AMD/Nvidia GPU
Download the Windows/Linux/MacOS executable for Intel/AMD/Nvidia GPUs:

**https://github.com/nihui/dain-ncnn-vulkan/actions**

This package includes all the binaries and models required. It is portable, so no CUDA or Caffe runtime environment is needed :)
Packages include all the binaries and models required. It is portable, so no CUDA or Caffe runtime environment is needed :)

## About DAIN

Expand All @@ -26,7 +26,7 @@ https://sites.google.com/view/wenbobao/dain

http://arxiv.org/abs/1904.00830

## Usages
## Usage

Input two frame images, output one interpolated frame image.

Expand Down Expand Up @@ -59,7 +59,7 @@ ffmpeg -i input.mp4 input_frames/frame_%06d.png
ffmpeg -framerate 48 -i output_frames/%06d.png -i audio.m4a -c:a copy -crf 20 -c:v libx264 -pix_fmt yuv420p output.mp4
```

### Full Usages
### Full Usage

```console
Usage: dain-ncnn-vulkan -0 infile -1 infile1 -o outfile [options]...
Expand All @@ -80,12 +80,12 @@ Usage: dain-ncnn-vulkan -0 infile -1 infile1 -o outfile [options]...
-f pattern-format output image filename pattern format (%08d.jpg/png/webp, default=ext/%08d.png)
```

- `input0-path`, `input1-path` and `output-path` accept file path
- `input-path` and `output-path` accept file directory
- `input0-path`, `input1-path` and `output-path` accept file paths
- `input-path` and `output-path` accept file directories
- `num-frame` = target frame count
- `time-step` = interpolation time
- `tile-size` = tile size, use smaller value to reduce GPU memory usage, must be multiple of 32, default 256
- `load:proc:save` = thread count for the three stages (image decoding + dain interpolation + image encoding), using larger values may increase GPU usage and consume more GPU memory. You can tune this configuration with "4:4:4" for many small-size images, and "2:2:2" for large-size images. The default setting usually works fine for most situations. If you find that your GPU is hungry, try increasing thread count to achieve faster processing.
- `tile-size` = tile size, use a smaller value to reduce GPU memory usage, it must be multiple of 32, default is 256
- `load:proc:save` = thread count for the three stages (image decoding -> dain interpolation -> image encoding), using larger values may increase GPU usage and consume more GPU memory. You can tune this configuration with "4:4:4" for many small-size images, and "2:2:2" for large-size images. The default setting usually works fine for most situations. If you find that your GPU is hungry, try increasing thread count to achieve faster processing.
- `pattern-format` = the filename pattern and format of the image to be output, png is better supported, however webp generally yields smaller file sizes, both are losslessly encoded

If you encounter a crash or error, try upgrading your GPU driver:
Expand All @@ -94,16 +94,20 @@ If you encounter a crash or error, try upgrading your GPU driver:
- AMD: https://www.amd.com/en/support
- NVIDIA: https://www.nvidia.com/Download/index.aspx

## Build from Source
## Building from Source

1. Download and setup the Vulkan SDK from https://vulkan.lunarg.com/
- For Linux distributions, you can either get the essential build requirements from package manager
- For Linux distributions, you can also get the essential build requirements from your package manager

Fedora/CentOS/RHEL:
```shell
dnf install vulkan-headers vulkan-loader-devel
```
Debian/Ubuntu
```shell
apt-get install libvulkan-dev
```
Arch/Manjaro
```shell
pacman -S vulkan-headers vulkan-icd-loader
```
Expand Down Expand Up @@ -139,5 +143,5 @@ cmake --build . -j 4

- https://github.com/Tencent/ncnn for fast neural network inference on ALL PLATFORMS
- https://github.com/webmproject/libwebp for encoding and decoding Webp images on ALL PLATFORMS
- https://github.com/nothings/stb for decoding and encoding image on Linux / MacOS
- https://github.com/tronkko/dirent for listing files in directory on Windows
- https://github.com/nothings/stb for decoding and encoding PNG/JPEG images on Linux / MacOS
- https://github.com/tronkko/dirent for listing files in directories on Windows