Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: iptop/GFPGAN-for-Video
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: start-life/GFPGAN-for-Video
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Feb 18, 2024

  1. Update restorer.py

    Support for GFPGAN 1.4
    start-life authored Feb 18, 2024
    Copy the full SHA
    4e11633 View commit details
  2. Update README.md

    start-life authored Feb 18, 2024
    Copy the full SHA
    99a37a8 View commit details
  3. Update README.md

    start-life authored Feb 18, 2024
    Copy the full SHA
    d76640d View commit details
Showing with 15 additions and 3 deletions.
  1. +12 −2 README.md
  2. +3 −1 src/utils/restorer.py
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## אז מה חדש?
- תמיכה בGFPGAN 1.4



## 环境配置

```bash
@@ -12,11 +17,16 @@ pip install -r requirements.txt
pip install realesrgan
```

## 下载模型
## Download GFPGANv1.3 models
```bash
wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P GFPGAN-1.3.8/experiments/pretrained_models
```

## Download GFPGANv1.4 models
```bash
wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P GFPGAN-1.3.8/experiments/pretrained_models
```

## 安装pytouch
gpu版本的pytouch不是必须的,没有安装的话会自动使用cpu计算
```bash
@@ -31,4 +41,4 @@ conda install -c conda-forge ffmpeg
## 修复视频
```bash
python src/video_enhance.py -i 1.mp4 -o 2.mp4
```
```
4 changes: 3 additions & 1 deletion src/utils/restorer.py
Original file line number Diff line number Diff line change
@@ -11,7 +11,9 @@ def __init__(self):
CURRENT_SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))

# 模型文件路径
model_path = os.path.join(CURRENT_SCRIPT_PATH, '../../gfpgan/weights', 'GFPGANv1.3' + '.pth')
model_path = os.path.join(CURRENT_SCRIPT_PATH, '../../gfpgan/weights', 'GFPGANv1.4' + '.pth')
if not os.path.exists(model_path):
model_path = model_path.replace('GFPGANv1.4', 'GFPGANv1.3')

# 加载模型
restorer = GFPGANer(