Complete tutorial:
We recommend installing an open-source project called CodeFormer, available at:
https://github.com/sczhou/CodeFormer
Installation Process:
1.Install Miniconda, download it from:
https://docs.conda.io/projects/miniconda/en/latest/
2.Download zip file fromhttps://github.com/sczhou/CodeFormer
Download the zip file from https://github.com/sczhou/CodeFormer, unzip it, and place it in your user folder at C:\Users. Rename the folder to "CodeFormer".
3.Install other dependencies:
Search for "anaconda prompt" in the bottom-left corner of your computer, open it, and then enter the following commands:
cd CodeFormer
conda create -n codeformer python=3.10 -y
conda activate codeformer
Install PyTorch, visit:
Choose according to your computer; for Windows, the default option usually works. Then copy and run a code similar to the following in the anaconda prompt:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
Proceed with the following commands for installation:
pip install -r requirements.txt
python basicsr/setup.py develop
python scripts/download_pretrained_models.py facelib
python scripts/download_pretrained_models.py CodeFormer
conda install -c conda-forge ffmpeg
Usage:
First, enter the environment:
cd CodeFormer
conda activate codeformer
Facial restoration:
python inference_codeformer.py -w 0.5 --has_aligned --input_path [input_folder]
Overall image enhancement:
python inference_codeformer.py -w 0.7 --input_path [input_folder]
Video restoration:
python inference_codeformer.py --bg_upsampler realesrgan --face_upsample -w 1.0 --input_path full_video_path
Project Removal:
If you no longer need the project, follow these steps:
1.Open Anaconda Prompt and enter the command:
conda remove --name codeformer --all
2.Delete the CodeFormer folder.
3.If you no longer need Miniconda, you can uninstall it as well.
Comments