1
0
mirror of https://github.com/TencentARC/GFPGAN.git synced 2025-05-17 07:40:16 -07:00
This commit is contained in:
Xintao 2021-05-18 15:15:16 +08:00
parent 7a6b04e5cb
commit 1c09b47fcb
2 changed files with 14 additions and 12 deletions

View File

@ -25,5 +25,5 @@ jobs:
- name: Lint - name: Lint
run: | run: |
flake8 . flake8 .
isort --check-only --diff basicsr/ options/ scripts/ tests/ inference/ setup.py isort --check-only --diff data/ archs/ models/ train.py inference_gfpgan_full.py
yapf -r -d basicsr/ options/ scripts/ tests/ inference/ setup.py yapf -r -d data/ archs/ models/ train.py inference_gfpgan_full.py

View File

@ -202,16 +202,18 @@ class GFPGANModel(BaseModel):
if 'gt' in data: if 'gt' in data:
self.gt = data['gt'].to(self.device) self.gt = data['gt'].to(self.device)
import torchvision # uncomment to check data
if self.opt['rank'] == 0: # import torchvision
import os # if self.opt['rank'] == 0:
os.makedirs('tmp/gt', exist_ok=True) # import os
os.makedirs('tmp/lq', exist_ok=True) # os.makedirs('tmp/gt', exist_ok=True)
print(self.idx) # os.makedirs('tmp/lq', exist_ok=True)
torchvision.utils.save_image( # print(self.idx)
self.gt, f'tmp/gt/gt_{self.idx}.png', nrow=4, padding=2, normalize=True, range=(-1, 1)) # torchvision.utils.save_image(
torchvision.utils.save_image( # self.gt, f'tmp/gt/gt_{self.idx}.png', nrow=4, padding=2, normalize=True, range=(-1, 1))
self.lq, f'tmp/lq/lq{self.idx}.png', nrow=4, padding=2, normalize=True, range=(-1, 1)) # torchvision.utils.save_image(
# self.lq, f'tmp/lq/lq{self.idx}.png', nrow=4, padding=2, normalize=True, range=(-1, 1))
# self.idx = self.idx + 1
if 'loc_left_eye' in data: if 'loc_left_eye' in data:
# get facial component locations, shape (batch, 4) # get facial component locations, shape (batch, 4)