代码下载与环境说明
特殊说明:
- 作者使用的wsl Ubuntu-22.04子系统,然后借用本机代理
- 读者也可以换源(但是我之前使用换源,部分依赖没有下载成功)
我在root目录下克隆代码
git clone https://github.com/TencentARC/GFPGAN.git
cd GFPGAN
所需依赖
- 此处因为我是使用已经训练好的模型,所以我没有使用NVIDA GPU + CUDA
- 会影响安装PyTorch的命令(有GPU需要自己训练的可以使用GPU版本,我使用的是CPU版本)
- 我使用的是Ubuntu-22.04
依赖安装
1.安装 Anaconda
- 下载 Anaconda 安装脚本: 打开终端并运行以下命令下载 Anaconda 安装脚本:
wget https://repo.anaconda.com/archive/Anaconda3-2024.06-1-Linux-x86_64.sh
- 运行安装脚本: 运行以下命令执行安装脚本:
如果安装失败,卸载旧版本,重新安装即可
rm -rf ~/anaconda3
rm -rf ~/.condarc ~/.conda ~/.continuum
bash Anaconda3-2024.06-1-Linux-x86_64.sh
此处回车
- 按照提示进行安装: 你会看到一系列提示,按
Enter
键并阅读许可协议,输入yes
接受协议,然后选择安装路径(默认安装路径通常是合适的)。
同意协议
设置默认路径
是否初始化conda,这里一定要选yes,不然不能执行conda命令
- 激活 Anaconda: 安装完成后,运行以下命令来激活 Anaconda:
source ~/.bashrc
2. 创建新的 Conda 环境
创建一个新的 Conda 环境,确保使用 Python 3.7 或更高版本:
conda create -n myenv python=3.8
(base) root@DESKTOP-1FOD6A8:~# conda create -n myenv python=3.8
Channels:
- defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /root/anaconda3/envs/myenv
added / updated specs:
- python=3.8
The following packages will be downloaded:
package | build
---------------------------|-----------------
ca-certificates-2024.7.2 | h06a4308_0 127 KB
pip-24.0 | py38h06a4308_0 2.6 MB
python-3.8.19 | h955ad1f_0 23.8 MB
setuptools-69.5.1 | py38h06a4308_0 1002 KB
wheel-0.43.0 | py38h06a4308_0 109 KB
------------------------------------------------------------
Total: 27.6 MB
The following NEW packages will be INSTALLED:
_libgcc_mutex pkgs/main/linux-64::_libgcc_mutex-0.1-main
_openmp_mutex pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu
ca-certificates pkgs/main/linux-64::ca-certificates-2024.7.2-h06a4308_0
ld_impl_linux-64 pkgs/main/linux-64::ld_impl_linux-64-2.38-h1181459_1
libffi pkgs/main/linux-64::libffi-3.4.4-h6a678d5_1
libgcc-ng pkgs/main/linux-64::libgcc-ng-11.2.0-h1234567_1
libgomp pkgs/main/linux-64::libgomp-11.2.0-h1234567_1
libstdcxx-ng pkgs/main/linux-64::libstdcxx-ng-11.2.0-h1234567_1
ncurses pkgs/main/linux-64::ncurses-6.4-h6a678d5_0
openssl pkgs/main/linux-64::openssl-3.0.14-h5eee18b_0
pip pkgs/main/linux-64::pip-24.0-py38h06a4308_0
python pkgs/main/linux-64::python-3.8.19-h955ad1f_0
readline pkgs/main/linux-64::readline-8.2-h5eee18b_0
setuptools pkgs/main/linux-64::setuptools-69.5.1-py38h06a4308_0
sqlite pkgs/main/linux-64::sqlite-3.45.3-h5eee18b_0
tk pkgs/main/linux-64::tk-8.6.14-h39e8969_0
wheel pkgs/main/linux-64::wheel-0.43.0-py38h06a4308_0
xz pkgs/main/linux-64::xz-5.4.6-h5eee18b_1
zlib pkgs/main/linux-64::zlib-1.2.13-h5eee18b_1
Proceed ([y]/n)? y
Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate myenv
#
# To deactivate an active environment, use
#
# $ conda deactivate
(base) root@DESKTOP-1FOD6A8:~#
激活新环境:
conda activate myenv
3. 安装 PyTorch
在新的 Conda 环境中安装 PyTorch(版本 >= 1.7):
- 选择合适的安装命令: 前往 PyTorch官网,选择你的配置(OS: Linux,Package: Conda,Language: Python,Compute Platform: CPU 或 CUDA)。
- 运行安装命令: 例如,如果你选择使用 CPU 版本,可以运行以下命令(本次使用):
conda install pytorch torchvision torchaudio cpuonly -c pytorch
(myenv) root@DESKTOP-1FOD6A8:~# conda install pytorch torchvision torchaudio cpuonly -c pytorch
Channels:
- pytorch
- defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /root/anaconda3/envs/myenv
added / updated specs:
- cpuonly
- pytorch
- torchaudio
- torchvision
The following packages will be downloaded:
package | build
---------------------------|-----------------
brotli-python-1.0.9 | py38h6a678d5_8 356 KB
certifi-2024.7.4 | py38h06a4308_0 158 KB
charset-normalizer-3.3.2 | pyhd3eb1b0_0 44 KB
cpuonly-2.0 | 0 2 KB pytorch
ffmpeg-4.3 | hf484d3e_0 9.9 MB pytorch
filelock-3.13.1 | py38h06a4308_0 21 KB
gmp-6.2.1 | h295c915_3 544 KB
gmpy2-2.1.2 | py38heeb90bb_0 191 KB
gnutls-3.6.15 | he1e5248_0 1.0 MB
idna-3.7 | py38h06a4308_0 113 KB
jinja2-3.1.4 | py38h06a4308_0 275 KB
jpeg-9e | h5eee18b_2 260 KB
lame-3.100 | h7b6447c_0 323 KB
libidn2-2.3.4 | h5eee18b_0 146 KB
libjpeg-turbo-2.0.0 | h9bf148f_0 950 KB pytorch
libtasn1-4.19.0 | h5eee18b_0 63 KB
libunistring-0.9.10 | h27cfd23_0 536 KB
llvm-openmp-14.0.6 | h9e868ea_0 4.4 MB
markupsafe-2.1.3 | py38h5eee18b_0 22 KB
mkl-service-2.4.0 | py38h5eee18b_1 54 KB
mkl_fft-1.3.8 | py38h5eee18b_0 221 KB
mkl_random-1.2.4 | py38hdb19cb5_0 327 KB
mpc-1.1.0 | h10f8cd9_1 90 KB
mpfr-4.0.2 | hb69a4c5_1 487 KB
mpmath-1.3.0 | py38h06a4308_0 832 KB
nettle-3.7.3 | hbbd107a_1 809 KB
networkx-3.1 | py38h06a4308_0 2.7 MB
numpy-1.24.3 | py38hf6e8229_1 10 KB
numpy-base-1.24.3 | py38h060ed82_1 6.2 MB
openh264-2.1.1 | h4ff587b_0 711 KB
openjpeg-2.4.0 | h9ca470c_2 363 KB
pillow-10.4.0 | py38h5eee18b_0 795 KB
pysocks-1.7.1 | py38h06a4308_0 31 KB
pytorch-2.4.0 | py3.8_cpu_0 85.3 MB pytorch
pytorch-mutex-1.0 | cpu 3 KB pytorch
pyyaml-6.0.1 | py38h5eee18b_0 192 KB
requests-2.32.3 | py38h06a4308_0 100 KB
sympy-1.12 | py38h06a4308_0 10.5 MB
torchaudio-2.4.0 | py38_cpu 4.9 MB pytorch
torchvision-0.19.0 | py38_cpu 11.6 MB pytorch
typing_extensions-4.11.0 | py38h06a4308_0 59 KB
urllib3-2.2.2 | py38h06a4308_0 177 KB
------------------------------------------------------------
Total: 145.7 MB
The following NEW packages will be INSTALLED:
blas pkgs/main/linux-64::blas-1.0-mkl
brotli-python pkgs/main/linux-64::brotli-python-1.0.9-py38h6a678d5_8
bzip2 pkgs/main/linux-64::bzip2-1.0.8-h5eee18b_6
certifi pkgs/main/linux-64::certifi-2024.7.4-py38h06a4308_0
charset-normalizer pkgs/main/noarch::charset-normalizer-3.3.2-pyhd3eb1b0_0
cpuonly pytorch/noarch::cpuonly-2.0-0
ffmpeg pytorch/linux-64::ffmpeg-4.3-hf484d3e_0
filelock pkgs/main/linux-64::filelock-3.13.1-py38h06a4308_0
freetype pkgs/main/linux-64::freetype-2.12.1-h4a9f257_0
gmp pkgs/main/linux-64::gmp-6.2.1-h295c915_3
gmpy2 pkgs/main/linux-64::gmpy2-2.1.2-py38heeb90bb_0
gnutls pkgs/main/linux-64::gnutls-3.6.15-he1e5248_0
idna pkgs/main/linux-64::idna-3.7-py38h06a4308_0
intel-openmp pkgs/main/linux-64::intel-openmp-2023.1.0-hdb19cb5_46306
jinja2 pkgs/main/linux-64::jinja2-3.1.4-py38h06a4308_0
jpeg pkgs/main/linux-64::jpeg-9e-h5eee18b_2
lame pkgs/main/linux-64::lame-3.100-h7b6447c_0
lcms2 pkgs/main/linux-64::lcms2-2.12-h3be6417_0
lerc pkgs/main/linux-64::lerc-3.0-h295c915_0
libdeflate pkgs/main/linux-64::libdeflate-1.17-h5eee18b_1
libiconv pkgs/main/linux-64::libiconv-1.16-h5eee18b_3
libidn2 pkgs/main/linux-64::libidn2-2.3.4-h5eee18b_0
libjpeg-turbo pytorch/linux-64::libjpeg-turbo-2.0.0-h9bf148f_0
libpng pkgs/main/linux-64::libpng-1.6.39-h5eee18b_0
libtasn1 pkgs/main/linux-64::libtasn1-4.19.0-h5eee18b_0
libtiff pkgs/main/linux-64::libtiff-4.5.1-h6a678d5_0
libunistring pkgs/main/linux-64::libunistring-0.9.10-h27cfd23_0
libwebp-base pkgs/main/linux-64::libwebp-base-1.3.2-h5eee18b_0
llvm-openmp pkgs/main/linux-64::llvm-openmp-14.0.6-h9e868ea_0
lz4-c pkgs/main/linux-64::lz4-c-1.9.4-h6a678d5_1
markupsafe pkgs/main/linux-64::markupsafe-2.1.3-py38h5eee18b_0
mkl pkgs/main/linux-64::mkl-2023.1.0-h213fc3f_46344
mkl-service pkgs/main/linux-64::mkl-service-2.4.0-py38h5eee18b_1
mkl_fft pkgs/main/linux-64::mkl_fft-1.3.8-py38h5eee18b_0
mkl_random pkgs/main/linux-64::mkl_random-1.2.4-py38hdb19cb5_0
mpc pkgs/main/linux-64::mpc-1.1.0-h10f8cd9_1
mpfr pkgs/main/linux-64::mpfr-4.0.2-hb69a4c5_1
mpmath pkgs/main/linux-64::mpmath-1.3.0-py38h06a4308_0
nettle pkgs/main/linux-64::nettle-3.7.3-hbbd107a_1
networkx pkgs/main/linux-64::networkx-3.1-py38h06a4308_0
numpy pkgs/main/linux-64::numpy-1.24.3-py38hf6e8229_1
numpy-base pkgs/main/linux-64::numpy-base-1.24.3-py38h060ed82_1
openh264 pkgs/main/linux-64::openh264-2.1.1-h4ff587b_0
openjpeg pkgs/main/linux-64::openjpeg-2.4.0-h9ca470c_2
pillow pkgs/main/linux-64::pillow-10.4.0-py38h5eee18b_0
pysocks pkgs/main/linux-64::pysocks-1.7.1-py38h06a4308_0
pytorch pytorch/linux-64::pytorch-2.4.0-py3.8_cpu_0
pytorch-mutex pytorch/noarch::pytorch-mutex-1.0-cpu
pyyaml pkgs/main/linux-64::pyyaml-6.0.1-py38h5eee18b_0
requests pkgs/main/linux-64::requests-2.32.3-py38h06a4308_0
sympy pkgs/main/linux-64::sympy-1.12-py38h06a4308_0
tbb pkgs/main/linux-64::tbb-2021.8.0-hdb19cb5_0
torchaudio pytorch/linux-64::torchaudio-2.4.0-py38_cpu
torchvision pytorch/linux-64::torchvision-0.19.0-py38_cpu
typing_extensions pkgs/main/linux-64::typing_extensions-4.11.0-py38h06a4308_0
urllib3 pkgs/main/linux-64::urllib3-2.2.2-py38h06a4308_0
yaml pkgs/main/linux-64::yaml-0.2.5-h7b6447c_0
zstd pkgs/main/linux-64::zstd-1.5.5-hc292b87_2
Proceed ([y]/n)?
Downloading and Extracting Packages:
pytorch-2.4.0 | 85.3 MB | ################1 | 12%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(myenv) root@DESKTOP-1FOD6A8:~# ~
如果你选择使用 CUDA(假设 CUDA 11.1),可以运行以下命令:
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia
这样,你就完成了在 Ubuntu 22.04 上安装 Python(通过 Anaconda 或 Miniconda)和 PyTorch(版本 >= 1.7)的步骤。
4.安装GFPGAN所需Python依赖
pip install basicsr
(myenv) root@DESKTOP-1FOD6A8:~# pip install basicsr
Collecting basicsr
Downloading basicsr-1.4.2.tar.gz (172 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 172.5/172.5 kB 776.8 kB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting addict (from basicsr)
Downloading addict-2.4.0-py3-none-any.whl.metadata (1.0 kB)
Collecting future (from basicsr)
Downloading future-1.0.0-py3-none-any.whl.metadata (4.0 kB)
Collecting lmdb (from basicsr)
Downloading lmdb-1.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.1 kB)
Requirement already satisfied: numpy>=1.17 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr) (1.24.3)
Collecting opencv-python (from basicsr)
Downloading opencv_python-4.10.0.84-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (20 kB)
Requirement already satisfied: Pillow in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr) (10.4.0)
Requirement already satisfied: pyyaml in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr) (6.0.1)
Requirement already satisfied: requests in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr) (2.32.3)
Collecting scikit-image (from basicsr)
Downloading scikit_image-0.21.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (14 kB)
Collecting scipy (from basicsr)
Downloading scipy-1.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (58 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.9/58.9 kB 1.7 MB/s eta 0:00:00
Collecting tb-nightly (from basicsr)
Downloading tb_nightly-2.14.0a20230808-py3-none-any.whl.metadata (1.8 kB)
Requirement already satisfied: torch>=1.7 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr) (2.4.0)
Requirement already satisfied: torchvision in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr) (0.19.0)
Collecting tqdm (from basicsr)
Downloading tqdm-4.66.4-py3-none-any.whl.metadata (57 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.6/57.6 kB 2.1 MB/s eta 0:00:00
Collecting yapf (from basicsr)
Downloading yapf-0.40.2-py3-none-any.whl.metadata (45 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.4/45.4 kB 1.5 MB/s eta 0:00:00
Requirement already satisfied: filelock in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->basicsr) (3.13.1)
Requirement already satisfied: typing-extensions>=4.8.0 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->basicsr) (4.11.0)
Requirement already satisfied: sympy in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->basicsr) (1.12)
Requirement already satisfied: networkx in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->basicsr) (3.1)
Requirement already satisfied: jinja2 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->basicsr) (3.1.4)
Collecting fsspec (from torch>=1.7->basicsr)
Using cached fsspec-2024.6.1-py3-none-any.whl.metadata (11 kB)
Requirement already satisfied: charset-normalizer<4,>=2 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from requests->basicsr) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from requests->basicsr) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from requests->basicsr) (2.2.2)
Requirement already satisfied: certifi>=2017.4.17 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from requests->basicsr) (2024.7.4)
Collecting imageio>=2.27 (from scikit-image->basicsr)
Downloading imageio-2.34.2-py3-none-any.whl.metadata (4.9 kB)
Collecting tifffile>=2022.8.12 (from scikit-image->basicsr)
Downloading tifffile-2023.7.10-py3-none-any.whl.metadata (31 kB)
Collecting PyWavelets>=1.1.1 (from scikit-image->basicsr)
Downloading PyWavelets-1.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.9 kB)
Collecting packaging>=21 (from scikit-image->basicsr)
Downloading packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
Collecting lazy_loader>=0.2 (from scikit-image->basicsr)
Downloading lazy_loader-0.4-py3-none-any.whl.metadata (7.6 kB)
Collecting absl-py>=0.4 (from tb-nightly->basicsr)
Downloading absl_py-2.1.0-py3-none-any.whl.metadata (2.3 kB)
Collecting grpcio>=1.48.2 (from tb-nightly->basicsr)
Downloading grpcio-1.65.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.3 kB)
Collecting google-auth<3,>=1.6.3 (from tb-nightly->basicsr)
Downloading google_auth-2.32.0-py2.py3-none-any.whl.metadata (4.7 kB)
Collecting google-auth-oauthlib<1.1,>=0.5 (from tb-nightly->basicsr)
Downloading google_auth_oauthlib-1.0.0-py2.py3-none-any.whl.metadata (2.7 kB)
Collecting markdown>=2.6.8 (from tb-nightly->basicsr)
Downloading Markdown-3.6-py3-none-any.whl.metadata (7.0 kB)
Collecting protobuf>=3.19.6 (from tb-nightly->basicsr)
Downloading protobuf-5.27.2-cp38-abi3-manylinux2014_x86_64.whl.metadata (592 bytes)
Requirement already satisfied: setuptools>=41.0.0 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->basicsr) (69.5.1)
Collecting tensorboard-data-server<0.8.0,>=0.7.0 (from tb-nightly->basicsr)
Downloading tensorboard_data_server-0.7.2-py3-none-manylinux_2_31_x86_64.whl.metadata (1.1 kB)
Collecting werkzeug>=1.0.1 (from tb-nightly->basicsr)
Downloading werkzeug-3.0.3-py3-none-any.whl.metadata (3.7 kB)
Requirement already satisfied: wheel>=0.26 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->basicsr) (0.43.0)
Collecting importlib-metadata>=6.6.0 (from yapf->basicsr)
Downloading importlib_metadata-8.2.0-py3-none-any.whl.metadata (4.7 kB)
Collecting platformdirs>=3.5.1 (from yapf->basicsr)
Downloading platformdirs-4.2.2-py3-none-any.whl.metadata (11 kB)
Collecting tomli>=2.0.1 (from yapf->basicsr)
Downloading tomli-2.0.1-py3-none-any.whl.metadata (8.9 kB)
Collecting cachetools<6.0,>=2.0.0 (from google-auth<3,>=1.6.3->tb-nightly->basicsr)
Downloading cachetools-5.4.0-py3-none-any.whl.metadata (5.3 kB)
Collecting pyasn1-modules>=0.2.1 (from google-auth<3,>=1.6.3->tb-nightly->basicsr)
Downloading pyasn1_modules-0.4.0-py3-none-any.whl.metadata (3.4 kB)
Collecting rsa<5,>=3.1.4 (from google-auth<3,>=1.6.3->tb-nightly->basicsr)
Downloading rsa-4.9-py3-none-any.whl.metadata (4.2 kB)
Collecting requests-oauthlib>=0.7.0 (from google-auth-oauthlib<1.1,>=0.5->tb-nightly->basicsr)
Downloading requests_oauthlib-2.0.0-py2.py3-none-any.whl.metadata (11 kB)
Collecting zipp>=0.5 (from importlib-metadata>=6.6.0->yapf->basicsr)
Downloading zipp-3.19.2-py3-none-any.whl.metadata (3.6 kB)
Requirement already satisfied: MarkupSafe>=2.1.1 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from werkzeug>=1.0.1->tb-nightly->basicsr) (2.1.3)
Requirement already satisfied: mpmath>=0.19 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from sympy->torch>=1.7->basicsr) (1.3.0)
Collecting pyasn1<0.7.0,>=0.4.6 (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tb-nightly->basicsr)
Downloading pyasn1-0.6.0-py2.py3-none-any.whl.metadata (8.3 kB)
Collecting oauthlib>=3.0.0 (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tb-nightly->basicsr)
Downloading oauthlib-3.2.2-py3-none-any.whl.metadata (7.5 kB)
Downloading addict-2.4.0-py3-none-any.whl (3.8 kB)
Downloading future-1.0.0-py3-none-any.whl (491 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 491.3/491.3 kB 314.3 kB/s eta 0:00:00
Downloading lmdb-1.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (294 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 294.6/294.6 kB 693.4 kB/s eta 0:00:00
Downloading opencv_python-4.10.0.84-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (62.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.5/62.5 MB 7.4 MB/s eta 0:00:00
Downloading scikit_image-0.21.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.9/13.9 MB 4.4 MB/s eta 0:00:00
Downloading scipy-1.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 34.5/34.5 MB 8.2 MB/s eta 0:00:00
Downloading tb_nightly-2.14.0a20230808-py3-none-any.whl (5.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.5/5.5 MB 6.3 MB/s eta 0:00:00
Downloading tqdm-4.66.4-py3-none-any.whl (78 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.3/78.3 kB 4.6 MB/s eta 0:00:00
Downloading yapf-0.40.2-py3-none-any.whl (254 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 254.7/254.7 kB 4.6 MB/s eta 0:00:00
Downloading absl_py-2.1.0-py3-none-any.whl (133 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.7/133.7 kB 4.1 MB/s eta 0:00:00
Downloading google_auth-2.32.0-py2.py3-none-any.whl (195 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 195.5/195.5 kB 1.8 MB/s eta 0:00:00
Downloading google_auth_oauthlib-1.0.0-py2.py3-none-any.whl (18 kB)
Downloading grpcio-1.65.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 6.6 MB/s eta 0:00:00
Downloading imageio-2.34.2-py3-none-any.whl (313 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 313.5/313.5 kB 3.1 MB/s eta 0:00:00
Downloading importlib_metadata-8.2.0-py3-none-any.whl (25 kB)
Downloading lazy_loader-0.4-py3-none-any.whl (12 kB)
Downloading Markdown-3.6-py3-none-any.whl (105 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 105.4/105.4 kB 1.1 MB/s eta 0:00:00
Downloading packaging-24.1-py3-none-any.whl (53 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.0/54.0 kB 1.3 MB/s eta 0:00:00
Downloading platformdirs-4.2.2-py3-none-any.whl (18 kB)
Downloading protobuf-5.27.2-cp38-abi3-manylinux2014_x86_64.whl (309 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 309.3/309.3 kB 3.2 MB/s eta 0:00:00
Downloading PyWavelets-1.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.9/6.9 MB 4.3 MB/s eta 0:00:00
Downloading tensorboard_data_server-0.7.2-py3-none-manylinux_2_31_x86_64.whl (6.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.6/6.6 MB 9.5 MB/s eta 0:00:00
Downloading tifffile-2023.7.10-py3-none-any.whl (220 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 220.9/220.9 kB 2.5 MB/s eta 0:00:00
Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
Downloading werkzeug-3.0.3-py3-none-any.whl (227 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 227.3/227.3 kB 2.8 MB/s eta 0:00:00
Using cached fsspec-2024.6.1-py3-none-any.whl (177 kB)
Downloading cachetools-5.4.0-py3-none-any.whl (9.5 kB)
Downloading pyasn1_modules-0.4.0-py3-none-any.whl (181 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 181.2/181.2 kB 1.6 MB/s eta 0:00:00
Downloading requests_oauthlib-2.0.0-py2.py3-none-any.whl (24 kB)
Downloading rsa-4.9-py3-none-any.whl (34 kB)
Downloading zipp-3.19.2-py3-none-any.whl (9.0 kB)
Downloading oauthlib-3.2.2-py3-none-any.whl (151 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.7/151.7 kB 281.8 kB/s eta 0:00:00
Downloading pyasn1-0.6.0-py2.py3-none-any.whl (85 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85.3/85.3 kB 610.0 kB/s eta 0:00:00
Building wheels for collected packages: basicsr
Building wheel for basicsr (setup.py) ... done
Created wheel for basicsr: filename=basicsr-1.4.2-py3-none-any.whl size=214818 sha256=12070a01afaef1b82fa70b24952bfa176094fe7630ac2ac614280851f7ce21c3
Stored in directory: /root/.cache/pip/wheels/4d/d3/95/e17d0bcdd7dcfb0dbf79db006711e434c42036efbf6695ef7f
Successfully built basicsr
Installing collected packages: lmdb, addict, zipp, werkzeug, tqdm, tomli, tifffile, tensorboard-data-server, scipy, PyWavelets, pyasn1, protobuf, platformdirs, packaging, opencv-python, oauthlib, imageio, grpcio, future, fsspec, cachetools, absl-py, rsa, requests-oauthlib, pyasn1-modules, lazy_loader, importlib-metadata, yapf, scikit-image, markdown, google-auth, google-auth-oauthlib, tb-nightly, basicsr
Successfully installed PyWavelets-1.4.1 absl-py-2.1.0 addict-2.4.0 basicsr-1.4.2 cachetools-5.4.0 fsspec-2024.6.1 future-1.0.0 google-auth-2.32.0 google-auth-oauthlib-1.0.0 grpcio-1.65.1 imageio-2.34.2 importlib-metadata-8.2.0 lazy_loader-0.4 lmdb-1.5.1 markdown-3.6 oauthlib-3.2.2 opencv-python-4.10.0.84 packaging-24.1 platformdirs-4.2.2 protobuf-5.27.2 pyasn1-0.6.0 pyasn1-modules-0.4.0 requests-oauthlib-2.0.0 rsa-4.9 scikit-image-0.21.0 scipy-1.10.1 tb-nightly-2.14.0a20230808 tensorboard-data-server-0.7.2 tifffile-2023.7.10 tomli-2.0.1 tqdm-4.66.4 werkzeug-3.0.3 yapf-0.40.2 zipp-3.19.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
pip install facexlib
(myenv) root@DESKTOP-1FOD6A8:~# pip install facexlib
Collecting facexlib
Downloading facexlib-0.3.0-py3-none-any.whl.metadata (4.6 kB)
Collecting filterpy (from facexlib)
Downloading filterpy-1.4.5.zip (177 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 178.0/178.0 kB 1.1 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting numba (from facexlib)
Downloading numba-0.58.1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.7 kB)
Requirement already satisfied: numpy in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from facexlib) (1.24.3)
Requirement already satisfied: opencv-python in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from facexlib) (4.10.0.84)
Requirement already satisfied: Pillow in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from facexlib) (10.4.0)
Requirement already satisfied: scipy in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from facexlib) (1.10.1)
Requirement already satisfied: torch in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from facexlib) (2.4.0)
Requirement already satisfied: torchvision in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from facexlib) (0.19.0)
Requirement already satisfied: tqdm in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from facexlib) (4.66.4)
Collecting matplotlib (from filterpy->facexlib)
Downloading matplotlib-3.7.5-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.metadata (5.7 kB)
Collecting llvmlite<0.42,>=0.41.0dev0 (from numba->facexlib)
Downloading llvmlite-0.41.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.8 kB)
Requirement already satisfied: importlib-metadata in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from numba->facexlib) (8.2.0)
Requirement already satisfied: filelock in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from torch->facexlib) (3.13.1)
Requirement already satisfied: typing-extensions>=4.8.0 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from torch->facexlib) (4.11.0)
Requirement already satisfied: sympy in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from torch->facexlib) (1.12)
Requirement already satisfied: networkx in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from torch->facexlib) (3.1)
Requirement already satisfied: jinja2 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from torch->facexlib) (3.1.4)
Requirement already satisfied: fsspec in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from torch->facexlib) (2024.6.1)
Requirement already satisfied: zipp>=0.5 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from importlib-metadata->numba->facexlib) (3.19.2)
Requirement already satisfied: MarkupSafe>=2.0 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from jinja2->torch->facexlib) (2.1.3)
Collecting contourpy>=1.0.1 (from matplotlib->filterpy->facexlib)
Downloading contourpy-1.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (5.9 kB)
Collecting cycler>=0.10 (from matplotlib->filterpy->facexlib)
Downloading cycler-0.12.1-py3-none-any.whl.metadata (3.8 kB)
Collecting fonttools>=4.22.0 (from matplotlib->filterpy->facexlib)
Downloading fonttools-4.53.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (162 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 162.6/162.6 kB 1.6 MB/s eta 0:00:00
Collecting kiwisolver>=1.0.1 (from matplotlib->filterpy->facexlib)
Downloading kiwisolver-1.4.5-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.metadata (6.4 kB)
Requirement already satisfied: packaging>=20.0 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib) (24.1)
Collecting pyparsing>=2.3.1 (from matplotlib->filterpy->facexlib)
Downloading pyparsing-3.1.2-py3-none-any.whl.metadata (5.1 kB)
Collecting python-dateutil>=2.7 (from matplotlib->filterpy->facexlib)
Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting importlib-resources>=3.2.0 (from matplotlib->filterpy->facexlib)
Downloading importlib_resources-6.4.0-py3-none-any.whl.metadata (3.9 kB)
Requirement already satisfied: mpmath>=0.19 in ./anaconda3/envs/myenv/lib/python3.8/site-packages (from sympy->torch->facexlib) (1.3.0)
Collecting six>=1.5 (from python-dateutil>=2.7->matplotlib->filterpy->facexlib)
Downloading six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Downloading facexlib-0.3.0-py3-none-any.whl (59 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59.6/59.6 kB 5.1 MB/s eta 0:00:00
Downloading numba-0.58.1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.7/3.7 MB 3.1 MB/s eta 0:00:00
Downloading llvmlite-0.41.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (43.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.6/43.6 MB 6.0 MB/s eta 0:00:00
Downloading matplotlib-3.7.5-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (9.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.2/9.2 MB 7.3 MB/s eta 0:00:00
Downloading contourpy-1.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (301 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 301.1/301.1 kB 2.7 MB/s eta 0:00:00
Downloading cycler-0.12.1-py3-none-any.whl (8.3 kB)
Downloading fonttools-4.53.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.7/4.7 MB 8.4 MB/s eta 0:00:00
Downloading importlib_resources-6.4.0-py3-none-any.whl (38 kB)
Downloading kiwisolver-1.4.5-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 2.6 MB/s eta 0:00:00
Downloading pyparsing-3.1.2-py3-none-any.whl (103 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 103.2/103.2 kB 1.3 MB/s eta 0:00:00
Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 229.9/229.9 kB 2.2 MB/s eta 0:00:00
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: filterpy
Building wheel for filterpy (setup.py) ... done
Created wheel for filterpy: filename=filterpy-1.4.5-py3-none-any.whl size=110458 sha256=6f412ae467a9f12d48295e0525d8a3d0510e8c6f782a0aaa0c514e3587b4c46e
Stored in directory: /root/.cache/pip/wheels/fe/f6/cb/40331472edf4fd399b8cad02973c6acbdf26898342928327fe
Successfully built filterpy
Installing collected packages: six, pyparsing, llvmlite, kiwisolver, importlib-resources, fonttools, cycler, contourpy, python-dateutil, numba, matplotlib, filterpy, facexlib
Successfully installed contourpy-1.1.1 cycler-0.12.1 facexlib-0.3.0 filterpy-1.4.5 fonttools-4.53.1 importlib-resources-6.4.0 kiwisolver-1.4.5 llvmlite-0.41.1 matplotlib-3.7.5 numba-0.58.1 pyparsing-3.1.2 python-dateutil-2.9.0.post0 six-1.16.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
pip install -r requirements.txt
(myenv) root@DESKTOP-1FOD6A8:~/GFPGAN# pip install -r requirements.txt
Requirement already satisfied: basicsr>=1.4.2 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (1.4.2)
Requirement already satisfied: facexlib>=0.2.5 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from -r requirements.txt (line 2)) (0.3.0)
Requirement already satisfied: lmdb in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from -r requirements.txt (line 3)) (1.5.1)
Requirement already satisfied: numpy in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from -r requirements.txt (line 4)) (1.24.3)
Requirement already satisfied: opencv-python in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from -r requirements.txt (line 5)) (4.10.0.84)
Requirement already satisfied: pyyaml in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from -r requirements.txt (line 6)) (6.0.1)
Requirement already satisfied: scipy in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from -r requirements.txt (line 7)) (1.10.1)
Requirement already satisfied: tb-nightly in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from -r requirements.txt (line 8)) (2.14.0a20230808)
Requirement already satisfied: torch>=1.7 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from -r requirements.txt (line 9)) (2.4.0)
Requirement already satisfied: torchvision in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from -r requirements.txt (line 10)) (0.19.0)
Requirement already satisfied: tqdm in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from -r requirements.txt (line 11)) (4.66.4)
Requirement already satisfied: yapf in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from -r requirements.txt (line 12)) (0.40.2)
Requirement already satisfied: addict in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->-r requirements.txt (line 1)) (2.4.0)
Requirement already satisfied: future in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->-r requirements.txt (line 1)) (1.0.0)
Requirement already satisfied: Pillow in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->-r requirements.txt (line 1)) (10.4.0)
Requirement already satisfied: requests in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->-r requirements.txt (line 1)) (2.32.3)
Requirement already satisfied: scikit-image in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->-r requirements.txt (line 1)) (0.21.0)
Requirement already satisfied: filterpy in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from facexlib>=0.2.5->-r requirements.txt (line 2)) (1.4.5)
Requirement already satisfied: numba in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from facexlib>=0.2.5->-r requirements.txt (line 2)) (0.58.1)
Requirement already satisfied: absl-py>=0.4 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->-r requirements.txt (line 8)) (2.1.0)
Requirement already satisfied: grpcio>=1.48.2 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->-r requirements.txt (line 8)) (1.65.1)
Requirement already satisfied: google-auth<3,>=1.6.3 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->-r requirements.txt (line 8)) (2.32.0)
Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->-r requirements.txt (line 8)) (1.0.0)
Requirement already satisfied: markdown>=2.6.8 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->-r requirements.txt (line 8)) (3.6)
Requirement already satisfied: protobuf>=3.19.6 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->-r requirements.txt (line 8)) (5.27.2)
Requirement already satisfied: setuptools>=41.0.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->-r requirements.txt (line 8)) (69.5.1)
Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->-r requirements.txt (line 8)) (0.7.2)
Requirement already satisfied: werkzeug>=1.0.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->-r requirements.txt (line 8)) (3.0.3)
Requirement already satisfied: wheel>=0.26 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->-r requirements.txt (line 8)) (0.43.0)
Requirement already satisfied: filelock in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->-r requirements.txt (line 9)) (3.13.1)
Requirement already satisfied: typing-extensions>=4.8.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->-r requirements.txt (line 9)) (4.11.0)
Requirement already satisfied: sympy in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->-r requirements.txt (line 9)) (1.12)
Requirement already satisfied: networkx in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->-r requirements.txt (line 9)) (3.1)
Requirement already satisfied: jinja2 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->-r requirements.txt (line 9)) (3.1.4)
Requirement already satisfied: fsspec in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->-r requirements.txt (line 9)) (2024.6.1)
Requirement already satisfied: importlib-metadata>=6.6.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from yapf->-r requirements.txt (line 12)) (8.2.0)
Requirement already satisfied: platformdirs>=3.5.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from yapf->-r requirements.txt (line 12)) (4.2.2)
Requirement already satisfied: tomli>=2.0.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from yapf->-r requirements.txt (line 12)) (2.0.1)
Requirement already satisfied: cachetools<6.0,>=2.0.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from google-auth<3,>=1.6.3->tb-nightly->-r requirements.txt (line 8)) (5.4.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from google-auth<3,>=1.6.3->tb-nightly->-r requirements.txt (line 8)) (0.4.0)
Requirement already satisfied: rsa<5,>=3.1.4 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from google-auth<3,>=1.6.3->tb-nightly->-r requirements.txt (line 8)) (4.9)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from google-auth-oauthlib<1.1,>=0.5->tb-nightly->-r requirements.txt (line 8)) (2.0.0)
Requirement already satisfied: zipp>=0.5 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from importlib-metadata>=6.6.0->yapf->-r requirements.txt (line 12)) (3.19.2)
Requirement already satisfied: charset-normalizer<4,>=2 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from requests->basicsr>=1.4.2->-r requirements.txt (line 1)) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from requests->basicsr>=1.4.2->-r requirements.txt (line 1)) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from requests->basicsr>=1.4.2->-r requirements.txt (line 1)) (2.2.2)
Requirement already satisfied: certifi>=2017.4.17 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from requests->basicsr>=1.4.2->-r requirements.txt (line 1)) (2024.7.4)
Requirement already satisfied: MarkupSafe>=2.1.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from werkzeug>=1.0.1->tb-nightly->-r requirements.txt (line 8)) (2.1.3)
Requirement already satisfied: matplotlib in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from filterpy->facexlib>=0.2.5->-r requirements.txt (line 2)) (3.7.5)
Requirement already satisfied: llvmlite<0.42,>=0.41.0dev0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from numba->facexlib>=0.2.5->-r requirements.txt (line 2)) (0.41.1)
Requirement already satisfied: imageio>=2.27 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from scikit-image->basicsr>=1.4.2->-r requirements.txt (line 1)) (2.34.2)
Requirement already satisfied: tifffile>=2022.8.12 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from scikit-image->basicsr>=1.4.2->-r requirements.txt (line 1)) (2023.7.10)
Requirement already satisfied: PyWavelets>=1.1.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from scikit-image->basicsr>=1.4.2->-r requirements.txt (line 1)) (1.4.1)
Requirement already satisfied: packaging>=21 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from scikit-image->basicsr>=1.4.2->-r requirements.txt (line 1)) (24.1)
Requirement already satisfied: lazy_loader>=0.2 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from scikit-image->basicsr>=1.4.2->-r requirements.txt (line 1)) (0.4)
Requirement already satisfied: mpmath>=0.19 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from sympy->torch>=1.7->-r requirements.txt (line 9)) (1.3.0)
Requirement already satisfied: pyasn1<0.7.0,>=0.4.6 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tb-nightly->-r requirements.txt (line 8)) (0.6.0)
Requirement already satisfied: oauthlib>=3.0.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tb-nightly->-r requirements.txt (line 8)) (3.2.2)
Requirement already satisfied: contourpy>=1.0.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->-r requirements.txt (line 2)) (1.1.1)
Requirement already satisfied: cycler>=0.10 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->-r requirements.txt (line 2)) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->-r requirements.txt (line 2)) (4.53.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->-r requirements.txt (line 2)) (1.4.5)
Requirement already satisfied: pyparsing>=2.3.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->-r requirements.txt (line 2)) (3.1.2)
Requirement already satisfied: python-dateutil>=2.7 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->-r requirements.txt (line 2)) (2.9.0.post0)
Requirement already satisfied: importlib-resources>=3.2.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->-r requirements.txt (line 2)) (6.4.0)
Requirement already satisfied: six>=1.5 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from python-dateutil>=2.7->matplotlib->filterpy->facexlib>=0.2.5->-r requirements.txt (line 2)) (1.16.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
python setup.py develop
(myenv) root@DESKTOP-1FOD6A8:~/GFPGAN# python setup.py develop
/root/anaconda3/envs/myenv/lib/python3.8/site-packages/setuptools/__init__.py:81: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
running develop
/root/anaconda3/envs/myenv/lib/python3.8/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` and ``easy_install``.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://github.com/pypa/setuptools/issues/917 for details.
********************************************************************************
!!
easy_install.initialize_options(self)
/root/anaconda3/envs/myenv/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
self.initialize_options()
running egg_info
creating gfpgan.egg-info
writing gfpgan.egg-info/PKG-INFO
writing dependency_links to gfpgan.egg-info/dependency_links.txt
writing requirements to gfpgan.egg-info/requires.txt
writing top-level names to gfpgan.egg-info/top_level.txt
writing manifest file 'gfpgan.egg-info/SOURCES.txt'
reading manifest file 'gfpgan.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'inputs/*'
adding license file 'LICENSE'
writing manifest file 'gfpgan.egg-info/SOURCES.txt'
running build_ext
Creating /root/anaconda3/envs/myenv/lib/python3.8/site-packages/gfpgan.egg-link (link to .)
Adding gfpgan 1.3.8 to easy-install.pth file
Installed /root/GFPGAN
Processing dependencies for gfpgan==1.3.8
Searching for yapf==0.40.2
Best match: yapf 0.40.2
Adding yapf 0.40.2 to easy-install.pth file
Installing yapf script to /root/anaconda3/envs/myenv/bin
Installing yapf-diff script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for tqdm==4.66.4
Best match: tqdm 4.66.4
Adding tqdm 4.66.4 to easy-install.pth file
Installing tqdm script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for torchvision==0.19.0
Best match: torchvision 0.19.0
Adding torchvision 0.19.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for torch==2.4.0
Best match: torch 2.4.0
Adding torch 2.4.0 to easy-install.pth file
Installing convert-caffe2-to-onnx script to /root/anaconda3/envs/myenv/bin
Installing convert-onnx-to-caffe2 script to /root/anaconda3/envs/myenv/bin
Installing torchrun script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for tb-nightly==2.14.0a20230808
Best match: tb-nightly 2.14.0a20230808
Adding tb-nightly 2.14.0a20230808 to easy-install.pth file
Installing tensorboard script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for scipy==1.10.1
Best match: scipy 1.10.1
Adding scipy 1.10.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for PyYAML==6.0.1
Best match: PyYAML 6.0.1
Adding PyYAML 6.0.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for opencv-python==4.10.0.84
Best match: opencv-python 4.10.0.84
Adding opencv-python 4.10.0.84 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for numpy==1.24.3
Best match: numpy 1.24.3
Adding numpy 1.24.3 to easy-install.pth file
Installing f2py script to /root/anaconda3/envs/myenv/bin
Installing f2py3 script to /root/anaconda3/envs/myenv/bin
Installing f2py3.8 script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for lmdb==1.5.1
Best match: lmdb 1.5.1
Adding lmdb 1.5.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for facexlib==0.3.0
Best match: facexlib 0.3.0
Adding facexlib 0.3.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for basicsr==1.4.2
Best match: basicsr 1.4.2
Adding basicsr 1.4.2 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for tomli==2.0.1
Best match: tomli 2.0.1
Adding tomli 2.0.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for platformdirs==4.2.2
Best match: platformdirs 4.2.2
Adding platformdirs 4.2.2 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for importlib-metadata==8.2.0
Best match: importlib-metadata 8.2.0
Adding importlib-metadata 8.2.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for pillow==10.4.0
Best match: pillow 10.4.0
Adding pillow 10.4.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for fsspec==2024.6.1
Best match: fsspec 2024.6.1
Adding fsspec 2024.6.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for jinja2==3.1.4
Best match: jinja2 3.1.4
Adding jinja2 3.1.4 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for networkx==3.1
Best match: networkx 3.1
Adding networkx 3.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for sympy==1.12
Best match: sympy 1.12
Adding sympy 1.12 to easy-install.pth file
Installing isympy script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for typing-extensions==4.11.0
Best match: typing-extensions 4.11.0
Adding typing-extensions 4.11.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for filelock==3.13.1
Best match: filelock 3.13.1
Adding filelock 3.13.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for wheel==0.43.0
Best match: wheel 0.43.0
Adding wheel 0.43.0 to easy-install.pth file
Installing wheel script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for werkzeug==3.0.3
Best match: werkzeug 3.0.3
Adding werkzeug 3.0.3 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for tensorboard-data-server==0.7.2
Best match: tensorboard-data-server 0.7.2
Adding tensorboard-data-server 0.7.2 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for setuptools==69.5.1
Best match: setuptools 69.5.1
Adding setuptools 69.5.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for requests==2.32.3
Best match: requests 2.32.3
Adding requests 2.32.3 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for protobuf==5.27.2
Best match: protobuf 5.27.2
Adding protobuf 5.27.2 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for Markdown==3.6
Best match: Markdown 3.6
Adding Markdown 3.6 to easy-install.pth file
Installing markdown_py script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for google-auth-oauthlib==1.0.0
Best match: google-auth-oauthlib 1.0.0
Adding google-auth-oauthlib 1.0.0 to easy-install.pth file
Installing google-oauthlib-tool script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for google-auth==2.32.0
Best match: google-auth 2.32.0
Adding google-auth 2.32.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for grpcio==1.65.1
Best match: grpcio 1.65.1
Adding grpcio 1.65.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for absl-py==2.1.0
Best match: absl-py 2.1.0
Adding absl-py 2.1.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for numba==0.58.1
Best match: numba 0.58.1
Adding numba 0.58.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for filterpy==1.4.5
Best match: filterpy 1.4.5
Adding filterpy 1.4.5 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for scikit-image==0.21.0
Best match: scikit-image 0.21.0
Adding scikit-image 0.21.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for future==1.0.0
Best match: future 1.0.0
Adding future 1.0.0 to easy-install.pth file
Installing futurize script to /root/anaconda3/envs/myenv/bin
Installing pasteurize script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for addict==2.4.0
Best match: addict 2.4.0
Adding addict 2.4.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for zipp==3.19.2
Best match: zipp 3.19.2
Adding zipp 3.19.2 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for MarkupSafe==2.1.3
Best match: MarkupSafe 2.1.3
Adding MarkupSafe 2.1.3 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for mpmath==1.3.0
Best match: mpmath 1.3.0
Adding mpmath 1.3.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for certifi==2024.7.4
Best match: certifi 2024.7.4
Adding certifi 2024.7.4 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for urllib3==2.2.2
Best match: urllib3 2.2.2
Adding urllib3 2.2.2 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for idna==3.7
Best match: idna 3.7
Adding idna 3.7 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for charset-normalizer==3.3.2
Best match: charset-normalizer 3.3.2
Adding charset-normalizer 3.3.2 to easy-install.pth file
Installing normalizer script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for requests-oauthlib==2.0.0
Best match: requests-oauthlib 2.0.0
Adding requests-oauthlib 2.0.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for rsa==4.9
Best match: rsa 4.9
Adding rsa 4.9 to easy-install.pth file
Installing pyrsa-decrypt script to /root/anaconda3/envs/myenv/bin
Installing pyrsa-encrypt script to /root/anaconda3/envs/myenv/bin
Installing pyrsa-keygen script to /root/anaconda3/envs/myenv/bin
Installing pyrsa-priv2pub script to /root/anaconda3/envs/myenv/bin
Installing pyrsa-sign script to /root/anaconda3/envs/myenv/bin
Installing pyrsa-verify script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for pyasn1-modules==0.4.0
Best match: pyasn1-modules 0.4.0
Adding pyasn1-modules 0.4.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for cachetools==5.4.0
Best match: cachetools 5.4.0
Adding cachetools 5.4.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for llvmlite==0.41.1
Best match: llvmlite 0.41.1
Adding llvmlite 0.41.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for matplotlib==3.7.5
Best match: matplotlib 3.7.5
Adding matplotlib 3.7.5 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for lazy-loader==0.4
Best match: lazy-loader 0.4
Adding lazy-loader 0.4 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for packaging==24.1
Best match: packaging 24.1
Adding packaging 24.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for PyWavelets==1.4.1
Best match: PyWavelets 1.4.1
Adding PyWavelets 1.4.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for tifffile==2023.7.10
Best match: tifffile 2023.7.10
Adding tifffile 2023.7.10 to easy-install.pth file
Installing lsm2bin script to /root/anaconda3/envs/myenv/bin
Installing tiff2fsspec script to /root/anaconda3/envs/myenv/bin
Installing tiffcomment script to /root/anaconda3/envs/myenv/bin
Installing tifffile script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for imageio==2.34.2
Best match: imageio 2.34.2
Adding imageio 2.34.2 to easy-install.pth file
Installing imageio_download_bin script to /root/anaconda3/envs/myenv/bin
Installing imageio_remove_bin script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for oauthlib==3.2.2
Best match: oauthlib 3.2.2
Adding oauthlib 3.2.2 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for pyasn1==0.6.0
Best match: pyasn1 0.6.0
Adding pyasn1 0.6.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for importlib-resources==6.4.0
Best match: importlib-resources 6.4.0
Adding importlib-resources 6.4.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for python-dateutil==2.9.0.post0
Best match: python-dateutil 2.9.0.post0
Adding python-dateutil 2.9.0.post0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for pyparsing==3.1.2
Best match: pyparsing 3.1.2
Adding pyparsing 3.1.2 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for kiwisolver==1.4.5
Best match: kiwisolver 1.4.5
Adding kiwisolver 1.4.5 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for fonttools==4.53.1
Best match: fonttools 4.53.1
Adding fonttools 4.53.1 to easy-install.pth file
Installing fonttools script to /root/anaconda3/envs/myenv/bin
Installing pyftmerge script to /root/anaconda3/envs/myenv/bin
Installing pyftsubset script to /root/anaconda3/envs/myenv/bin
Installing ttx script to /root/anaconda3/envs/myenv/bin
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for cycler==0.12.1
Best match: cycler 0.12.1
Adding cycler 0.12.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for contourpy==1.1.1
Best match: contourpy 1.1.1
Adding contourpy 1.1.1 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Searching for six==1.16.0
Best match: six 1.16.0
Adding six 1.16.0 to easy-install.pth file
Using /root/anaconda3/envs/myenv/lib/python3.8/site-packages
Finished processing dependencies for gfpgan==1.3.8
pip install realesrgan
(myenv) root@DESKTOP-1FOD6A8:~/GFPGAN# pip install realesrgan
Collecting realesrgan
Downloading realesrgan-0.3.0-py3-none-any.whl.metadata (17 kB)
Requirement already satisfied: basicsr>=1.4.2 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from realesrgan) (1.4.2)
Requirement already satisfied: facexlib>=0.2.5 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from realesrgan) (0.3.0)
Requirement already satisfied: gfpgan>=1.3.5 in /root/GFPGAN (from realesrgan) (1.3.8)
Requirement already satisfied: numpy in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from realesrgan) (1.24.3)
Requirement already satisfied: opencv-python in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from realesrgan) (4.10.0.84)
Requirement already satisfied: Pillow in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from realesrgan) (10.4.0)
Requirement already satisfied: torch>=1.7 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from realesrgan) (2.4.0)
Requirement already satisfied: torchvision in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from realesrgan) (0.19.0)
Requirement already satisfied: tqdm in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from realesrgan) (4.66.4)
Requirement already satisfied: addict in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->realesrgan) (2.4.0)
Requirement already satisfied: future in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->realesrgan) (1.0.0)
Requirement already satisfied: lmdb in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->realesrgan) (1.5.1)
Requirement already satisfied: pyyaml in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->realesrgan) (6.0.1)
Requirement already satisfied: requests in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->realesrgan) (2.32.3)
Requirement already satisfied: scikit-image in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->realesrgan) (0.21.0)
Requirement already satisfied: scipy in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->realesrgan) (1.10.1)
Requirement already satisfied: tb-nightly in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->realesrgan) (2.14.0a20230808)
Requirement already satisfied: yapf in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from basicsr>=1.4.2->realesrgan) (0.40.2)
Requirement already satisfied: filterpy in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from facexlib>=0.2.5->realesrgan) (1.4.5)
Requirement already satisfied: numba in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from facexlib>=0.2.5->realesrgan) (0.58.1)
Requirement already satisfied: filelock in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->realesrgan) (3.13.1)
Requirement already satisfied: typing-extensions>=4.8.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->realesrgan) (4.11.0)
Requirement already satisfied: sympy in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->realesrgan) (1.12)
Requirement already satisfied: networkx in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->realesrgan) (3.1)
Requirement already satisfied: jinja2 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->realesrgan) (3.1.4)
Requirement already satisfied: fsspec in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from torch>=1.7->realesrgan) (2024.6.1)
Requirement already satisfied: matplotlib in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from filterpy->facexlib>=0.2.5->realesrgan) (3.7.5)
Requirement already satisfied: MarkupSafe>=2.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from jinja2->torch>=1.7->realesrgan) (2.1.3)
Requirement already satisfied: llvmlite<0.42,>=0.41.0dev0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from numba->facexlib>=0.2.5->realesrgan) (0.41.1)
Requirement already satisfied: importlib-metadata in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from numba->facexlib>=0.2.5->realesrgan) (8.2.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from requests->basicsr>=1.4.2->realesrgan) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from requests->basicsr>=1.4.2->realesrgan) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from requests->basicsr>=1.4.2->realesrgan) (2.2.2)
Requirement already satisfied: certifi>=2017.4.17 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from requests->basicsr>=1.4.2->realesrgan) (2024.7.4)
Requirement already satisfied: imageio>=2.27 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from scikit-image->basicsr>=1.4.2->realesrgan) (2.34.2)
Requirement already satisfied: tifffile>=2022.8.12 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from scikit-image->basicsr>=1.4.2->realesrgan) (2023.7.10)
Requirement already satisfied: PyWavelets>=1.1.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from scikit-image->basicsr>=1.4.2->realesrgan) (1.4.1)
Requirement already satisfied: packaging>=21 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from scikit-image->basicsr>=1.4.2->realesrgan) (24.1)
Requirement already satisfied: lazy_loader>=0.2 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from scikit-image->basicsr>=1.4.2->realesrgan) (0.4)
Requirement already satisfied: mpmath>=0.19 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from sympy->torch>=1.7->realesrgan) (1.3.0)
Requirement already satisfied: absl-py>=0.4 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->basicsr>=1.4.2->realesrgan) (2.1.0)
Requirement already satisfied: grpcio>=1.48.2 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->basicsr>=1.4.2->realesrgan) (1.65.1)
Requirement already satisfied: google-auth<3,>=1.6.3 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->basicsr>=1.4.2->realesrgan) (2.32.0)
Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->basicsr>=1.4.2->realesrgan) (1.0.0)
Requirement already satisfied: markdown>=2.6.8 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->basicsr>=1.4.2->realesrgan) (3.6)
Requirement already satisfied: protobuf>=3.19.6 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->basicsr>=1.4.2->realesrgan) (5.27.2)
Requirement already satisfied: setuptools>=41.0.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->basicsr>=1.4.2->realesrgan) (69.5.1)
Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->basicsr>=1.4.2->realesrgan) (0.7.2)
Requirement already satisfied: werkzeug>=1.0.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->basicsr>=1.4.2->realesrgan) (3.0.3)
Requirement already satisfied: wheel>=0.26 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from tb-nightly->basicsr>=1.4.2->realesrgan) (0.43.0)
Requirement already satisfied: platformdirs>=3.5.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from yapf->basicsr>=1.4.2->realesrgan) (4.2.2)
Requirement already satisfied: tomli>=2.0.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from yapf->basicsr>=1.4.2->realesrgan) (2.0.1)
Requirement already satisfied: cachetools<6.0,>=2.0.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from google-auth<3,>=1.6.3->tb-nightly->basicsr>=1.4.2->realesrgan) (5.4.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from google-auth<3,>=1.6.3->tb-nightly->basicsr>=1.4.2->realesrgan) (0.4.0)
Requirement already satisfied: rsa<5,>=3.1.4 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from google-auth<3,>=1.6.3->tb-nightly->basicsr>=1.4.2->realesrgan) (4.9)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from google-auth-oauthlib<1.1,>=0.5->tb-nightly->basicsr>=1.4.2->realesrgan) (2.0.0)
Requirement already satisfied: zipp>=0.5 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from importlib-metadata->numba->facexlib>=0.2.5->realesrgan) (3.19.2)
Requirement already satisfied: contourpy>=1.0.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->realesrgan) (1.1.1)
Requirement already satisfied: cycler>=0.10 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->realesrgan) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->realesrgan) (4.53.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->realesrgan) (1.4.5)
Requirement already satisfied: pyparsing>=2.3.1 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->realesrgan) (3.1.2)
Requirement already satisfied: python-dateutil>=2.7 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->realesrgan) (2.9.0.post0)
Requirement already satisfied: importlib-resources>=3.2.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from matplotlib->filterpy->facexlib>=0.2.5->realesrgan) (6.4.0)
Requirement already satisfied: pyasn1<0.7.0,>=0.4.6 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tb-nightly->basicsr>=1.4.2->realesrgan) (0.6.0)
Requirement already satisfied: six>=1.5 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from python-dateutil>=2.7->matplotlib->filterpy->facexlib>=0.2.5->realesrgan) (1.16.0)
Requirement already satisfied: oauthlib>=3.0.0 in /root/anaconda3/envs/myenv/lib/python3.8/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tb-nightly->basicsr>=1.4.2->realesrgan) (3.2.2)
Downloading realesrgan-0.3.0-py3-none-any.whl (26 kB)
Installing collected packages: realesrgan
Successfully installed realesrgan-0.3.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
5.模型下载
模型说明
Version | Model Name | Description |
---|---|---|
V1.3 | GFPGANv1.3.pth | Based on V1.2; more natural restoration results; better results on very low-quality / high-quality inputs. |
V1.2 | GFPGANCleanv1-NoCE-C2.pth | No colorization; no CUDA extensions are required. Trained with more data with pre-processing. |
V1 | GFPGANv1.pth | The paper model, with colorization. |
此处我下载的V1.3的模型
cd /root/GFPGAN
wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P experiments/pretrained_models
6.启动问题
启动问题1
OpenCV 依赖的
libGL.so.1
库无法找到。这通常是因为系统中缺少 OpenGL 库。你可以通过安装必要的依赖库来解决这个问题。
sudo apt-get update
sudo apt-get install -y libgl1-mesa-glx libglib2.0-0
启动问题2
(myenv) root@DESKTOP-1FOD6A8:~/GFPGAN# python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.3 -s 2
Traceback (most recent call last):
File "inference_gfpgan.py", line 7, in <module>
from basicsr.utils import imwrite
File "/root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/__init__.py", line 4, in <module>
from .data import *
File "/root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/data/__init__.py", line 22, in <module>
_dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames]
File "/root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/data/__init__.py", line 22, in <listcomp>
_dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames]
File "/root/anaconda3/envs/myenv/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/data/realesrgan_dataset.py", line 11, in <module>
from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels
File "/root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/data/degradations.py", line 8, in <module>
from torchvision.transforms.functional_tensor import rgb_to_grayscale
ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'
问题是
basicsr
模块中的degradations.py
文件尝试导入torchvision.transforms.functional_tensor
模块,但该模块不存在。这可能是因为torchvision
库的版本不兼容或缺少相关模块。
修改后入如下图:
vim /root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/data/degradations.py
# 修改代码,将:
from torchvision.transforms.functional_tensor import rgb_to_grayscale
# 修改为:
from torchvision.transforms.functional import rgb_to_grayscale
#退出并保存
7.启动测试
参数说明
Usage: python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.3 -s 2 [options]...
-h show this help
-i input Input image or folder. Default: inputs/whole_imgs
-o output Output folder. Default: results
-v version GFPGAN model version. Option: 1 | 1.2 | 1.3. Default: 1.3
-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
启动
- inputs/whole_imgs 下本来是有测试图片的,有需要的话可以换成自己的
- results目录可能不存在,可以自己创建,然后修改-o 的路径
python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.3 -s 2
# -i 输入目录
# -o 输出目录
# -v 使用模型
# -s 图像的最终上采样比例。默认值:2
(myenv) root@DESKTOP-1FOD6A8:~/GFPGAN# python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.3 -s 2
Traceback (most recent call last):
File "inference_gfpgan.py", line 7, in <module>
from basicsr.utils import imwrite
File "/root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/__init__.py", line 4, in <module>
from .data import *
File "/root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/data/__init__.py", line 22, in <module>
_dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames]
File "/root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/data/__init__.py", line 22, in <listcomp>
_dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames]
File "/root/anaconda3/envs/myenv/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/data/realesrgan_dataset.py", line 11, in <module>
from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels
File "/root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/data/degradations.py", line 8, in <module>
from torchvision.transforms.functional_tensor import rgb_to_grayscale
ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'
(myenv) root@DESKTOP-1FOD6A8:~/GFPGAN# python -c "import torchvision; print(torchvision.__version__)"
0.19.0
(myenv) root@DESKTOP-1FOD6A8:~/GFPGAN# nano /root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/data/degradations.py
(myenv) root@DESKTOP-1FOD6A8:~/GFPGAN# vim /root/anaconda3/envs/myenv/lib/python3.8/site-packages/basicsr/data/degradations.py
(myenv) root@DESKTOP-1FOD6A8:~/GFPGAN# python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.3 -s 2
inference_gfpgan.py:63: UserWarning: The unoptimized RealESRGAN is slow on CPU. We do not use it. If you really want to use it, please modify the corresponding codes.
warnings.warn('The unoptimized RealESRGAN is slow on CPU. We do not use it. '
/root/anaconda3/envs/myenv/lib/python3.8/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
warnings.warn(
/root/anaconda3/envs/myenv/lib/python3.8/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=None`.
warnings.warn(msg)
Downloading: "https://github.com/xinntao/facexlib/releases/download/v0.1.0/detection_Resnet50_Final.pth" to /root/GFPGAN/gfpgan/weights/detection_Resnet50_Final.pth
100%|██████████████████████████████████████████████████████████████████████████████████████████████| 104M/104M [00:10<00:00, 10.1MB/s]
/root/anaconda3/envs/myenv/lib/python3.8/site-packages/facexlib/detection/__init__.py:22: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
load_net = torch.load(model_path, map_location=lambda storage, loc: storage)
Downloading: "https://github.com/xinntao/facexlib/releases/download/v0.2.2/parsing_parsenet.pth" to /root/GFPGAN/gfpgan/weights/parsing_parsenet.pth
100%|████████████████████████████████████████████████████████████████████████████████████████████| 81.4M/81.4M [00:08<00:00, 10.1MB/s]
/root/anaconda3/envs/myenv/lib/python3.8/site-packages/facexlib/parsing/__init__.py:20: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
load_net = torch.load(model_path, map_location=lambda storage, loc: storage)
/root/GFPGAN/gfpgan/utils.py:92: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
loadnet = torch.load(model_path)
Processing 00.jpg ...
Processing 10045.png ...
Processing Blake_Lively.jpg ...
Results are in the [results] folder.
成功,完结撒花
Docker部署
已经打好的镜像
这个镜像就是下面Dockerfile打出来的镜像
我这里启动容器就会自动执行修复命令,有需要可以自己打自己需要的镜像
docker pull registry.cn-hangzhou.aliyuncs.com/zr-dev/tencentarc:v1.0
- –rm
- 容器执行完成后会自动删除,不需要可以把参数去除
- -e INPUT_PATH=/workspace/GFPGAN/inputs/whole_imgs
- 容器内脚本执行的input目录
- -e OUTPUT_PATH=/workspace/GFPGAN/results
- 容器内脚本执行的results目录
- -v $(pwd)/whole_imgs:/workspace/GFPGAN/inputs/whole_imgs
- 宿主机目录映射到容器内/workspace/GFPGAN/inputs/whole_imgs
- 不需要可以不加
- -v $(pwd)/results:/workspace/GFPGAN/results
- 宿主机目录映射到容器内/workspace/GFPGAN/results
- 不需要可以不加
docker run --rm -v /mnt/c/Users/zr/Pictures/testout:/workspace/GFPGAN/results -v /mnt/c/Users/zr/Pictures/input:/workspace/GFPGAN/inputs/whole_imgs -e INPUT_PATH=/workspace/GFPGAN/inputs/whole_imgs -e OUTPUT_PATH=/workspace/GFPGAN/results registry.cn-hangzhou.aliyuncs.com/zr-dev/tencentarc:v1.0
修改Dockerfile自己打
- 相关资源包
链接:https://share.weiyun.com/KfxyvhLU 密码:bagqey
- 打包docker镜像
将Dockerfile和源码以及模型文件放在同一个目录下
# 使用 Miniconda 基础镜像
FROM registry.cn-hangzhou.aliyuncs.com/zr-dev/miniconda3:v1.0
# 设置工作目录
WORKDIR /home/ai
# 安装 OpenCV 所需的 OpenGL 库
RUN apt-get update && apt-get install -y libgl1-mesa-glx
# 将本地的 GFPGAN 文件夹复制到容器中
COPY ./GFPGAN /workspace/GFPGAN
# 设置工作目录为 GFPGAN 文件夹
WORKDIR /workspace/GFPGAN
# 安装 PyTorch 和相关依赖(CPU 版本)
RUN conda install -y pytorch torchvision torchaudio cpuonly -c pytorch
# 安装 GFPGAN 所需的 Python 依赖
RUN pip install basicsr \
&& pip install facexlib \
&& pip install -r requirements.txt \
&& python setup.py develop \
&& pip install realesrgan
# 修正 basicsr 中的错误导入路径
RUN sed -i 's/from torchvision.transforms.functional_tensor import rgb_to_grayscale/from torchvision.transforms.functional import rgb_to_grayscale/' /opt/conda/lib/python3.12/site-packages/basicsr/data/degradations.py
# 将预训练模型从本地复制到容器中
COPY ./GFPGANv1.3.pth /workspace/GFPGAN/experiments/pretrained_models/GFPGANv1.3.pth
# 将权重模型从本地复制到容器
COPY ./detection_Resnet50_Final.pth /workspace/GFPGAN/gfpgan/weights/detection_Resnet50_Final.pth
# 将权重模型从本地复制到容器
COPY ./parsing_parsenet.pth /workspace/GFPGAN/gfpgan/weights/parsing_parsenet.pth
# 默认启动容器时进入 bash shell
CMD ["/bin/bash", "-c", "python inference_gfpgan.py -i $INPUT_PATH -o $OUTPUT_PATH -v 1.3 -s 2"]
执行docker 打包命令
docker build -t gfpgan-pytorch-image .
注意事项,如果有对应的下载失败,换国内源即可