butaixianran / VIdeo_Upscaler_by_GFPGAN

A VIdeo Upscaler script based on GFPGAN
MIT License
2 stars 0 forks source link

Video Upscaler Script with GFPGAN

A Video Upscaler script based on GFPGAN.
Compare to Real-ESRGAN, GFPGAN can restore faces nicely. But, it gonna be very very slow. Only use it for short videos.

This script is modified from
https://github.com/GeeveGeorge/GFPGAN-for-Video-SR

Install

How to use

Common Issue

Get the real error Msg

If you see any ffmpeg error msg like Format avi detected only with low score of 1, misdetection possible, that's not the real error.

The real issue is your GFPGAN failed. So ffmpeg can not get the result video it need. The real error msg, is the line before walking.

A basic rule for this project is: if your GFPGAN works, this project works. If your GFPGAN fails, this project fails too. So you better check following issues of GFPGAN.

Unrecognized arguments and file path

Your file and folder path should only use English character without any space in it.

Downloading failed

When using GFPGAN for the first time, it gonna download some models from github. One for Real-ESRGAN, others for GFPGAN. If downloading failed, it will show the downloading link and its target local folder path. So you can just manually download these models and put them into the right folder.

Can not find torchvision.transforms.functional_tensor

GFPGAN is based on a project called basicsr. This project uses function torchvision.transforms.functional_tensor which is removed from torchvision v0.17+. So, it only works with pytorch 1.x.

Working with torch 2.x

  1. You need to install torch 2.x by following its official installation document: https://pytorch.org/get-started/locally/

  2. You need to update your package basicsr. Which is needed by GFPGAN, but only works with pytorch 1.x if you install it with pip.

There are 2 ways to make it work with torch 2.x.