Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
685d429c81 | ||
|
|
13c95fe094 | ||
|
|
82cf0e8e4a | ||
|
|
cddc2ff658 | ||
|
|
98add035f2 | ||
|
|
9ff1944d06 | ||
|
|
3d96c8ab9f |
6
FAQ.md
6
FAQ.md
@@ -1,5 +1,7 @@
|
|||||||
# FAQ
|
# FAQ
|
||||||
|
|
||||||
1. **How to select models?**
|
1. **How to select models?**<br>
|
||||||
|
A: Please refer to [docs/model_zoo.md](docs/model_zoo.md)
|
||||||
|
|
||||||
A: TODO.
|
1. **Can `face_enhance` be used for anime images/animation videos?**<br>
|
||||||
|
A: No, it can only be used for real faces. It is recommended not to use this option for anime images/animation videos to save GPU memory.
|
||||||
|
|||||||
41
README.md
41
README.md
@@ -1,5 +1,5 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="assets/realesrgan_logo.png" height=100>
|
<img src="assets/realesrgan_logo.png" height=120>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## <div align="center"><b><a href="README.md">English</a> | <a href="README_CN.md">简体中文</a></b></div>
|
## <div align="center"><b><a href="README.md">English</a> | <a href="README_CN.md">简体中文</a></b></div>
|
||||||
@@ -12,18 +12,18 @@
|
|||||||
[](https://github.com/xinntao/Real-ESRGAN/blob/master/.github/workflows/pylint.yml)
|
[](https://github.com/xinntao/Real-ESRGAN/blob/master/.github/workflows/pylint.yml)
|
||||||
[](https://github.com/xinntao/Real-ESRGAN/blob/master/.github/workflows/publish-pip.yml)
|
[](https://github.com/xinntao/Real-ESRGAN/blob/master/.github/workflows/publish-pip.yml)
|
||||||
|
|
||||||
:fire: :fire: :fire: Add **small video models** for anime videos (**针对动漫视频的小模型**). Please see [anime video models](docs/anime_video_model.md).
|
:fire: Update the **RealESRGAN AnimeVideo-v3** model **更新动漫视频的小模型**. Please see [anime video models](docs/anime_video_model.md) and [comparisons](docs/anime_comparisons.md) for more details.
|
||||||
|
|
||||||
1. [Colab Demo](https://colab.research.google.com/drive/1k2Zod6kSHEvraybHl50Lys0LerhyTMCo?usp=sharing) for Real-ESRGAN <a href="https://colab.research.google.com/drive/1k2Zod6kSHEvraybHl50Lys0LerhyTMCo?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a>.
|
1. [Colab Demo](https://colab.research.google.com/drive/1k2Zod6kSHEvraybHl50Lys0LerhyTMCo?usp=sharing) for Real-ESRGAN <a href="https://colab.research.google.com/drive/1k2Zod6kSHEvraybHl50Lys0LerhyTMCo?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a>.
|
||||||
2. [Colab Demo](https://colab.research.google.com/drive/1yNl9ORUxxlL4N0keJa2SEPB61imPQd1B?usp=sharing) for Real-ESRGAN (**anime videos**) <a href="https://colab.research.google.com/drive/1yNl9ORUxxlL4N0keJa2SEPB61imPQd1B?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a>.
|
2. [Colab Demo](https://colab.research.google.com/drive/1yNl9ORUxxlL4N0keJa2SEPB61imPQd1B?usp=sharing) for Real-ESRGAN (**anime videos**) <a href="https://colab.research.google.com/drive/1yNl9ORUxxlL4N0keJa2SEPB61imPQd1B?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a>.
|
||||||
3. Portable [Windows](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-windows.zip) / [Linux](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-ubuntu.zip) / [MacOS](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-macos.zip) **executable files for Intel/AMD/Nvidia GPU**. You can find more information [here](#Portable-executable-files). The ncnn implementation is in [Real-ESRGAN-ncnn-vulkan](https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan).
|
3. Portable [Windows](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-windows.zip) / [Linux](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-ubuntu.zip) / [MacOS](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-macos.zip) **executable files for Intel/AMD/Nvidia GPU**. You can find more information [here](#Portable-executable-files). The ncnn implementation is in [Real-ESRGAN-ncnn-vulkan](https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan).
|
||||||
|
|
||||||
Real-ESRGAN aims at developing **Practical Algorithms for General Image/Video Restoration**.<br>
|
Real-ESRGAN aims at developing **Practical Algorithms for General Image/Video Restoration**.<br>
|
||||||
We extend the powerful ESRGAN to a practical restoration application (namely, Real-ESRGAN), which is trained with pure synthetic data.
|
We extend the powerful ESRGAN to a practical restoration application (namely, Real-ESRGAN), which is trained with pure synthetic data.
|
||||||
|
|
||||||
:art: Real-ESRGAN needs your contributions. Any contributions are welcome, such as new features/models/typo fixes/suggestions/maintenance, *etc*. See [CONTRIBUTING.md](CONTRIBUTING.md). All contributors are list [here](README.md#hugs-acknowledgement).
|
:art: Real-ESRGAN needs your contributions. Any contributions are welcome, such as new features/models/typo fixes/suggestions/maintenance, *etc*. See [CONTRIBUTING.md](CONTRIBUTING.md). All contributors are list [here](README.md#hugs-acknowledgement).
|
||||||
|
|
||||||
:question: Frequently Asked Questions can be found in [FAQ.md](FAQ.md) (Well, it is still empty there =-=||).
|
:question: Frequently Asked Questions can be found in [FAQ.md](FAQ.md).
|
||||||
|
|
||||||
:milky_way: Thanks for your valuable feedbacks/suggestions. All the feedbacks are updated in [feedback.md](feedback.md).
|
:milky_way: Thanks for your valuable feedbacks/suggestions. All the feedbacks are updated in [feedback.md](feedback.md).
|
||||||
|
|
||||||
@@ -39,9 +39,10 @@ Other recommended projects:<br>
|
|||||||
---
|
---
|
||||||
|
|
||||||
<!---------------------------------- Updates --------------------------->
|
<!---------------------------------- Updates --------------------------->
|
||||||
<details open>
|
<details>
|
||||||
<summary>🚩<b>Updates</b></summary>
|
<summary>🚩<b>Updates</b></summary>
|
||||||
|
|
||||||
|
- ✅ Update the **RealESRGAN AnimeVideo-v3** model. Please see [anime video models](docs/anime_video_model.md) and [comparisons](docs/anime_comparisons.md) for more details.
|
||||||
- ✅ Add small models for anime videos. More details are in [anime video models](docs/anime_video_model.md).
|
- ✅ Add small models for anime videos. More details are in [anime video models](docs/anime_video_model.md).
|
||||||
- ✅ Add the ncnn implementation [Real-ESRGAN-ncnn-vulkan](https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan).
|
- ✅ Add the ncnn implementation [Real-ESRGAN-ncnn-vulkan](https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan).
|
||||||
- ✅ Add [*RealESRGAN_x4plus_anime_6B.pth*](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth), which is optimized for **anime** images with much smaller model size. More details and comparisons with [waifu2x](https://github.com/nihui/waifu2x-ncnn-vulkan) are in [**anime_model.md**](docs/anime_model.md)
|
- ✅ Add [*RealESRGAN_x4plus_anime_6B.pth*](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth), which is optimized for **anime** images with much smaller model size. More details and comparisons with [waifu2x](https://github.com/nihui/waifu2x-ncnn-vulkan) are in [**anime_model.md**](docs/anime_model.md)
|
||||||
@@ -55,10 +56,10 @@ Other recommended projects:<br>
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
<!---------------------------------- Projects that use Real-ESRGAN --------------------------->
|
<!---------------------------------- Projects that use Real-ESRGAN --------------------------->
|
||||||
<details open>
|
<details>
|
||||||
<summary>🧩<b>Projects that use Real-ESRGAN</b></summary>
|
<summary>🧩<b>Projects that use Real-ESRGAN</b></summary>
|
||||||
|
|
||||||
If you develop/use Real-ESRGAN in your projects, welcome to let me know 👋
|
👋 If you develop/use Real-ESRGAN in your projects, welcome to let me know.
|
||||||
|
|
||||||
- NCNN-Android: [RealSR-NCNN-Android](https://github.com/tumuyan/RealSR-NCNN-Android) by [tumuyan](https://github.com/tumuyan)
|
- NCNN-Android: [RealSR-NCNN-Android](https://github.com/tumuyan/RealSR-NCNN-Android) by [tumuyan](https://github.com/tumuyan)
|
||||||
- VapourSynth: [vs-realesrgan](https://github.com/HolyWu/vs-realesrgan) by [HolyWu](https://github.com/HolyWu)
|
- VapourSynth: [vs-realesrgan](https://github.com/HolyWu/vs-realesrgan) by [HolyWu](https://github.com/HolyWu)
|
||||||
@@ -77,7 +78,7 @@ Other recommended projects:<br>
|
|||||||
|
|
||||||
<!---------------------------------- Demo videos --------------------------->
|
<!---------------------------------- Demo videos --------------------------->
|
||||||
<details open>
|
<details open>
|
||||||
<summary>👀<b>Demo videos</b>👀</summary>
|
<summary>👀<b>Demo videos</b></summary>
|
||||||
|
|
||||||
- [大闹天宫片段](https://www.bilibili.com/video/BV1ja41117zb)
|
- [大闹天宫片段](https://www.bilibili.com/video/BV1ja41117zb)
|
||||||
|
|
||||||
@@ -118,7 +119,7 @@ If you have some images that Real-ESRGAN could not well restored, please also op
|
|||||||
|
|
||||||
### Portable executable files
|
### Portable executable files
|
||||||
|
|
||||||
You can download [Windows](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-windows.zip) / [Linux](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-ubuntu.zip) / [MacOS](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-macos.zip) **executable files for Intel/AMD/Nvidia GPU**.
|
You can download [Windows](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-windows.zip) / [Linux](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-ubuntu.zip) / [MacOS](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-macos.zip) **executable files for Intel/AMD/Nvidia GPU**.
|
||||||
|
|
||||||
This executable file is **portable** and includes all the binaries and models required. No CUDA or PyTorch environment is needed.<br>
|
This executable file is **portable** and includes all the binaries and models required. No CUDA or PyTorch environment is needed.<br>
|
||||||
|
|
||||||
@@ -133,8 +134,7 @@ We have provided five models:
|
|||||||
1. realesrgan-x4plus (default)
|
1. realesrgan-x4plus (default)
|
||||||
2. realesrnet-x4plus
|
2. realesrnet-x4plus
|
||||||
3. realesrgan-x4plus-anime (optimized for anime images, small model size)
|
3. realesrgan-x4plus-anime (optimized for anime images, small model size)
|
||||||
4. RealESRGANv2-animevideo-xsx2 (anime video, X2)
|
4. realesr-animevideov3 (animation video)
|
||||||
5. RealESRGANv2-animevideo-xsx4 (anime video, X4)
|
|
||||||
|
|
||||||
You can use the `-n` argument for other models, for example, `./realesrgan-ncnn-vulkan.exe -i input.jpg -o output.png -n realesrnet-x4plus`
|
You can use the `-n` argument for other models, for example, `./realesrgan-ncnn-vulkan.exe -i input.jpg -o output.png -n realesrnet-x4plus`
|
||||||
|
|
||||||
@@ -147,23 +147,21 @@ You can use the `-n` argument for other models, for example, `./realesrgan-ncnn-
|
|||||||
Usage: realesrgan-ncnn-vulkan.exe -i infile -o outfile [options]...
|
Usage: realesrgan-ncnn-vulkan.exe -i infile -o outfile [options]...
|
||||||
|
|
||||||
-h show this help
|
-h show this help
|
||||||
-v verbose output
|
|
||||||
-i input-path input image path (jpg/png/webp) or directory
|
-i input-path input image path (jpg/png/webp) or directory
|
||||||
-o output-path output image path (jpg/png/webp) or directory
|
-o output-path output image path (jpg/png/webp) or directory
|
||||||
-s scale upscale ratio (4, default=4)
|
-s scale upscale ratio (can be 2, 3, 4. default=4)
|
||||||
-t tile-size tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu
|
-t tile-size tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu
|
||||||
-m model-path folder path to pre-trained models(default=models)
|
-m model-path folder path to the pre-trained models. default=models
|
||||||
-n model-name model name (default=realesrgan-x4plus, can be realesrgan-x4plus | realesrgan-x4plus-anime | realesrnet-x4plus)
|
-n model-name model name (default=realesr-animevideov3, can be realesr-animevideov3 | realesrgan-x4plus | realesrgan-x4plus-anime | realesrnet-x4plus)
|
||||||
-g gpu-id gpu device to use (default=0) can be 0,1,2 for multi-gpu
|
-g gpu-id gpu device to use (default=auto) can be 0,1,2 for multi-gpu
|
||||||
-j load:proc:save thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu
|
-j load:proc:save thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu
|
||||||
-x enable tta mode
|
-x enable tta mode"
|
||||||
-f format output image format (jpg/png/webp, default=ext/png)
|
-f format output image format (jpg/png/webp, default=ext/png)
|
||||||
|
-v verbose output
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that it may introduce block inconsistency (and also generate slightly different results from the PyTorch implementation), because this executable file first crops the input image into several tiles, and then processes them separately, finally stitches together.
|
Note that it may introduce block inconsistency (and also generate slightly different results from the PyTorch implementation), because this executable file first crops the input image into several tiles, and then processes them separately, finally stitches together.
|
||||||
|
|
||||||
This executable file is based on the wonderful [Tencent/ncnn](https://github.com/Tencent/ncnn) and [realsr-ncnn-vulkan](https://github.com/nihui/realsr-ncnn-vulkan) by [nihui](https://github.com/nihui).
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## :wrench: Dependencies and Installation
|
## :wrench: Dependencies and Installation
|
||||||
@@ -236,7 +234,7 @@ Results are in the `results` folder
|
|||||||
```console
|
```console
|
||||||
Usage: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile -o outfile [options]...
|
Usage: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile -o outfile [options]...
|
||||||
|
|
||||||
A common command: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile --outscale 3.5 --half --face_enhance
|
A common command: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile --outscale 3.5 --face_enhance
|
||||||
|
|
||||||
-h show this help
|
-h show this help
|
||||||
-i --input Input image or folder. Default: inputs
|
-i --input Input image or folder. Default: inputs
|
||||||
@@ -246,11 +244,10 @@ A common command: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile
|
|||||||
--suffix Suffix of the restored image. Default: out
|
--suffix Suffix of the restored image. Default: out
|
||||||
-t, --tile Tile size, 0 for no tile during testing. Default: 0
|
-t, --tile Tile size, 0 for no tile during testing. Default: 0
|
||||||
--face_enhance Whether to use GFPGAN to enhance face. Default: False
|
--face_enhance Whether to use GFPGAN to enhance face. Default: False
|
||||||
--half Whether to use half precision during inference. Default: False
|
--fp32 Use fp32 precision during inference. Default: fp16 (half precision).
|
||||||
--ext Image extension. Options: auto | jpg | png, auto means using the same extension as inputs. Default: auto
|
--ext Image extension. Options: auto | jpg | png, auto means using the same extension as inputs. Default: auto
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## :european_castle: Model Zoo
|
## :european_castle: Model Zoo
|
||||||
|
|
||||||
Please see [docs/model_zoo.md](docs/model_zoo.md)
|
Please see [docs/model_zoo.md](docs/model_zoo.md)
|
||||||
|
|||||||
40
README_CN.md
40
README_CN.md
@@ -1,5 +1,5 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="assets/realesrgan_logo.png" height=100>
|
<img src="assets/realesrgan_logo.png" height=120>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## <div align="center"><b><a href="README.md">English</a> | <a href="README_CN.md">简体中文</a></b></div>
|
## <div align="center"><b><a href="README.md">English</a> | <a href="README_CN.md">简体中文</a></b></div>
|
||||||
@@ -12,11 +12,11 @@
|
|||||||
[](https://github.com/xinntao/Real-ESRGAN/blob/master/.github/workflows/pylint.yml)
|
[](https://github.com/xinntao/Real-ESRGAN/blob/master/.github/workflows/pylint.yml)
|
||||||
[](https://github.com/xinntao/Real-ESRGAN/blob/master/.github/workflows/publish-pip.yml)
|
[](https://github.com/xinntao/Real-ESRGAN/blob/master/.github/workflows/publish-pip.yml)
|
||||||
|
|
||||||
:fire: :fire: :fire: 添加了**针对动漫视频的小模型**, 更多信息在 [anime video models](docs/anime_video_model.md) 中.
|
:fire: 更新动漫视频的小模型 **RealESRGAN AnimeVideo-v3**. 更多信息在 [anime video models](docs/anime_video_model.md) 和 [comparisons](docs/anime_comparisons.md)中.
|
||||||
|
|
||||||
1. Real-ESRGAN的[Colab Demo](https://colab.research.google.com/drive/1k2Zod6kSHEvraybHl50Lys0LerhyTMCo?usp=sharing) <a href="https://colab.research.google.com/drive/1k2Zod6kSHEvraybHl50Lys0LerhyTMCo?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a>.
|
1. Real-ESRGAN的[Colab Demo](https://colab.research.google.com/drive/1k2Zod6kSHEvraybHl50Lys0LerhyTMCo?usp=sharing) <a href="https://colab.research.google.com/drive/1k2Zod6kSHEvraybHl50Lys0LerhyTMCo?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a>.
|
||||||
2. Real-ESRGAN的 **动漫视频** 的[Colab Demo](https://colab.research.google.com/drive/1yNl9ORUxxlL4N0keJa2SEPB61imPQd1B?usp=sharing) <a href="https://colab.research.google.com/drive/1yNl9ORUxxlL4N0keJa2SEPB61imPQd1B?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a>.
|
2. Real-ESRGAN的 **动漫视频** 的[Colab Demo](https://colab.research.google.com/drive/1yNl9ORUxxlL4N0keJa2SEPB61imPQd1B?usp=sharing) <a href="https://colab.research.google.com/drive/1yNl9ORUxxlL4N0keJa2SEPB61imPQd1B?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a>.
|
||||||
3. **支持Intel/AMD/Nvidia显卡**的绿色版exe文件: [Windows版](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-windows.zip) / [Linux版](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-ubuntu.zip) / [macOS版](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-macos.zip),详情请移步[这里](#便携版(绿色版)可执行文件)。NCNN的实现在 [Real-ESRGAN-ncnn-vulkan](https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan)。
|
3. **支持Intel/AMD/Nvidia显卡**的绿色版exe文件: [Windows版](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-windows.zip) / [Linux版](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-ubuntu.zip) / [macOS版](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-macos.zip),详情请移步[这里](#便携版(绿色版)可执行文件)。NCNN的实现在 [Real-ESRGAN-ncnn-vulkan](https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan)。
|
||||||
|
|
||||||
Real-ESRGAN 的目标是开发出**实用的图像/视频修复算法**。<br>
|
Real-ESRGAN 的目标是开发出**实用的图像/视频修复算法**。<br>
|
||||||
我们在 ESRGAN 的基础上使用纯合成的数据来进行训练,以使其能被应用于实际的图片修复的场景(顾名思义:Real-ESRGAN)。
|
我们在 ESRGAN 的基础上使用纯合成的数据来进行训练,以使其能被应用于实际的图片修复的场景(顾名思义:Real-ESRGAN)。
|
||||||
@@ -39,9 +39,10 @@ Real-ESRGAN 的目标是开发出**实用的图像/视频修复算法**。<br>
|
|||||||
---
|
---
|
||||||
|
|
||||||
<!---------------------------------- Updates --------------------------->
|
<!---------------------------------- Updates --------------------------->
|
||||||
<details open>
|
<details>
|
||||||
<summary>🚩<b>更新</b></summary>
|
<summary>🚩<b>更新</b></summary>
|
||||||
|
|
||||||
|
- ✅ 更新动漫视频的小模型 **RealESRGAN AnimeVideo-v3**. 更多信息在 [anime video models](docs/anime_video_model.md) 和 [comparisons](docs/anime_comparisons.md)中.
|
||||||
- ✅ 添加了针对动漫视频的小模型, 更多信息在 [anime video models](docs/anime_video_model.md) 中.
|
- ✅ 添加了针对动漫视频的小模型, 更多信息在 [anime video models](docs/anime_video_model.md) 中.
|
||||||
- ✅ 添加了ncnn 实现:[Real-ESRGAN-ncnn-vulkan](https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan).
|
- ✅ 添加了ncnn 实现:[Real-ESRGAN-ncnn-vulkan](https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan).
|
||||||
- ✅ 添加了 [*RealESRGAN_x4plus_anime_6B.pth*](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth),对二次元图片进行了优化,并减少了model的大小。详情 以及 与[waifu2x](https://github.com/nihui/waifu2x-ncnn-vulkan)的对比请查看[**anime_model.md**](docs/anime_model.md)
|
- ✅ 添加了 [*RealESRGAN_x4plus_anime_6B.pth*](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth),对二次元图片进行了优化,并减少了model的大小。详情 以及 与[waifu2x](https://github.com/nihui/waifu2x-ncnn-vulkan)的对比请查看[**anime_model.md**](docs/anime_model.md)
|
||||||
@@ -55,10 +56,10 @@ Real-ESRGAN 的目标是开发出**实用的图像/视频修复算法**。<br>
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
<!---------------------------------- Projects that use Real-ESRGAN --------------------------->
|
<!---------------------------------- Projects that use Real-ESRGAN --------------------------->
|
||||||
<details open>
|
<details>
|
||||||
<summary>🧩<b>使用Real-ESRGAN的项目</b></summary>
|
<summary>🧩<b>使用Real-ESRGAN的项目</b></summary>
|
||||||
|
|
||||||
如果你开发/使用/集成了Real-ESRGAN, 欢迎联系我添加 👋
|
👋 如果你开发/使用/集成了Real-ESRGAN, 欢迎联系我添加
|
||||||
|
|
||||||
- NCNN-Android: [RealSR-NCNN-Android](https://github.com/tumuyan/RealSR-NCNN-Android) by [tumuyan](https://github.com/tumuyan)
|
- NCNN-Android: [RealSR-NCNN-Android](https://github.com/tumuyan/RealSR-NCNN-Android) by [tumuyan](https://github.com/tumuyan)
|
||||||
- VapourSynth: [vs-realesrgan](https://github.com/HolyWu/vs-realesrgan) by [HolyWu](https://github.com/HolyWu)
|
- VapourSynth: [vs-realesrgan](https://github.com/HolyWu/vs-realesrgan) by [HolyWu](https://github.com/HolyWu)
|
||||||
@@ -75,8 +76,8 @@ Real-ESRGAN 的目标是开发出**实用的图像/视频修复算法**。<br>
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details open>
|
<details>
|
||||||
<summary>👀<b>Demo视频(B站)</b>👀</summary>
|
<summary>👀<b>Demo视频(B站)</b></summary>
|
||||||
|
|
||||||
- [大闹天宫片段](https://www.bilibili.com/video/BV1ja41117zb)
|
- [大闹天宫片段](https://www.bilibili.com/video/BV1ja41117zb)
|
||||||
|
|
||||||
@@ -115,7 +116,7 @@ Real-ESRGAN 将会被长期支持,我会在空闲的时间中持续维护更
|
|||||||
|
|
||||||
### 便携版(绿色版)可执行文件
|
### 便携版(绿色版)可执行文件
|
||||||
|
|
||||||
你可以下载**支持Intel/AMD/Nvidia显卡**的绿色版exe文件: [Windows版](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-windows.zip) / [Linux版](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-ubuntu.zip) / [macOS版](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-macos.zip)。
|
你可以下载**支持Intel/AMD/Nvidia显卡**的绿色版exe文件: [Windows版](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-windows.zip) / [Linux版](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-ubuntu.zip) / [macOS版](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-macos.zip)。
|
||||||
|
|
||||||
绿色版指的是这些exe你可以直接运行(放U盘里拷走都没问题),因为里面已经有所需的文件和模型了。它不需要 CUDA 或者 PyTorch运行环境。<br>
|
绿色版指的是这些exe你可以直接运行(放U盘里拷走都没问题),因为里面已经有所需的文件和模型了。它不需要 CUDA 或者 PyTorch运行环境。<br>
|
||||||
|
|
||||||
@@ -130,8 +131,7 @@ Real-ESRGAN 将会被长期支持,我会在空闲的时间中持续维护更
|
|||||||
1. realesrgan-x4plus(默认)
|
1. realesrgan-x4plus(默认)
|
||||||
2. reaesrnet-x4plus
|
2. reaesrnet-x4plus
|
||||||
3. realesrgan-x4plus-anime(针对动漫插画图像优化,有更小的体积)
|
3. realesrgan-x4plus-anime(针对动漫插画图像优化,有更小的体积)
|
||||||
4. RealESRGANv2-animevideo-xsx2 (针对动漫视频, X2)
|
4. realesr-animevideov3 (针对动漫视频)
|
||||||
5. RealESRGANv2-animevideo-xsx4 (针对动漫视频, X4)
|
|
||||||
|
|
||||||
你可以通过`-n`参数来使用其他模型,例如`./realesrgan-ncnn-vulkan.exe -i 二次元图片.jpg -o 二刺螈图片.png -n realesrgan-x4plus-anime`
|
你可以通过`-n`参数来使用其他模型,例如`./realesrgan-ncnn-vulkan.exe -i 二次元图片.jpg -o 二刺螈图片.png -n realesrgan-x4plus-anime`
|
||||||
|
|
||||||
@@ -144,23 +144,21 @@ Real-ESRGAN 将会被长期支持,我会在空闲的时间中持续维护更
|
|||||||
Usage: realesrgan-ncnn-vulkan.exe -i infile -o outfile [options]...
|
Usage: realesrgan-ncnn-vulkan.exe -i infile -o outfile [options]...
|
||||||
|
|
||||||
-h show this help
|
-h show this help
|
||||||
-v verbose output
|
|
||||||
-i input-path input image path (jpg/png/webp) or directory
|
-i input-path input image path (jpg/png/webp) or directory
|
||||||
-o output-path output image path (jpg/png/webp) or directory
|
-o output-path output image path (jpg/png/webp) or directory
|
||||||
-s scale upscale ratio (4, default=4)
|
-s scale upscale ratio (can be 2, 3, 4. default=4)
|
||||||
-t tile-size tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu
|
-t tile-size tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu
|
||||||
-m model-path folder path to pre-trained models(default=models)
|
-m model-path folder path to the pre-trained models. default=models
|
||||||
-n model-name model name (default=realesrgan-x4plus, can be realesrgan-x4plus | realesrgan-x4plus-anime | realesrnet-x4plus)
|
-n model-name model name (default=realesr-animevideov3, can be realesr-animevideov3 | realesrgan-x4plus | realesrgan-x4plus-anime | realesrnet-x4plus)
|
||||||
-g gpu-id gpu device to use (default=0) can be 0,1,2 for multi-gpu
|
-g gpu-id gpu device to use (default=auto) can be 0,1,2 for multi-gpu
|
||||||
-j load:proc:save thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu
|
-j load:proc:save thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu
|
||||||
-x enable tta mode
|
-x enable tta mode"
|
||||||
-f format output image format (jpg/png/webp, default=ext/png)
|
-f format output image format (jpg/png/webp, default=ext/png)
|
||||||
|
-v verbose output
|
||||||
```
|
```
|
||||||
|
|
||||||
由于这些exe文件会把图像分成几个板块,然后来分别进行处理,再合成导出,输出的图像可能会有一点割裂感(而且可能跟PyTorch的输出不太一样)
|
由于这些exe文件会把图像分成几个板块,然后来分别进行处理,再合成导出,输出的图像可能会有一点割裂感(而且可能跟PyTorch的输出不太一样)
|
||||||
|
|
||||||
这些exe文件均基于[Tencent/ncnn](https://github.com/Tencent/ncnn)以及[nihui](https://github.com/nihui)的[realsr-ncnn-vulkan](https://github.com/nihui/realsr-ncnn-vulkan),感谢!
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## :wrench: 依赖以及安装
|
## :wrench: 依赖以及安装
|
||||||
@@ -233,7 +231,7 @@ python inference_realesrgan.py -n RealESRGAN_x4plus_anime_6B -i inputs
|
|||||||
```console
|
```console
|
||||||
Usage: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile -o outfile [options]...
|
Usage: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile -o outfile [options]...
|
||||||
|
|
||||||
A common command: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile --outscale 3.5 --half --face_enhance
|
A common command: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile --outscale 3.5 --face_enhance
|
||||||
|
|
||||||
-h show this help
|
-h show this help
|
||||||
-i --input Input image or folder. Default: inputs
|
-i --input Input image or folder. Default: inputs
|
||||||
@@ -243,7 +241,7 @@ A common command: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile
|
|||||||
--suffix Suffix of the restored image. Default: out
|
--suffix Suffix of the restored image. Default: out
|
||||||
-t, --tile Tile size, 0 for no tile during testing. Default: 0
|
-t, --tile Tile size, 0 for no tile during testing. Default: 0
|
||||||
--face_enhance Whether to use GFPGAN to enhance face. Default: False
|
--face_enhance Whether to use GFPGAN to enhance face. Default: False
|
||||||
--half Whether to use half precision during inference. Default: False
|
--fp32 Whether to use half precision during inference. Default: False
|
||||||
--ext Image extension. Options: auto | jpg | png, auto means using the same extension as inputs. Default: auto
|
--ext Image extension. Options: auto | jpg | png, auto means using the same extension as inputs. Default: auto
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
65
docs/anime_comparisons.md
Normal file
65
docs/anime_comparisons.md
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
# Comparisons among different anime models
|
||||||
|
|
||||||
|
## Update News
|
||||||
|
|
||||||
|
- 2022/04/24: Release **AnimeVideo-v3**. We have made the following improvements:
|
||||||
|
- **better naturalness**
|
||||||
|
- **Fewer artifacts**
|
||||||
|
- **more faithful to the original colors**
|
||||||
|
- **better texture restoration**
|
||||||
|
- **better background restoration**
|
||||||
|
|
||||||
|
## Comparisons
|
||||||
|
|
||||||
|
We have compared our RealESRGAN-AnimeVideo-v3 with the following methods.
|
||||||
|
Our RealESRGAN-AnimeVideo-v3 can achieve better results with faster inference speed.
|
||||||
|
|
||||||
|
- [waifu2x](https://github.com/nihui/waifu2x-ncnn-vulkan) with the hyperparameters: `tile=0`, `noiselevel=2`
|
||||||
|
|
||||||
|
- [Real-CUGAN](https://github.com/bilibili/ailab/tree/main/Real-CUGAN):
|
||||||
|
we use the [20220227](https://github.com/bilibili/ailab/releases/tag/Real-CUGAN-add-faster-low-memory-mode) version, the hyperparameters are: `cache_mode=0`, `tile=0`, `alpha=1`.
|
||||||
|
- our RealESRGAN-AnimeVideo-v3
|
||||||
|
|
||||||
|
## Results
|
||||||
|
|
||||||
|
You may need to **zoom in** for comparing details, or **click the image** to see in the full size.
|
||||||
|
|
||||||
|
**More natural results, better background restoration**
|
||||||
|
| Input | waifu2x | Real-CUGAN | RealESRGAN<br>AnimeVideo-v3 |
|
||||||
|
| :---: | :---: | :---: | :---: |
|
||||||
|
| |  |  |  |
|
||||||
|
| |  |  |  |
|
||||||
|
| |  |  |  |
|
||||||
|
|
||||||
|
**Fewer artifacts, better detailed textures**
|
||||||
|
| Input | waifu2x | Real-CUGAN | RealESRGAN<br>AnimeVideo-v3 |
|
||||||
|
| :---: | :---: | :---: | :---: |
|
||||||
|
| |  |  |  |
|
||||||
|
| |  |  |  |
|
||||||
|
| |  |  |  |
|
||||||
|
| |  |  |  |
|
||||||
|
|
||||||
|
**Other better results**
|
||||||
|
| Input | waifu2x | Real-CUGAN | RealESRGAN<br>AnimeVideo-v3 |
|
||||||
|
| :---: | :---: | :---: | :---: |
|
||||||
|
| |  |  |  |
|
||||||
|
| |  |  |  |
|
||||||
|
|  |   |   |   |
|
||||||
|
| |  |  |  |
|
||||||
|
| |  |  |  |
|
||||||
|
|
||||||
|
## Inference Speed
|
||||||
|
|
||||||
|
### PyTorch
|
||||||
|
|
||||||
|
Note that we only report the **model** time, and ignore the IO time.
|
||||||
|
|
||||||
|
| GPU | Input Resolution | waifu2x | Real-CUGAN | RealESRGAN-AnimeVideo-v3
|
||||||
|
| :---: | :---: | :---: | :---: | :---: |
|
||||||
|
| V100 | 1921 x 1080 | - | 3.4 fps | **10.0** fps |
|
||||||
|
| V100 | 1280 x 720 | - | 7.2 fps | **22.6** fps |
|
||||||
|
| V100 | 640 x 480 | - | 24.4 fps | **65.9** fps |
|
||||||
|
|
||||||
|
### ncnn
|
||||||
|
|
||||||
|
- [ ] TODO
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
The following is a video comparison with sliding bar. You may need to use the full-screen mode for better visual quality, as the original image is large; otherwise, you may encounter aliasing issue.
|
The following is a video comparison with sliding bar. You may need to use the full-screen mode for better visual quality, as the original image is large; otherwise, you may encounter aliasing issue.
|
||||||
|
|
||||||
https://user-images.githubusercontent.com/17445847/131535127-613250d4-f754-4e20-9720-2f9608ad0675.mp4
|
<https://user-images.githubusercontent.com/17445847/131535127-613250d4-f754-4e20-9720-2f9608ad0675.mp4>
|
||||||
|
|
||||||
## How to Use
|
## How to Use
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ python inference_realesrgan.py -n RealESRGAN_x4plus_anime_6B -i inputs
|
|||||||
|
|
||||||
### ncnn Executable File
|
### ncnn Executable File
|
||||||
|
|
||||||
Download the latest portable [Windows](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-windows.zip) / [Linux](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-ubuntu.zip) / [MacOS](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-macos.zip) **executable files for Intel/AMD/Nvidia GPU**.
|
Download the latest portable [Windows](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-windows.zip) / [Linux](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-ubuntu.zip) / [MacOS](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-macos.zip) **executable files for Intel/AMD/Nvidia GPU**.
|
||||||
|
|
||||||
Taking the Windows as example, run:
|
Taking the Windows as example, run:
|
||||||
|
|
||||||
@@ -64,6 +64,6 @@ We compare Real-ESRGAN-anime with [waifu2x](https://github.com/nihui/waifu2x-ncn
|
|||||||
|
|
||||||
The following are video comparisons with sliding bar. You may need to use the full-screen mode for better visual quality, as the original image is large; otherwise, you may encounter aliasing issue.
|
The following are video comparisons with sliding bar. You may need to use the full-screen mode for better visual quality, as the original image is large; otherwise, you may encounter aliasing issue.
|
||||||
|
|
||||||
https://user-images.githubusercontent.com/17445847/131536647-a2fbf896-b495-4a9f-b1dd-ca7bbc90101a.mp4
|
<https://user-images.githubusercontent.com/17445847/131536647-a2fbf896-b495-4a9f-b1dd-ca7bbc90101a.mp4>
|
||||||
|
|
||||||
https://user-images.githubusercontent.com/17445847/131536742-6d9d82b6-9765-4296-a15f-18f9aeaa5465.mp4
|
<https://user-images.githubusercontent.com/17445847/131536742-6d9d82b6-9765-4296-a15f-18f9aeaa5465.mp4>
|
||||||
|
|||||||
@@ -1,30 +1,32 @@
|
|||||||
# Anime Video Models
|
# Anime Video Models
|
||||||
|
|
||||||
:white_check_mark: We add small models that are optimized for anime videos :-)
|
:white_check_mark: We add small models that are optimized for anime videos :-)<br>
|
||||||
|
More comparisons can be found in [anime_comparisons.md](docs/anime_comparisons.md)
|
||||||
|
|
||||||
|
- [How to Use](#how-to-use)
|
||||||
|
- [PyTorch Inference](#pytorch-inference)
|
||||||
|
- [ncnn Executable File](#ncnn-executable-file)
|
||||||
|
- [Step 1: Use ffmpeg to extract frames from video](#step-1-use-ffmpeg-to-extract-frames-from-video)
|
||||||
|
- [Step 2: Inference with Real-ESRGAN executable file](#step-2-inference-with-real-esrgan-executable-file)
|
||||||
|
- [Step 3: Merge the enhanced frames back into a video](#step-3-merge-the-enhanced-frames-back-into-a-video)
|
||||||
|
- [More Demos](#more-demos)
|
||||||
|
|
||||||
| Models | Scale | Description |
|
| Models | Scale | Description |
|
||||||
| ---------------------------------------------------------------------------------------------------------------------------------- | :---- | :----------------------------- |
|
| ---------------------------------------------------------------------------------------------------------------------------------- | :---- | :----------------------------- |
|
||||||
| [RealESRGANv2-animevideo-xsx2](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/RealESRGANv2-animevideo-xsx2.pth) | X2 | Anime video model with XS size |
|
| [realesr-animevideov3](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-animevideov3.pth) | X4 <sup>1</sup> | Anime video model with XS size |
|
||||||
| [RealESRGANv2-animevideo-xsx4](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/RealESRGANv2-animevideo-xsx4.pth) | X4 | Anime video model with XS size |
|
|
||||||
|
|
||||||
- [Anime Video Models](#anime-video-models)
|
Note: <br>
|
||||||
- [How to Use](#how-to-use)
|
<sup>1</sup> This model can also be used for X1, X2, X3.
|
||||||
- [PyTorch Inference](#pytorch-inference)
|
|
||||||
- [ncnn Executable File](#ncnn-executable-file)
|
|
||||||
- [Step 1: Use ffmpeg to extract frames from video](#step-1-use-ffmpeg-to-extract-frames-from-video)
|
|
||||||
- [Step 2: Inference with Real-ESRGAN executable file](#step-2-inference-with-real-esrgan-executable-file)
|
|
||||||
- [Step 3: Merge the enhanced frames back into a video](#step-3-merge-the-enhanced-frames-back-into-a-video)
|
|
||||||
- [More Demos](#more-demos)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
The following are some demos (best view in the full screen mode).
|
The following are some demos (best view in the full screen mode).
|
||||||
|
|
||||||
https://user-images.githubusercontent.com/17445847/145706977-98bc64a4-af27-481c-8abe-c475e15db7ff.MP4
|
<https://user-images.githubusercontent.com/17445847/145706977-98bc64a4-af27-481c-8abe-c475e15db7ff.MP4>
|
||||||
|
|
||||||
https://user-images.githubusercontent.com/17445847/145707055-6a4b79cb-3d9d-477f-8610-c6be43797133.MP4
|
<https://user-images.githubusercontent.com/17445847/145707055-6a4b79cb-3d9d-477f-8610-c6be43797133.MP4>
|
||||||
|
|
||||||
https://user-images.githubusercontent.com/17445847/145783523-f4553729-9f03-44a8-a7cc-782aadf67b50.MP4
|
<https://user-images.githubusercontent.com/17445847/145783523-f4553729-9f03-44a8-a7cc-782aadf67b50.MP4>
|
||||||
|
|
||||||
## How to Use
|
## How to Use
|
||||||
|
|
||||||
@@ -32,12 +34,12 @@ https://user-images.githubusercontent.com/17445847/145783523-f4553729-9f03-44a8-
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# download model
|
# download model
|
||||||
wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/RealESRGANv2-animevideo-xsx2.pth -P experiments/pretrained_models
|
wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-animevideov3.pth -P realesrgan/weights
|
||||||
# inference
|
# inference
|
||||||
python inference_realesrgan_video.py -i inputs/video/onepiece_demo.mp4 -n RealESRGANv2-animevideo-xsx2 -s 2 -v -a --half --suffix outx2
|
python inference_realesrgan_video.py -i inputs/video/onepiece_demo.mp4 -n realesr-animevideov3 -s 2 --suffix outx2
|
||||||
```
|
```
|
||||||
|
|
||||||
### ncnn Executable File
|
### NCNN Executable File
|
||||||
|
|
||||||
#### Step 1: Use ffmpeg to extract frames from video
|
#### Step 1: Use ffmpeg to extract frames from video
|
||||||
|
|
||||||
@@ -49,12 +51,12 @@ ffmpeg -i onepiece_demo.mp4 -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 tmp_frames/fram
|
|||||||
|
|
||||||
#### Step 2: Inference with Real-ESRGAN executable file
|
#### Step 2: Inference with Real-ESRGAN executable file
|
||||||
|
|
||||||
1. Download the latest portable [Windows](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-windows.zip) / [Linux](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-ubuntu.zip) / [MacOS](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/realesrgan-ncnn-vulkan-20211212-macos.zip) **executable files for Intel/AMD/Nvidia GPU**
|
1. Download the latest portable [Windows](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-windows.zip) / [Linux](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-ubuntu.zip) / [MacOS](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-macos.zip) **executable files for Intel/AMD/Nvidia GPU**
|
||||||
|
|
||||||
1. Taking the Windows as example, run:
|
1. Taking the Windows as example, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./realesrgan-ncnn-vulkan.exe -i tmp_frames -o out_frames -n RealESRGANv2-animevideo-xsx2 -s 2 -f jpg
|
./realesrgan-ncnn-vulkan.exe -i tmp_frames -o out_frames -n realesr-animevideov3 -s 2 -f jpg
|
||||||
```
|
```
|
||||||
|
|
||||||
- Remember to create the folder `out_frames` ahead
|
- Remember to create the folder `out_frames` ahead
|
||||||
@@ -110,12 +112,12 @@ ffmpeg -i onepiece_demo.mp4 -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 tmp_frames/fram
|
|||||||
|
|
||||||
- Input video for One Piece:
|
- Input video for One Piece:
|
||||||
|
|
||||||
https://user-images.githubusercontent.com/17445847/145706822-0e83d9c4-78ef-40ee-b2a4-d8b8c3692d17.mp4
|
<https://user-images.githubusercontent.com/17445847/145706822-0e83d9c4-78ef-40ee-b2a4-d8b8c3692d17.mp4>
|
||||||
|
|
||||||
- Out video for One Piece
|
- Out video for One Piece
|
||||||
|
|
||||||
https://user-images.githubusercontent.com/17445847/145706827-384108c0-78f6-4aa7-9621-99d1aaf65682.mp4
|
<https://user-images.githubusercontent.com/17445847/164960481-759658cf-fcb8-480c-b888-cecb606e8744.mp4>
|
||||||
|
|
||||||
**More comparisons**
|
**More comparisons**
|
||||||
|
|
||||||
https://user-images.githubusercontent.com/17445847/145707458-04a5e9b9-2edd-4d1f-b400-380a72e5f5e6.MP4
|
<https://user-images.githubusercontent.com/17445847/145707458-04a5e9b9-2edd-4d1f-b400-380a72e5f5e6.MP4>
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
# :european_castle: Model Zoo
|
# :european_castle: Model Zoo
|
||||||
|
|
||||||
- [:european_castle: Model Zoo](#european_castle-model-zoo)
|
- [For General Images](#for-general-images)
|
||||||
- [For General Images](#for-general-images)
|
- [For Anime Images](#for-anime-images)
|
||||||
- [For Anime Images](#for-anime-images)
|
- [For Anime Videos](#for-anime-videos)
|
||||||
- [For Anime Videos](#for-anime-videos)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -23,7 +22,7 @@ The following models are **discriminators**, which are usually used for fine-tun
|
|||||||
| [RealESRGAN_x4plus_netD](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.3/RealESRGAN_x4plus_netD.pth) | RealESRGAN_x4plus |
|
| [RealESRGAN_x4plus_netD](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.3/RealESRGAN_x4plus_netD.pth) | RealESRGAN_x4plus |
|
||||||
| [RealESRGAN_x2plus_netD](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.3/RealESRGAN_x2plus_netD.pth) | RealESRGAN_x2plus |
|
| [RealESRGAN_x2plus_netD](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.3/RealESRGAN_x2plus_netD.pth) | RealESRGAN_x2plus |
|
||||||
|
|
||||||
## For Anime Images
|
## For Anime Images / Illustrations
|
||||||
|
|
||||||
| Models | Scale | Description |
|
| Models | Scale | Description |
|
||||||
| ------------------------------------------------------------------------------------------------------------------------------ | :---- | :---------------------------------------------------------- |
|
| ------------------------------------------------------------------------------------------------------------------------------ | :---- | :---------------------------------------------------------- |
|
||||||
@@ -35,12 +34,14 @@ The following models are **discriminators**, which are usually used for fine-tun
|
|||||||
| ---------------------------------------------------------------------------------------------------------------------------------------- | :------------------------- |
|
| ---------------------------------------------------------------------------------------------------------------------------------------- | :------------------------- |
|
||||||
| [RealESRGAN_x4plus_anime_6B_netD](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B_netD.pth) | RealESRGAN_x4plus_anime_6B |
|
| [RealESRGAN_x4plus_anime_6B_netD](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B_netD.pth) | RealESRGAN_x4plus_anime_6B |
|
||||||
|
|
||||||
## For Anime Videos
|
## For Animation Videos
|
||||||
|
|
||||||
| Models | Scale | Description |
|
| Models | Scale | Description |
|
||||||
| ---------------------------------------------------------------------------------------------------------------------------------- | :---- | :----------------------------- |
|
| ---------------------------------------------------------------------------------------------------------------------------------- | :---- | :----------------------------- |
|
||||||
| [RealESRGANv2-animevideo-xsx2](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/RealESRGANv2-animevideo-xsx2.pth) | X2 | Anime video model with XS size |
|
| [realesr-animevideov3](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-animevideov3.pth) | X4<sup>1</sup> | Anime video model with XS size |
|
||||||
| [RealESRGANv2-animevideo-xsx4](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.3.0/RealESRGANv2-animevideo-xsx4.pth) | X4 | Anime video model with XS size |
|
|
||||||
|
Note: <br>
|
||||||
|
<sup>1</sup> This model can also be used for X1, X2, X3.
|
||||||
|
|
||||||
The following models are **discriminators**, which are usually used for fine-tuning.
|
The following models are **discriminators**, which are usually used for fine-tuning.
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,8 @@ def main():
|
|||||||
'--model_name',
|
'--model_name',
|
||||||
type=str,
|
type=str,
|
||||||
default='RealESRGAN_x4plus',
|
default='RealESRGAN_x4plus',
|
||||||
help=('Model names: RealESRGAN_x4plus | RealESRNet_x4plus | RealESRGAN_x4plus_anime_6B | RealESRGAN_x2plus'
|
help=('Model names: RealESRGAN_x4plus | RealESRNet_x4plus | RealESRGAN_x4plus_anime_6B | RealESRGAN_x2plus | '
|
||||||
'RealESRGANv2-anime-xsx2 | RealESRGANv2-animevideo-xsx2-nousm | RealESRGANv2-animevideo-xsx2'
|
'realesr-animevideov3'))
|
||||||
'RealESRGANv2-anime-xsx4 | RealESRGANv2-animevideo-xsx4-nousm | RealESRGANv2-animevideo-xsx4'))
|
|
||||||
parser.add_argument('-o', '--output', type=str, default='results', help='Output folder')
|
parser.add_argument('-o', '--output', type=str, default='results', help='Output folder')
|
||||||
parser.add_argument('-s', '--outscale', type=float, default=4, help='The final upsampling scale of the image')
|
parser.add_argument('-s', '--outscale', type=float, default=4, help='The final upsampling scale of the image')
|
||||||
parser.add_argument('--suffix', type=str, default='out', help='Suffix of the restored image')
|
parser.add_argument('--suffix', type=str, default='out', help='Suffix of the restored image')
|
||||||
@@ -28,7 +27,8 @@ def main():
|
|||||||
parser.add_argument('--tile_pad', type=int, default=10, help='Tile padding')
|
parser.add_argument('--tile_pad', type=int, default=10, help='Tile padding')
|
||||||
parser.add_argument('--pre_pad', type=int, default=0, help='Pre padding size at each border')
|
parser.add_argument('--pre_pad', type=int, default=0, help='Pre padding size at each border')
|
||||||
parser.add_argument('--face_enhance', action='store_true', help='Use GFPGAN to enhance face')
|
parser.add_argument('--face_enhance', action='store_true', help='Use GFPGAN to enhance face')
|
||||||
parser.add_argument('--half', action='store_true', help='Use half precision during inference')
|
parser.add_argument(
|
||||||
|
'--fp32', action='store_true', help='Use fp32 precision during inference. Default: fp16 (half precision).')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--alpha_upsampler',
|
'--alpha_upsampler',
|
||||||
type=str,
|
type=str,
|
||||||
@@ -52,14 +52,7 @@ def main():
|
|||||||
elif args.model_name in ['RealESRGAN_x2plus']: # x2 RRDBNet model
|
elif args.model_name in ['RealESRGAN_x2plus']: # x2 RRDBNet model
|
||||||
model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=2)
|
model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=2)
|
||||||
netscale = 2
|
netscale = 2
|
||||||
elif args.model_name in [
|
elif args.model_name in ['realesr-animevideov3']: # x4 VGG-style model (XS size)
|
||||||
'RealESRGANv2-anime-xsx2', 'RealESRGANv2-animevideo-xsx2-nousm', 'RealESRGANv2-animevideo-xsx2'
|
|
||||||
]: # x2 VGG-style model (XS size)
|
|
||||||
model = SRVGGNetCompact(num_in_ch=3, num_out_ch=3, num_feat=64, num_conv=16, upscale=2, act_type='prelu')
|
|
||||||
netscale = 2
|
|
||||||
elif args.model_name in [
|
|
||||||
'RealESRGANv2-anime-xsx4', 'RealESRGANv2-animevideo-xsx4-nousm', 'RealESRGANv2-animevideo-xsx4'
|
|
||||||
]: # x4 VGG-style model (XS size)
|
|
||||||
model = SRVGGNetCompact(num_in_ch=3, num_out_ch=3, num_feat=64, num_conv=16, upscale=4, act_type='prelu')
|
model = SRVGGNetCompact(num_in_ch=3, num_out_ch=3, num_feat=64, num_conv=16, upscale=4, act_type='prelu')
|
||||||
netscale = 4
|
netscale = 4
|
||||||
|
|
||||||
@@ -78,12 +71,12 @@ def main():
|
|||||||
tile=args.tile,
|
tile=args.tile,
|
||||||
tile_pad=args.tile_pad,
|
tile_pad=args.tile_pad,
|
||||||
pre_pad=args.pre_pad,
|
pre_pad=args.pre_pad,
|
||||||
half=args.half)
|
half=not args.fp32)
|
||||||
|
|
||||||
if args.face_enhance: # Use GFPGAN for face enhancement
|
if args.face_enhance: # Use GFPGAN for face enhancement
|
||||||
from gfpgan import GFPGANer
|
from gfpgan import GFPGANer
|
||||||
face_enhancer = GFPGANer(
|
face_enhancer = GFPGANer(
|
||||||
model_path='https://github.com/TencentARC/GFPGAN/releases/download/v0.2.0/GFPGANCleanv1-NoCE-C2.pth',
|
model_path='https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth',
|
||||||
upscale=args.outscale,
|
upscale=args.outscale,
|
||||||
arch='clean',
|
arch='clean',
|
||||||
channel_multiplier=2,
|
channel_multiplier=2,
|
||||||
@@ -120,7 +113,10 @@ def main():
|
|||||||
extension = args.ext
|
extension = args.ext
|
||||||
if img_mode == 'RGBA': # RGBA images should be saved in png format
|
if img_mode == 'RGBA': # RGBA images should be saved in png format
|
||||||
extension = 'png'
|
extension = 'png'
|
||||||
save_path = os.path.join(args.output, f'{imgname}_{args.suffix}.{extension}')
|
if args.suffix == '':
|
||||||
|
save_path = os.path.join(args.output, f'{imgname}.{extension}')
|
||||||
|
else:
|
||||||
|
save_path = os.path.join(args.output, f'{imgname}_{args.suffix}.{extension}')
|
||||||
cv2.imwrite(save_path, output)
|
cv2.imwrite(save_path, output)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,11 +24,10 @@ def main():
|
|||||||
'-n',
|
'-n',
|
||||||
'--model_name',
|
'--model_name',
|
||||||
type=str,
|
type=str,
|
||||||
default='RealESRGAN_x4plus',
|
default='realesr-animevideov3',
|
||||||
help=('Model names: RealESRGAN_x4plus | RealESRNet_x4plus | RealESRGAN_x4plus_anime_6B | RealESRGAN_x2plus | '
|
help=('Model names: realesr-animevideov3 | RealESRGAN_x4plus_anime_6B | RealESRGAN_x4plus | RealESRNet_x4plus |'
|
||||||
'RealESRGANv2-anime-xsx2 | RealESRGANv2-animevideo-xsx2-nousm | RealESRGANv2-animevideo-xsx2 | '
|
' RealESRGAN_x2plus | '
|
||||||
'RealESRGANv2-anime-xsx4 | RealESRGANv2-animevideo-xsx4-nousm | RealESRGANv2-animevideo-xsx4. '
|
'Default:realesr-animevideov3'))
|
||||||
'Default: RealESRGAN_x4plus'))
|
|
||||||
parser.add_argument('-o', '--output', type=str, default='results', help='Output folder')
|
parser.add_argument('-o', '--output', type=str, default='results', help='Output folder')
|
||||||
parser.add_argument('-s', '--outscale', type=float, default=4, help='The final upsampling scale of the image')
|
parser.add_argument('-s', '--outscale', type=float, default=4, help='The final upsampling scale of the image')
|
||||||
parser.add_argument('--suffix', type=str, default='out', help='Suffix of the restored video')
|
parser.add_argument('--suffix', type=str, default='out', help='Suffix of the restored video')
|
||||||
@@ -36,9 +35,8 @@ def main():
|
|||||||
parser.add_argument('--tile_pad', type=int, default=10, help='Tile padding')
|
parser.add_argument('--tile_pad', type=int, default=10, help='Tile padding')
|
||||||
parser.add_argument('--pre_pad', type=int, default=0, help='Pre padding size at each border')
|
parser.add_argument('--pre_pad', type=int, default=0, help='Pre padding size at each border')
|
||||||
parser.add_argument('--face_enhance', action='store_true', help='Use GFPGAN to enhance face')
|
parser.add_argument('--face_enhance', action='store_true', help='Use GFPGAN to enhance face')
|
||||||
parser.add_argument('--half', action='store_true', help='Use half precision during inference')
|
parser.add_argument(
|
||||||
parser.add_argument('-v', '--video', action='store_true', help='Output a video using ffmpeg')
|
'--fp32', action='store_true', help='Use fp32 precision during inference. Default: fp16 (half precision).')
|
||||||
parser.add_argument('-a', '--audio', action='store_true', help='Keep audio')
|
|
||||||
parser.add_argument('--fps', type=float, default=None, help='FPS of the output video')
|
parser.add_argument('--fps', type=float, default=None, help='FPS of the output video')
|
||||||
parser.add_argument('--consumer', type=int, default=4, help='Number of IO consumers')
|
parser.add_argument('--consumer', type=int, default=4, help='Number of IO consumers')
|
||||||
|
|
||||||
@@ -55,7 +53,7 @@ def main():
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# ---------------------- determine models according to model names ---------------------- #
|
# ---------------------- determine models according to model names ---------------------- #
|
||||||
args.model_name = args.model_name.split('.')[0]
|
args.model_name = args.model_name.split('.pth')[0]
|
||||||
if args.model_name in ['RealESRGAN_x4plus', 'RealESRNet_x4plus']: # x4 RRDBNet model
|
if args.model_name in ['RealESRGAN_x4plus', 'RealESRNet_x4plus']: # x4 RRDBNet model
|
||||||
model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=4)
|
model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=4)
|
||||||
netscale = 4
|
netscale = 4
|
||||||
@@ -65,14 +63,7 @@ def main():
|
|||||||
elif args.model_name in ['RealESRGAN_x2plus']: # x2 RRDBNet model
|
elif args.model_name in ['RealESRGAN_x2plus']: # x2 RRDBNet model
|
||||||
model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=2)
|
model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=2)
|
||||||
netscale = 2
|
netscale = 2
|
||||||
elif args.model_name in [
|
elif args.model_name in ['realesr-animevideov3']: # x4 VGG-style model (XS size)
|
||||||
'RealESRGANv2-anime-xsx2', 'RealESRGANv2-animevideo-xsx2-nousm', 'RealESRGANv2-animevideo-xsx2'
|
|
||||||
]: # x2 VGG-style model (XS size)
|
|
||||||
model = SRVGGNetCompact(num_in_ch=3, num_out_ch=3, num_feat=64, num_conv=16, upscale=2, act_type='prelu')
|
|
||||||
netscale = 2
|
|
||||||
elif args.model_name in [
|
|
||||||
'RealESRGANv2-anime-xsx4', 'RealESRGANv2-animevideo-xsx4-nousm', 'RealESRGANv2-animevideo-xsx4'
|
|
||||||
]: # x4 VGG-style model (XS size)
|
|
||||||
model = SRVGGNetCompact(num_in_ch=3, num_out_ch=3, num_feat=64, num_conv=16, upscale=4, act_type='prelu')
|
model = SRVGGNetCompact(num_in_ch=3, num_out_ch=3, num_feat=64, num_conv=16, upscale=4, act_type='prelu')
|
||||||
netscale = 4
|
netscale = 4
|
||||||
|
|
||||||
@@ -91,12 +82,12 @@ def main():
|
|||||||
tile=args.tile,
|
tile=args.tile,
|
||||||
tile_pad=args.tile_pad,
|
tile_pad=args.tile_pad,
|
||||||
pre_pad=args.pre_pad,
|
pre_pad=args.pre_pad,
|
||||||
half=args.half)
|
half=not args.fp32)
|
||||||
|
|
||||||
if args.face_enhance: # Use GFPGAN for face enhancement
|
if args.face_enhance: # Use GFPGAN for face enhancement
|
||||||
from gfpgan import GFPGANer
|
from gfpgan import GFPGANer
|
||||||
face_enhancer = GFPGANer(
|
face_enhancer = GFPGANer(
|
||||||
model_path='https://github.com/TencentARC/GFPGAN/releases/download/v0.2.0/GFPGANCleanv1-NoCE-C2.pth',
|
model_path='https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth',
|
||||||
upscale=args.outscale,
|
upscale=args.outscale,
|
||||||
arch='clean',
|
arch='clean',
|
||||||
channel_multiplier=2,
|
channel_multiplier=2,
|
||||||
@@ -106,6 +97,7 @@ def main():
|
|||||||
save_frame_folder = os.path.join(args.output, 'frames_tmpout')
|
save_frame_folder = os.path.join(args.output, 'frames_tmpout')
|
||||||
os.makedirs(save_frame_folder, exist_ok=True)
|
os.makedirs(save_frame_folder, exist_ok=True)
|
||||||
|
|
||||||
|
# input can be a video file / a folder of frames / an image
|
||||||
if mimetypes.guess_type(args.input)[0].startswith('video'): # is a video file
|
if mimetypes.guess_type(args.input)[0].startswith('video'): # is a video file
|
||||||
video_name = os.path.splitext(os.path.basename(args.input))[0]
|
video_name = os.path.splitext(os.path.basename(args.input))[0]
|
||||||
frame_folder = os.path.join('tmp_frames', video_name)
|
frame_folder = os.path.join('tmp_frames', video_name)
|
||||||
@@ -114,13 +106,13 @@ def main():
|
|||||||
os.system(f'ffmpeg -i {args.input} -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 {frame_folder}/frame%08d.png')
|
os.system(f'ffmpeg -i {args.input} -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 {frame_folder}/frame%08d.png')
|
||||||
# get image path list
|
# get image path list
|
||||||
paths = sorted(glob.glob(os.path.join(frame_folder, '*')))
|
paths = sorted(glob.glob(os.path.join(frame_folder, '*')))
|
||||||
if args.video:
|
# get input video fps
|
||||||
if args.fps is None:
|
if args.fps is None:
|
||||||
# get input video fps
|
|
||||||
import ffmpeg
|
import ffmpeg
|
||||||
probe = ffmpeg.probe(args.input)
|
probe = ffmpeg.probe(args.input)
|
||||||
video_streams = [stream for stream in probe['streams'] if stream['codec_type'] == 'video']
|
video_streams = [stream for stream in probe['streams'] if stream['codec_type'] == 'video']
|
||||||
args.fps = eval(video_streams[0]['avg_frame_rate'])
|
args.fps = eval(video_streams[0]['avg_frame_rate'])
|
||||||
elif mimetypes.guess_type(args.input)[0].startswith('image'): # is an image file
|
elif mimetypes.guess_type(args.input)[0].startswith('image'): # is an image file
|
||||||
paths = [args.input]
|
paths = [args.input]
|
||||||
video_name = 'video'
|
video_name = 'video'
|
||||||
@@ -180,20 +172,13 @@ def main():
|
|||||||
pbar.close()
|
pbar.close()
|
||||||
|
|
||||||
# merge frames to video
|
# merge frames to video
|
||||||
if args.video:
|
video_save_path = os.path.join(args.output, f'{video_name}_{args.suffix}.mp4')
|
||||||
video_save_path = os.path.join(args.output, f'{video_name}_{args.suffix}.mp4')
|
os.system(f'ffmpeg -r {args.fps} -i {save_frame_folder}/frame%08d_out.{extension} -i {args.input}'
|
||||||
if args.audio:
|
f' -map 0:v:0 -map 1:a:0 -c:a copy -c:v libx264 -r {args.fps} -pix_fmt yuv420p {video_save_path}')
|
||||||
os.system(
|
# delete tmp file
|
||||||
f'ffmpeg -r {args.fps} -i {save_frame_folder}/frame%08d_out.{extension} -i {args.input}'
|
shutil.rmtree(save_frame_folder)
|
||||||
f' -map 0:v:0 -map 1:a:0 -c:a copy -c:v libx264 -r {args.fps} -pix_fmt yuv420p {video_save_path}')
|
if os.path.isdir(frame_folder):
|
||||||
else:
|
shutil.rmtree(frame_folder)
|
||||||
os.system(f'ffmpeg -r {args.fps} -i {save_frame_folder}/frame%08d_out.{extension} '
|
|
||||||
f'-c:v libx264 -r {args.fps} -pix_fmt yuv420p {video_save_path}')
|
|
||||||
|
|
||||||
# delete tmp file
|
|
||||||
shutil.rmtree(save_frame_folder)
|
|
||||||
if os.path.isdir(frame_folder):
|
|
||||||
shutil.rmtree(frame_folder)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user