
π English | Vietnamese
[Paper] β [Project Page] β [Demo]
Xintao Wang, Yu Li, Honglun Zhang, Ying Shan
Applied Research Center (ARC), Tencent PCG
Related ProjectsοΌ
- Vietnamese_OCR_documents: is used to convert text from images or scanned documents into digital format, allowing automatic processing and analysis of text data. This technology is very useful in extracting information from Vietnamese documents, making information searching and management easier and more efficient.
- Python >= 3.7 (Recommend to use Anaconda or Miniconda, Default: Miniconda)
- PyTorch >= 1.7
- Option: NVIDIA GPU + CUDA
- Clone this project:
git clone https://github.com/KaiKenju/FaceRestoration_GFPGAN.git
- Initial enviromment with Miniconda (Default: python 3.10):
conda create -n <env_name> python=3.10
- Activate conda
conda activate <env_name>
cd FaceRestoration_GFPGAN
- Run the commands:
pip install -r GFPGAN/requirements.txt
- After install requirements, you need to run the fix_torchvision.py to avoid the problem of basicsr module after install.
python fix_torchvision.py
Dowload pre-trained models : GFPGANv1.4.pth and put them following path model/GFPGANv1.4.pth
python main.py -i old_images_ori --output_dir my_result --upscale 2 --version 1.4
Usage: python main.py -i old_images_ori --output_dir my_result --upscale 2 --version 1.4
-h show this help
-i input Input image or folder. Default: old_images_ori
--output_dir output Output folder. Default: my_results
-v version GFPGAN model version. Option: 1 | 1.2 | 1.3. Default: 1.4
-s upscale The final upsampling scale of the image. Default: 2
-bg_upsampler background upsampler. Default: realesrgan
-bg_tile Tile size for background sampler, 0 for no tile during testing. Default: 400
-suffix Suffix of the restored faces
-only_center_face Only restore the center face
-aligned Input are aligned faces
-ext Image extension. Options: auto | jpg | png, auto means using the same extension as inputs. Default: auto
Tips
The first time you run the model and use CPU, it can be more time to load data, so to reduce time you can put weight file following path:
- Download pre-trained models and other data. Put them in the
GFPGAN/gfpgan/weights
folder. - Also in the
GFPGAN/weights
folder.