diff --git a/.gitignore b/.gitignore index 9dece29..0bd2634 100644 --- a/.gitignore +++ b/.gitignore @@ -9,10 +9,4 @@ results/ .DS_Store # private only -./exp_logs.cvs -./exp_logs.xlsx -./scripts/metrics/run_local.sh -./scripts/test_daily.sh -./RF.sh -./configs/RestoreFormer++_cf.yaml -./configs/RestoreFormer++.yaml \ No newline at end of file +no_release/ \ No newline at end of file diff --git a/RF.sh b/RF.sh deleted file mode 100644 index ebfa183..0000000 --- a/RF.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env bash - -source /data/miniconda3/etc/profile.d/conda.sh -which conda -export PATH=/usr/local/app/.local/bin:$PATH - -# ----------------------- -# activate conda env -# ----------------------- -# conda init bash -# conda deactivate -which python -source activate pt19 -which python -# PYTHON=${PYTHON:-"/data/miniconda3/envs/pt19/bin/python"} - -# # ----------------------- -# # activate gcc 7.3 -# # ----------------------- -# scl enable devtoolset-7 bash -# source /opt/rh/devtoolset-7/enable -# gcc --version - -# ----------------------- -# install ninja-linux -# ----------------------- -sudo unzip /group/30042/zhouxiawang/env/share/lib_package/ninja-linux.zip -d /usr/local/bin/ -sudo update-alternatives --install /usr/bin/ninja ninja /usr/local/bin/ninja 1 - -# # ----------------------- -# # show info -# # ----------------------- -nvidia-smi -cat /etc/issue -$PYTHON -c "import torch; print(torch.__version__); print(torch.version.cuda); print(torch.backends.cudnn.version()); print(torch.cuda.is_available())" - -# ----------------------- -# run script -# ----------------------- -cd /group/30042/zhouxiawang/project/release/RestoreFormer -pwd -which pip -which python -# sudo pip install -r RF_requirements.txt - -sudo pip install facexlib==0.2.5 -# sudo pip install ffmpeg-python==0.2.0 -sudo pip install omegaconf==2.0.6 -sudo pip install pytorch-lightning==1.0.8 -sudo pip install basicsr==1.3.3.4 -sudo pip install test-tube==0.7.5 -sudo pip uninstall opencv-python -sudo pip install opencv-python==4.5.2.54 - -sudo pip list - -# ----------------------- -# copy model -# ----------------------- -# sudo mkdir /usr/local/app/.local/lib/python3.8/site-packages/facexlib/weights -if [ ! -d "/ /root/" ];then - sudo mkdir /root -fi -if [ ! -d "/ /root/.cache" ];then - sudo mkdir /root/.cache -fi -if [ ! -d "/root/.cache/torch" ];then - sudo mkdir /root/.cache/torch -fi -if [ ! -d "/root/.cache/torch/hub" ];then - sudo mkdir /root/.cache/torch/hub -fi -if [ ! -d "/root/.cache/torch/hub/checkpoints" ];then - sudo mkdir /root/.cache/torch/hub/checkpoints -fi - -sudo ls -l /group/30042/zhouxiawang/env/share/weights/facexlib -sudo ls -l /group/30042/zhouxiawang/env/share/weights/ -sudo ls -l "/root/.cache/torch/hub/checkpoints" -sudo ls -l "/data/miniconda3/envs/pt19/lib/python3.8/site-packages/facexlib/weights/" - -sudo cp /group/30042/zhouxiawang/env/share/weights/vgg16-397923af.pth /root/.cache/torch/hub/checkpoints -sudo cp /group/30042/zhouxiawang/env/share/weights/facexlib/*.pth /data/miniconda3/envs/pt19/lib/python3.8/site-packages/facexlib/weights/ -sudo cp /group/30042/zhouxiawang/env/share/weights/pt_inception-2015-12-05-6726825d.pth /root/.cache/torch/hub/checkpoints/ - -export OMP_NUM_THREADS=6 - -export BASICSR_JIT=True - -root_path='/group/30042/zhouxiawang/checkpoints/RestoreFormer/release' - -conf_name='HQ_Dictionary' -# conf_name='RestoreFormer' -conf_name='ROHQD' - -gpus='0,' -# gpus='0,1,2,3,4,5,6,7' -node_n=1 -ntasks_per_node=1 -gpu_n=$(expr $node_n \* $ntasks_per_node) - -# python -u main.py \ -sudo python -m torch.distributed.launch --nproc_per_node=$ntasks_per_node main.py \ ---root-path $root_path \ ---base 'configs/'$conf_name'.yaml' \ --t True \ ---postfix $conf_name'_lmdb_gpus'$gpu_n'_h4_E62' \ ---gpus $gpus \ ---num-nodes $node_n \ ---random-seed True \ -2>&1 |tee $root_path'/'$conf_name'_lmdb_gpus'$gpu_n'_h4_E62_log_v1.txt' diff --git a/assets/figure1.png b/assets/figure1.png deleted file mode 100644 index d798c14..0000000 Binary files a/assets/figure1.png and /dev/null differ diff --git a/assets/framework.png b/assets/framework.png deleted file mode 100644 index 8141ae4..0000000 Binary files a/assets/framework.png and /dev/null differ diff --git a/assets/frameworks.png b/assets/frameworks.png deleted file mode 100644 index 611a966..0000000 Binary files a/assets/frameworks.png and /dev/null differ diff --git a/configs/RestoreFormer++.yaml b/configs/RestoreFormer++.yaml deleted file mode 100644 index cc3e17a..0000000 --- a/configs/RestoreFormer++.yaml +++ /dev/null @@ -1,140 +0,0 @@ -model: - base_learning_rate: 4.5e-8 - target: RestoreFormer.models.vqgan_v1.RestoreFormerModel - params: - image_key: 'lq' - # ckpt_path: /group/30042/zhouxiawang/checkpoints/RestoreFormer/release/logs/2022-11-14T19-28-18_ROHQDROHQD_lmdb_gpus8_h4_E62_seed13/checkpoints/last.ckpt.105 - # ckpt_path: /group/30042/zhouxiawang/checkpoints/RestoreFormer/release/logs/2022-11-16T14-55-40_RestoreFormer++RestoreFormer++_lmdb_gpus8_h4_E62_ROHQD105_seed32/checkpoints/last.ckpt.105 - ckpt_path: /group/30042/zhouxiawang/checkpoints/RestoreFormer/models/2022-08-28T15-15-23_RF18_mh1_new_params_multiscale_restart_sh30_journal_re035_mh4E13_distill112222_id10_disc08_cp101010_un010_hy000875095_gy0008_exp000_sht0200132_45lr7_gpu24_Pixel_seed72/checkpoints/last.ckpt.33 - special_params_lr_scale: 1 - comp_params_lr_scale: 10 - schedule_step: [4000000, 8000000] - ddconfig: - target: RestoreFormer.modules.vqvae.vqvae_arch.VQVAEGANMultiHeadTransformer - params: - embed_dim: 256 - n_embed: 1024 - double_z: False - z_channels: 256 - resolution: 512 - in_channels: 3 - out_ch: 3 - ch: 64 - ch_mult: [ 1,2,2,4,4,8] # num_down = len(ch_mult)-1 - num_res_blocks: 2 - dropout: 0.0 - attn_resolutions: [16] - enable_mid: True - - fix_decoder: False - fix_codebook: True - fix_encoder: True - head_size: 4 - ex_multi_scale_num: 1 - - lossconfig: - target: RestoreFormer.modules.losses.vqperceptual.VQLPIPSWithDiscriminatorWithCompWithIdentity - params: - disc_conditional: False - disc_in_channels: 3 - disc_start: 0 - disc_weight: 0.8 - codebook_weight: 1.0 - use_actnorm: False - comp_weight: 1.0 #1.0 - identity_weight: 1.0 - identity_model_path: experiments/pretrained_models/arcface_resnet18.pth - -data: - target: main.DataModuleFromConfig - params: - batch_size: 4 - num_workers: 8 - train: - target: RestoreFormer.data.ffhq_uneven_degradation_dataset.FFHQUnevenDegradationDataset - params: - # dataroot_gt: data/ffhq/ffhq_512 - # io_backend: - # type: disk - dataroot_gt: data/ffhq/ffhq_512.lmdb - io_backend: - type: lmdb - use_hflip: True - mean: [0.5, 0.5, 0.5] - std: [0.5, 0.5, 0.5] - out_size: 512 - - blur_kernel_size: [19,20] - kernel_list: ['iso', 'aniso'] - kernel_prob: [0.5, 0.5] - blur_sigma: [0.1, 10] - downsample_range: [0.8, 8] - noise_range: [0, 20] - jpeg_range: [60, 100] - - color_jitter_prob: ~ - color_jitter_shift: 20 - color_jitter_pt_prob: ~ - - gray_prob: 0.008 - gt_gray: True - - exposure_prob: ~ - exposure_range: [0.7, 1.1] - - shift_prob: 0.2 - shift_unit: 1 - shift_max_num: 32 - - uneven_prob: 0.1 - - hazy_prob: 0.008 - hazy_alpha: [0.75, 0.95] - - crop_components: True - component_path: experiments/pretrained_models/FFHQ_eye_mouth_landmarks_512.pth - eye_enlarge_ratio: 1.4 - - - validation: - target: RestoreFormer.data.ffhq_uneven_degradation_dataset.FFHQUnevenDegradationDataset - params: - dataroot_gt: data/val - io_backend: - type: disk - use_hflip: False - mean: [0.5, 0.5, 0.5] - std: [0.5, 0.5, 0.5] - out_size: 512 - - blur_kernel_size: [19,20] - kernel_list: ['iso', 'aniso'] - kernel_prob: [0.5, 0.5] - blur_sigma: [0.1, 10] - downsample_range: [0.8, 8] - noise_range: [0, 20] - jpeg_range: [60, 100] - - # color jitter and gray - color_jitter_prob: ~ - color_jitter_shift: 20 - color_jitter_pt_prob: ~ - - gray_prob: ~ - gt_gray: True - - exposure_prob: ~ - exposure_range: [0.7, 1.1] - - shift_prob: ~ - shift_unit: 1 - shift_max_num: 32 - - uneven_prob: ~ - - hazy_prob: ~ - hazy_alpha: [0.75, 0.95] - - crop_components: False - component_path: experiments/pretrained_models/FFHQ_eye_mouth_landmarks_512.pth - eye_enlarge_ratio: 1.4 diff --git a/configs/RestoreFormer++_cf.yaml b/configs/RestoreFormer++_cf.yaml deleted file mode 100644 index 87d36b8..0000000 --- a/configs/RestoreFormer++_cf.yaml +++ /dev/null @@ -1,143 +0,0 @@ -model: - base_learning_rate: 4.5e-7 - target: RestoreFormer.models.vqgan_v1.RestoreFormerModel - params: - image_key: 'lq' - # ckpt_path: /group/30042/zhouxiawang/checkpoints/RestoreFormer/release/logs/2022-11-14T19-28-18_ROHQDROHQD_lmdb_gpus8_h4_E62_seed13/checkpoints/last.ckpt.105 - # ckpt_path: /group/30042/zhouxiawang/checkpoints/RestoreFormer/release/logs/2022-11-16T14-55-40_RestoreFormer++RestoreFormer++_lmdb_gpus8_h4_E62_ROHQD105_seed32/checkpoints/last.ckpt.105 - # ckpt_path: /group/30042/zhouxiawang/checkpoints/RestoreFormer/models/2022-08-28T15-15-23_RF18_mh1_new_params_multiscale_restart_sh30_journal_re035_mh4E13_distill112222_id10_disc08_cp101010_un010_hy000875095_gy0008_exp000_sht0200132_45lr7_gpu24_Pixel_seed72/checkpoints/last.ckpt.33 - # ckpt_path: /group/30042/zhouxiawang/checkpoints/RestoreFormer/release/logs/2023-08-16T10-41-25_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_seed13/checkpoints/last.ckpt - # ckpt_path: /group/30042/zhouxiawang/checkpoints/RestoreFormer/release/logs/2023-08-17T17-44-56_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc05_seed29/checkpoints/last.ckpt.110 - ckpt_path: /group/30042/zhouxiawang/checkpoints/RestoreFormer/release/logs/2023-08-24T17-15-56_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc065_seed63/checkpoints/last.ckpt.10 - special_params_lr_scale: 1 - comp_params_lr_scale: 1 - schedule_step: [4000000, 8000000] - ddconfig: - target: RestoreFormer.modules.vqvae.vqvae_arch.VQVAEGANMultiHeadTransformer - params: - embed_dim: 256 - n_embed: 1024 - double_z: False - z_channels: 256 - resolution: 512 - in_channels: 3 - out_ch: 3 - ch: 64 - ch_mult: [ 1,2,2,4,4,8] # num_down = len(ch_mult)-1 - num_res_blocks: 2 - dropout: 0.0 - attn_resolutions: [16] - enable_mid: True - - fix_decoder: False - fix_codebook: True - fix_encoder: False - head_size: 4 - ex_multi_scale_num: 1 - - lossconfig: - target: RestoreFormer.modules.losses.vqperceptual.VQLPIPSWithDiscriminatorWithCompWithIdentity - params: - disc_conditional: False - disc_in_channels: 3 - disc_start: 0 - disc_weight: 0.8 # 0.8 - codebook_weight: 1.0 - use_actnorm: False - comp_weight: 1.5 - identity_weight: 1.0 - identity_model_path: experiments/pretrained_models/arcface_resnet18.pth - -data: - target: main.DataModuleFromConfig - params: - batch_size: 4 - num_workers: 8 - train: - target: RestoreFormer.data.ffhq_uneven_degradation_dataset.FFHQUnevenDegradationDataset - params: - # dataroot_gt: data/ffhq/ffhq_512 - # io_backend: - # type: disk - dataroot_gt: data/ffhq/ffhq_512.lmdb - io_backend: - type: lmdb - use_hflip: True - mean: [0.5, 0.5, 0.5] - std: [0.5, 0.5, 0.5] - out_size: 512 - - blur_kernel_size: [19,20] - kernel_list: ['iso', 'aniso'] - kernel_prob: [0.5, 0.5] - blur_sigma: [1, 15] - downsample_range: [1, 30] - noise_range: [0, 20] - jpeg_range: [30, 90] - - color_jitter_prob: ~ - color_jitter_shift: 20 - color_jitter_pt_prob: ~ - - gray_prob: 0.008 - gt_gray: True - - exposure_prob: ~ - exposure_range: [0.7, 1.1] - - shift_prob: 0.2 - shift_unit: 1 - shift_max_num: 32 - - uneven_prob: 0.1 - - hazy_prob: 0.008 - hazy_alpha: [0.75, 0.95] - - crop_components: True - component_path: experiments/pretrained_models/FFHQ_eye_mouth_landmarks_512.pth - eye_enlarge_ratio: 1.4 - - - validation: - target: RestoreFormer.data.ffhq_uneven_degradation_dataset.FFHQUnevenDegradationDataset - params: - dataroot_gt: data/val - io_backend: - type: disk - use_hflip: False - mean: [0.5, 0.5, 0.5] - std: [0.5, 0.5, 0.5] - out_size: 512 - - blur_kernel_size: [19,20] - kernel_list: ['iso', 'aniso'] - kernel_prob: [0.5, 0.5] - blur_sigma: [1, 15] - downsample_range: [1, 30] - noise_range: [0, 20] - jpeg_range: [30, 90] - - # color jitter and gray - color_jitter_prob: ~ - color_jitter_shift: 20 - color_jitter_pt_prob: ~ - - gray_prob: ~ - gt_gray: True - - exposure_prob: ~ - exposure_range: [0.7, 1.1] - - shift_prob: ~ - shift_unit: 1 - shift_max_num: 32 - - uneven_prob: ~ - - hazy_prob: ~ - hazy_alpha: [0.75, 0.95] - - crop_components: False - component_path: experiments/pretrained_models/FFHQ_eye_mouth_landmarks_512.pth - eye_enlarge_ratio: 1.4 diff --git a/exp_logs.csv b/exp_logs.csv deleted file mode 100644 index a11e396..0000000 --- a/exp_logs.csv +++ /dev/null @@ -1,6 +0,0 @@ -20230816 2023-08-16T10-41-25_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_seed13 ��RF++����model�Ļ����ϣ�����codeformer���˻�����finetune - 2023-08-17T17-44-56_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc05_seed29 disc03->05 last.ckpt.110 - 2023-08-24T17-15-56_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc065_seed63 disc03->05->0.65 last.ckpt.10 - 2023-08-25T19-17-31_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc08_seed35 disc03->05->0.65->0.8 ������ - - 2023-08-26T21-47-57_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc08_lr6_seed96 lr 4.5e-7 -> 4.5e-6 Ҫ���������� diff --git a/exp_logs.xlsx b/exp_logs.xlsx deleted file mode 100644 index 4e29ed5..0000000 Binary files a/exp_logs.xlsx and /dev/null differ diff --git a/scripts/RF.sh b/scripts/RF.sh deleted file mode 100644 index e328ad0..0000000 --- a/scripts/RF.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env bash - -source /data/miniconda3/etc/profile.d/conda.sh -which conda -export PATH=/usr/local/app/.local/bin:$PATH - -# ----------------------- -# activate conda env -# ----------------------- -# conda init bash -# conda deactivate -which python -source activate pt19 -which python -# PYTHON=${PYTHON:-"/data/miniconda3/envs/pt19/bin/python"} - -# # ----------------------- -# # activate gcc 7.3 -# # ----------------------- -# scl enable devtoolset-7 bash -# source /opt/rh/devtoolset-7/enable -# gcc --version - -# ----------------------- -# install ninja-linux -# ----------------------- -sudo unzip /group/30042/zhouxiawang/env/share/lib_package/ninja-linux.zip -d /usr/local/bin/ -sudo update-alternatives --install /usr/bin/ninja ninja /usr/local/bin/ninja 1 - -# # ----------------------- -# # show info -# # ----------------------- -nvidia-smi -cat /etc/issue -$PYTHON -c "import torch; print(torch.__version__); print(torch.version.cuda); print(torch.backends.cudnn.version()); print(torch.cuda.is_available())" - -# ----------------------- -# run script -# ----------------------- -cd /group/30042/zhouxiawang/project/release/RestoreFormer -pwd -which pip -which python -# sudo pip install -r RF_requirements.txt - -sudo pip install facexlib==0.2.5 -# sudo pip install ffmpeg-python==0.2.0 -sudo pip install omegaconf==2.0.6 -sudo pip install pytorch-lightning==1.0.8 -sudo pip install basicsr==1.3.3.4 -sudo pip install test-tube==0.7.5 -sudo pip uninstall opencv-python -sudo pip install opencv-python==4.5.2.54 - -sudo pip list - -# ----------------------- -# copy model -# ----------------------- -# sudo mkdir /usr/local/app/.local/lib/python3.8/site-packages/facexlib/weights -if [ ! -d "/ /root/" ];then - sudo mkdir /root -fi -if [ ! -d "/ /root/.cache" ];then - sudo mkdir /root/.cache -fi -if [ ! -d "/root/.cache/torch" ];then - sudo mkdir /root/.cache/torch -fi -if [ ! -d "/root/.cache/torch/hub" ];then - sudo mkdir /root/.cache/torch/hub -fi -if [ ! -d "/root/.cache/torch/hub/checkpoints" ];then - sudo mkdir /root/.cache/torch/hub/checkpoints -fi - -sudo ls -l /group/30042/zhouxiawang/env/share/weights/facexlib -sudo ls -l /group/30042/zhouxiawang/env/share/weights/ -sudo cp /group/30042/zhouxiawang/env/share/weights/facexlib/*.pth /usr/local/app/.local/lib/python3.8/site-packages/facexlib/weights/ -sudo cp /group/30042/zhouxiawang/env/share/weights/vgg16-397923af.pth /root/.cache/torch/hub/checkpoints -sudo ls -l "/root/.cache/torch/hub/checkpoints" -sudo ls -l "/usr/local/app/.local/lib/python3.8/site-packages/facexlib/weights/" - -export OMP_NUM_THREADS=6 - -export BASICSR_JIT=True - -root_path='/group/30042/zhouxiawang/checkpoints/RestoreFormer/release' - -conf_name='HQ_Dictionary' -# conf_name='RestoreFormer' -conf_name='ROHQD' - -gpus='0,' -gpus='0,1,2,3,4,5,6,7' -node_n=1 -ntasks_per_node=8 -gpu_n=$(expr $node_n \* $ntasks_per_node) - -# python -u main.py \ -sudo python -m torch.distributed.launch --nproc_per_node=$ntasks_per_node main.py \ ---root-path $root_path \ ---base 'configs/'$conf_name'.yaml' \ --t True \ ---postfix $conf_name'_lmdb_gpus'$gpu_n'_h4_E62' \ ---gpus $gpus \ ---num-nodes $node_n \ ---random-seed True \ -2>&1 |tee $root_path'/'$conf_name'_lmdb_gpus'$gpu_n'_h4_E62_log_v1.txt' diff --git a/scripts/RFpp.sh b/scripts/RFpp.sh deleted file mode 100644 index 4fcd622..0000000 --- a/scripts/RFpp.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env bash - -source /data/miniconda3/etc/profile.d/conda.sh -which conda -export PATH=/usr/local/app/.local/bin:$PATH - -# ----------------------- -# activate conda env -# ----------------------- -# conda init bash -# conda deactivate -which python -source activate pt19 -which python -# PYTHON=${PYTHON:-"/data/miniconda3/envs/pt19/bin/python"} - -# # ----------------------- -# # activate gcc 7.3 -# # ----------------------- -# scl enable devtoolset-7 bash -# source /opt/rh/devtoolset-7/enable -# gcc --version - -# ----------------------- -# install ninja-linux -# ----------------------- -sudo unzip /group/30042/zhouxiawang/env/share/lib_package/ninja-linux.zip -d /usr/local/bin/ -sudo update-alternatives --install /usr/bin/ninja ninja /usr/local/bin/ninja 1 - -# # ----------------------- -# # show info -# # ----------------------- -nvidia-smi -cat /etc/issue -$PYTHON -c "import torch; print(torch.__version__); print(torch.version.cuda); print(torch.backends.cudnn.version()); print(torch.cuda.is_available())" - -# ----------------------- -# run script -# ----------------------- -cd /group/30042/zhouxiawang/project/release/RestoreFormer -pwd -which pip -which python -# sudo pip install -r RF_requirements.txt - -sudo pip install facexlib==0.2.5 -# sudo pip install ffmpeg-python==0.2.0 -sudo pip install omegaconf==2.0.6 -sudo pip install pytorch-lightning==1.0.8 -sudo pip install basicsr==1.3.3.4 -sudo pip install test-tube==0.7.5 -sudo pip uninstall opencv-python -sudo pip install opencv-python==4.5.2.54 - -sudo pip list - -# ----------------------- -# copy model -# ----------------------- -# sudo mkdir /usr/local/app/.local/lib/python3.8/site-packages/facexlib/weights -if [ ! -d "/ /root/" ];then - sudo mkdir /root -fi -if [ ! -d "/ /root/.cache" ];then - sudo mkdir /root/.cache -fi -if [ ! -d "/root/.cache/torch" ];then - sudo mkdir /root/.cache/torch -fi -if [ ! -d "/root/.cache/torch/hub" ];then - sudo mkdir /root/.cache/torch/hub -fi -if [ ! -d "/root/.cache/torch/hub/checkpoints" ];then - sudo mkdir /root/.cache/torch/hub/checkpoints -fi - -sudo ls -l /group/30042/zhouxiawang/env/share/weights/facexlib -sudo ls -l /group/30042/zhouxiawang/env/share/weights/ -sudo cp /group/30042/zhouxiawang/env/share/weights/facexlib/*.pth /usr/local/app/.local/lib/python3.8/site-packages/facexlib/weights/ -sudo cp /group/30042/zhouxiawang/env/share/weights/vgg16-397923af.pth /root/.cache/torch/hub/checkpoints -sudo ls -l "/root/.cache/torch/hub/checkpoints" -sudo ls -l "/usr/local/app/.local/lib/python3.8/site-packages/facexlib/weights/" - -export OMP_NUM_THREADS=6 - -export BASICSR_JIT=True - -root_path='/group/30042/zhouxiawang/checkpoints/RestoreFormer/release' - -conf_name='HQ_Dictionary' -# conf_name='RestoreFormer' -conf_name='ROHQD' -conf_name='RestoreFormer++' - -# gpus='0,' -gpus='0,1,2,3,4,5,6,7' -node_n=1 -ntasks_per_node=8 -gpu_n=$(expr $node_n \* $ntasks_per_node) - -# python -u main.py \ -sudo python -m torch.distributed.launch --nproc_per_node=$ntasks_per_node main.py \ ---root-path $root_path \ ---base 'configs/'$conf_name'.yaml' \ --t True \ ---postfix $conf_name'_lmdb_gpus'$gpu_n'_h4_E62_ROHQD105' \ ---gpus $gpus \ ---num-nodes $node_n \ ---random-seed True -# 2>&1 |tee $root_path'/'$conf_name'_lmdb_gpus'$gpu_n'_h4_E62_log_v1.txt' diff --git a/scripts/env_42.sh b/scripts/env_42.sh deleted file mode 100644 index 3e323b2..0000000 --- a/scripts/env_42.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash - -unzip /group/30042/zhouxiawang/env/share/lib_package/ninja-linux.zip -d /usr/local/bin/ -update-alternatives --install /usr/bin/ninja ninja /usr/local/bin/ninja 1 - - -pip install facexlib==0.2.5 -# pip install ffmpeg-python==0.2.0 -pip install omegaconf==2.0.6 -pip install pytorch-lightning==1.0.8 -pip install basicsr==1.3.3.4 -pip install test-tube==0.7.5 -pip uninstall opencv-python -pip install opencv-python==4.5.2.54 - -pip list - -# ----------------------- -# copy model -# ----------------------- -# mkdir /usr/local/app/.local/lib/python3.8/site-packages/facexlib/weights -if [ ! -d "/ /root/" ];then - mkdir /root -fi -if [ ! -d "/ /root/.cache" ];then - mkdir /root/.cache -fi -if [ ! -d "/root/.cache/torch" ];then - mkdir /root/.cache/torch -fi -if [ ! -d "/root/.cache/torch/hub" ];then - mkdir /root/.cache/torch/hub -fi -if [ ! -d "/root/.cache/torch/hub/checkpoints" ];then - mkdir /root/.cache/torch/hub/checkpoints -fi - -ls -l /group/30042/zhouxiawang/env/share/weights/facexlib -ls -l /group/30042/zhouxiawang/env/share/weights/ -ln -s /group/30042/zhouxiawang/env/share/weights/facexlib /usr/local/app/.local/lib/python3.8/site-packages/facexlib/weights -cp /group/30042/zhouxiawang/env/share/weights/vgg16-397923af.pth /root/.cache/torch/hub/checkpoints -cp /group/30042/zhouxiawang/env/share/weights/pt_inception-2015-12-05-6726825d.pth /root/.cache/torch/hub/checkpoints -ls -l "/root/.cache/torch/hub/checkpoints" diff --git a/scripts/metrics/run_local.sh b/scripts/metrics/run_local.sh deleted file mode 100644 index 5f72ae8..0000000 --- a/scripts/metrics/run_local.sh +++ /dev/null @@ -1,70 +0,0 @@ - -### Journal ### -root='results/' -out_root='results/metrics' - -root='/group/30042/zhouxiawang/checkpoints/RestoreFormer/resutls/WebPhoto-Test' -# root='/group/30042/zhouxiawang/checkpoints/RestoreFormer/resutls/Child' -root='/group/30042/zhouxiawang/checkpoints/RestoreFormer/resutls/lfw' -CelebAHQ_GT='' - -root='/group/30042/zhouxiawang/checkpoints/RestoreFormer/resutls/celeba' -CelebAHQ_GT='/group/30042/zhouxiawang/data/FaceRestoration/celeba_512_validation' - -out_root='/group/30042/zhouxiawang/checkpoints/RestoreFormer/metrics' - -test_name='RestoreFormer++' - -test_name='2022-11-16T14-55-40_RestoreFormer++RestoreFormer++_lmdb_gpus8_h4_E62_ROHQD105_seed32' -test_name='2022-11-21T10-49-14_RestoreFormer++RestoreFormer++_lmdb_gpus8_h4_E62_ROHQD105_En105_lr7_seed44' -test_name='2023-08-17T17-44-56_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc05_seed29' -test_name='2023-08-24T17-15-56_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc065_seed63' -test_name='2023-08-25T19-17-31_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc08_seed35' -test_name='2023-08-26T21-47-57_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc08_lr6_seed96' -test_name='2023-08-28T16-26-15_2023082801_RF++_cf2023082801_RF++_cf_gpus7_lmdb_h4_ROHQD105_disc08_distill010202020202_seed32' -test_name='2023-08-30T00-34-34_2023082801_RF++_cf2023082801_RF++_cf_gpus7_lmdb_h4_ROHQD105_disc12_distill010202020202_seed64' -test_name='2023-08-30T15-43-24_2023082801_RF++_cf2023082801_RF++_cf_gpus7_lmdb_h4_ROHQD105_disc20_distill010202020202_seed69' -test_name='2023-08-31T10-59-30_2023082801_RF++_cf2023082801_RF++_cf_gpus7_lmdb_h4_ROHQD105_disc08_distill010202020202_style_seed52' -test_name='2023-09-14T13-12-55_RestoreFormer++RestoreFormer++_gpus7_lmdb_h4_fixD_lr8_seed13' - -tag='test' - - - -test_image=$test_name'_'$tag'/restored_faces' -out_name=$test_name -need_post=1 - - - - -# FID -# python -u scripts/metrics/cal_fid.py \ -# $root'/'$test_image \ -# --fid_stats 'experiments/pretrained_models/inception_FFHQ_512_color_gray008_shift02.pth' \ -# --save_name $out_root'/'$out_name'_fid_gray008shift02.txt' \ - -# --fid_stats 'experiments/pretrained_models/inception_FFHQ_512-f7b384ab.pth' \ -# --save_name $out_root'/'$out_name'_fid.txt' \ - -# --fid_stats 'experiments/pretrained_models/inception_FFHQ_512_color_gray008_shift02.pth' \ -# --save_name $out_root'/'$out_name'_fid_gray008shift02.txt' \ - -if [ -d $CelebAHQ_GT ] -then - # PSRN SSIM LPIPS - python -u scripts/metrics/cal_psnr_ssim.py \ - $root'/'$test_image \ - --gt_folder $CelebAHQ_GT \ - --save_name $out_root'/'$out_name'_psnr_ssim_lpips.txt' \ - --need_post $need_post \ - - # # # PSRN SSIM LPIPS - python -u scripts/metrics/cal_identity_distance.py \ - $root'/'$test_image \ - --gt_folder $CelebAHQ_GT \ - --save_name $out_root'/'$out_name'_id.txt' \ - --need_post $need_post -else - echo 'The path of GT does not exist' -fi \ No newline at end of file diff --git a/scripts/test_daily.sh b/scripts/test_daily.sh deleted file mode 100644 index 277a9b2..0000000 --- a/scripts/test_daily.sh +++ /dev/null @@ -1,88 +0,0 @@ -# # ### Good -exp_name='RestoreFormer' -exp_name='RestoreFormer++' - -root_path='experiments' -out_root_path='results' -align_test_path='data/test' -tag='test' - - -root_path='/group/30042/zhouxiawang/checkpoints/RestoreFormer/release/logs' -# exp_name='2022-11-16T14-55-40_RestoreFormer++RestoreFormer++_lmdb_gpus8_h4_E62_ROHQD105_seed32' -# epoch='105' - -exp_name='2022-11-21T10-49-14_RestoreFormer++RestoreFormer++_lmdb_gpus8_h4_E62_ROHQD105_En105_lr7_seed44' -epoch=63 -epoch=109 - -exp_name='2023-08-17T17-44-56_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc05_seed29' -epoch=110 - -exp_name='2023-08-16T10-41-25_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_seed13' -epoch=19 - -exp_name='2023-08-24T17-15-56_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc065_seed63' -epoch=10 # 77 -epoch=17 - -exp_name='2023-08-25T19-17-31_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc08_seed35' -epoch=13 # 82.4940 -epoch=11 # 80.9992 - -exp_name='2023-08-26T21-47-57_RestoreFormer++_cfRestoreFormer++_cf_gpus7_lmdb_h4_ROHQD105_disc08_lr6_seed96' -epoch=9 - - -exp_name='2023-08-28T16-26-15_2023082801_RF++_cf2023082801_RF++_cf_gpus7_lmdb_h4_ROHQD105_disc08_distill010202020202_seed32' -epoch=2 # 80.3320 -epoch=10 # 76.1336 -epoch=12 # 79.9700 -epoch=14 # 79.0212 -epoch=15 # 80.0507 -epoch=17 # 80.0506 - -exp_name='2023-08-30T00-34-34_2023082801_RF++_cf2023082801_RF++_cf_gpus7_lmdb_h4_ROHQD105_disc12_distill010202020202_seed64' -epoch=6 # 76.4387 -epoch=8 - -exp_name='2023-08-30T15-43-24_2023082801_RF++_cf2023082801_RF++_cf_gpus7_lmdb_h4_ROHQD105_disc20_distill010202020202_seed69' -epoch=10 - -exp_name='2023-08-31T10-59-30_2023082801_RF++_cf2023082801_RF++_cf_gpus7_lmdb_h4_ROHQD105_disc08_distill010202020202_style_seed52' -epoch=2 -epoch=12 - -exp_name='2023-09-14T11-20-25_RestoreFormer++RestoreFormer++_gpus7_lmdb_h4_fixE_lr8_seed18' -epoch=1 - -exp_name='2023-09-14T13-12-55_RestoreFormer++RestoreFormer++_gpus7_lmdb_h4_fixD_lr8_seed13' -epoch=1 - -out_root_path='/group/30042/zhouxiawang/checkpoints/RestoreFormer/resutls/WebPhoto-Test' -align_test_path='/group/30042/zhouxiawang/data/FaceRestoration/WebPhoto-Test' - -out_root_path='/group/30042/zhouxiawang/checkpoints/RestoreFormer/resutls/celeba' -align_test_path='/group/30042/zhouxiawang/data/FaceRestoration/celeba_512_validation_lq' - -out_root_path='/group/30042/zhouxiawang/checkpoints/RestoreFormer/resutls/lfw' -align_test_path='/group/30042/zhouxiawang/data/FaceRestoration/lfw' - - - -# out_root_path='/group/30042/zhouxiawang/checkpoints/RestoreFormer/resutls/Child' -# align_test_path='/group/30042/public_datasets/RestoreData/faces/CelebChild/Child' - -outdir=$out_root_path'/'$exp_name'_'$tag - - -if [ ! -d $outdir ];then - mkdir -m 777 $outdir -fi - -CUDA_VISIBLE_DEVICES=7 python -u scripts/test.py \ ---outdir $outdir \ --r $root_path'/'$exp_name'/checkpoints/last.ckpt.'$epoch \ --c 'configs/RestoreFormer++.yaml' \ ---test_path $align_test_path \ ---aligned