Project dependencies may have API risk issues #324

Open
opened 2026-01-29 21:46:50 +00:00 by claunia · 0 comments
Owner

Originally created by @PyDR-Tool on GitHub (Mar 12, 2023).

Hi, In GFPGAN, inappropriate dependency versioning constraints can cause risks.

Below are the dependencies and version constraints that the project is using

basicsr>=1.4.2
facexlib>=0.2.5
numpy
tqdm

The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict.
The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

After further analysis, in this project,
The version constraint of dependency tqdm can be changed to >=3.4.0,<=4.64.0.

The above modification suggestions can reduce the dependency conflicts as much as possible,
and introduce the latest version as much as possible without calling Error in the projects.

The invocation of the current project includes all the following methods.

In version tqdm-3.1.4, the API tqdm.tqdm.set_description whch is used by the current project in gfpgan/models/gfpgan_model.py is missing.

image
The calling methods from the tqdm
tqdm.tqdm.close
tqdm.tqdm.update
tqdm.tqdm
tqdm.tqdm.set_description
The calling methods from the all methods
basicsr.archs.srvgg_arch.SRVGGNetCompact
torchvision.transforms.functional.adjust_saturation
z.permute.contiguous.detach
join
torch.nn.functional.avg_pool2d
basicsr.data.degradations.random_add_jpg_compression
basicsr.data.transforms.augment
self.model_ema
self.stylegan_decoder
NormStyleCode.extend
os.path.splitext
float
Upsample
i_block.i_level.self.down.block
conv2
crt_v.size
os.environ.get
tqdm.tqdm.close
_minimal_ext_cmd.strip
f.read.strip.split
ConstantInput
subprocess.Popen
basicsr.archs.stylegan2_arch.EqualConv2d
shutil.rmtree
z_q.permute.contiguous
self.net_g.eval
k.transpose.transpose.permute
basicsr.losses.gan_loss.r1_penalty
self.final_conv
self.opt.items
torch.nn.functional.leaky_relu
self.mid.attn_1
clean_folder
self.skip
self.ResBlock.super.__init__
y.self.fc.view
os.path.dirname
gt_gray.self.network_identity.detach
self.output.detach
self.cri_pix
main
EqualConv2d
self.net_d_left_eye
basicsr.utils.registry.MODEL_REGISTRY.register
numpy.min
self.conv_out
line.replace
numpy.array
basicsr.utils.registry.ARCH_REGISTRY.register
self.condition_scale.append
self.FFHQDegradationDataset.super.__init__
self.opt.build_network.to
self.activation
unet_skips.insert
self.k
i.self.conv_body_up.size
stylegan2_bilinear_arch.EqualConv2d
self.GFPGANv1Clean.super.__init__
gfpgan.GFPGANer.enhance
self.encode
self.net_g.train
self.to_rgbs.append
f.read.strip
self.mid.block_1
self.cri_gan
ori_k.replace.replace
cropped_face_t.unsqueeze.to.unsqueeze
torch.nn.functional.conv2d
self.proj_out.permute
torch.nn.Module
open
modify_checkpoint
self.StyleGAN2GeneratorCSFT.super.__init__
self.FacialComponentDiscriminator.super.__init__
self.bn5.view
torch.nn.ModuleList
self.face_helper.clean_all
basicsr.archs.stylegan2_arch.ScaledLeakyReLU
torch.nn.Conv2d
self.ToRGB.super.__init__
self.embedding.weight.t
real_d_pred.detach.mean
self.conv5.clone
self.down.append
self.net_d_mouth.train
self.io_backend_opt.pop
feat_gt.detach
self.n_e.indices.shape.torch.zeros.to
getattr
z.permute.contiguous.view
torch.nn.ModuleList.append
line.split
torch.split
self.cri_perceptual
self.encoder.named_parameters
torch.nn.ReLU
i.self.condition_shift.clone
basicsr.ops.fused_act.fused_leaky_relu
l_d_r1.detach.mean
self.gray_resize_for_identity.unsqueeze
torch.nn.Sigmoid
v.transpose.reshape
self.net_g_ema
self.conv5.size
torch.clamp.round
cog.Input
self.construct_img_pyramid
locals
self.network_identity
style_code.view.view
self.right_eyes.detach
self.color_jitter
NormStyleCode
torchvision.transforms.functional.adjust_hue
gfpganv1_arch.ResUpBlock
self.save_training_state
self.optimizer_d.step
torch.cat
torch.save
cv2.imwrite
half_len_mouth.mean_mouth.half_len_mouth.mean_mouth.np.hstack.astype
torch.exp
self.encoder
_minimal_ext_cmd
self.conv_body_first
self.optimizer_d_left_eye.step
torch.nn.BatchNorm1d
k.transpose.transpose.reshape
z_q.permute.contiguous.detach
torch.nn.Dropout
self.prelu
self._initialize_best_metric_results
i_level.self.up.upsample
q.transpose.mul_
v.endswith
torchvision.transforms.functional.adjust_brightness
torch.clamp
self.proj_out.view
len
hasattr
self.face_enhancer.enhance
torch.nn.LeakyReLU
self.temb_proj
self.conv2
torch.sigmoid
self.VectorQuantizer.super.__init__
self.cri_gan.backward
self.proj_out.transpose
print
self.constant_input
self.fc5
numpy.prod
self.conv4
self.net_d_right_eye.train
self.gfpgan.eval
basicsr.utils.download_util.load_file_from_url.startswith
self.n_e.min_encoding_indices.shape.torch.zeros.to
ResnetBlock
basicsr.utils.img2tensor
self.net_d.train
self.bn3
self.net_d_right_eye.parameters
self.optimizer_g.step
restored_face.astype.astype
self.Bottleneck.super.__init__
self.get_component_coordinates.append
basicsr.archs.stylegan2_arch.ConvLayer
self.proj_out.matmul
basicsr.utils.registry.DATASET_REGISTRY.register
min_encoding_indices.unsqueeze.unsqueeze
self.weight.repeat
ResBlock
weight.pow.sum
self.bn0
self.net_d_left_eye.train
self.gt.detach.cpu
half_len_right_eye.mean_right_eye.half_len_right_eye.mean_right_eye.np.hstack.astype
tqdm.tqdm.set_description
data.to
w.h.b.out.new_empty.normal_
math.log
z_q.permute.contiguous.view
i.self.condition_shift
reversed
args.input.endswith
torch.nn.BatchNorm2d
os.path.isfile
rois_eyes.torch.cat.to
self.StyleGAN2GeneratorSFT.super.__init__
out.strip.decode
torchvision.transforms.functional.normalize
torch.nn.Embedding
self.register_parameter
numpy.mean
train_opt.pop
StyleGAN2GeneratorCSFT
self.net_d
self.construct_img_pyramid.insert
ToRGB
numpy.hstack
self.network_identity.eval
i_block.i_level.self.up.block
torch.log
cropped_face_t.unsqueeze.to
self.to_rgb1
super
self.net_d.parameters
_comp_style
self.cri_component
basicsr.utils.FileClient.get
glob.glob
exec
self.nin_shortcut
self.metric_results.keys
self.EqualLinear.super.__init__
numpy.concatenate
self.left_eyes.detach
basicsr.metrics.calculate_metric
ScaledLeakyReLU
x.view.transpose
json.load
self.downsample
write_version_py
self.gray_resize_for_identity
basicsr.losses.gan_loss.r1_penalty.backward
layers.append
isinstance
self.conv1
self.optimizer_d.zero_grad
self.optimizer_d_mouth.step
warnings.warn
v.transpose.transpose
numpy.clip
i.self.toRGB
StyleGAN2GeneratorBilinearSFT
json.load.values
torch.randn
env.subprocess.PIPE.cmd.subprocess.Popen.communicate
Downsample
torch.tensor
torch.no_grad
weight.view.pow
torch.randn.append
self.face_helper.align_warp_face
sorted
checkpoint_bilinear.items
self.quantize
conv2.view
self._make_layer
q.transpose.permute
os.system
time.asctime
q.transpose.transpose
self.layer4
self.bn5
x.isdigit
f.write
z_q.permute.contiguous.permute
ori_v.size
z.permute.contiguous.permute
self.GFPGANv1.super.__init__
torch.load
get_git_hash
self.gt.detach
self.final_conv.size
cog.Path
math.sqrt.view
stylegan2_bilinear_arch.ConvLayer
self.ModulatedConv2d.super.__init__
self.embedding.weight.min_encodings.torch.matmul.view
ConvUpLayer
cv2.resize
gfpgan.archs.restoreformer_arch.RestoreFormer
torch.rsqrt.view
self.get_component_coordinates
torch.matmul
self._log_validation_metric_values
self.conv_body_down.append
k.transpose.transpose.transpose
torchvision.ops.roi_align
cv2.filter2D
i_block.i_level.self.up.attn
self.bn1
conv2.size
torch.rsqrt
self._gram_mat
self.GFPGANModel.super.__init__
gfpgan.archs.gfpgan_bilinear_arch.GFPGANBilinear
self.bn4
self.StyleGAN2GeneratorBilinear.super.__init__
x.view.bmm
hue.hue.torch.tensor.uniform_.item
self.StyleGAN2GeneratorBilinearSFT.super.__init__
self.StyleConv.super.__init__
self.net_g.named_parameters
torch.nn.functional.linear
torch.nn.PReLU
argparse.ArgumentParser
self.condition_shift.append
enumerate
train_opt.build_loss.to
self.quant_conv
self.modulation
self.net_d_right_eye
StyleConv
int
out_channels.torch.zeros.fill_
self.proj_out
torch.nn.functional.pad
self.metric_results.items
self.gfpgan.load_state_dict
self.optimizer_d_right_eye.step
VectorQuantizer
basicsr.ops.fused_act.FusedLeakyReLU
stylegan2_bilinear_arch.ResBlock
self.ScaledLeakyReLU.super.__init__
z.z_q.detach
os.path.join
self.post_quant_conv
self.n_e.indices.shape.torch.zeros.to.float
self.optimizer_d_mouth.zero_grad
self.bn5.size
self.net_d_left_eye.parameters
self.face_helper.get_inverse_affine
contrast.contrast.torch.tensor.uniform_.item
normal_params.append
self.opt.get
torch.nn.Upsample
self.face_helper.add_restored_face
os.listdir
self.SEBlock.super.__init__
os.path.basename
self.save_network
setuptools.setup
facexlib.utils.face_restoration_helper.FaceRestoreHelper
gfpgan.archs.gfpganv1_clean_arch.GFPGANv1Clean.state_dict
self._update_best_metric_result
self.layer3
self.embedding.weight.data.uniform_
self.init_training_settings
self.net_d.detach
nonlinearity
ConvLayer
torch.nn.Parameter
self.loc_left_eyes.new_full
self.ResUpBlock.super.__init__
os.path.islink
EqualLinear
f.read
self.gt_folder.endswith
self.conv5.view
self.face_helper.read_image
self.fc
self.decoder.named_parameters
torch.stack
self.conv
self.get_roi_regions
self.bg_upsampler.enhance
StyleGAN2GeneratorSFT
zip
math.sqrt
x.size
self.cri_component.backward
compile
self.get_optimizer
Normalize
self.ConstantInput.super.__init__
self.conv5
get_hash
weight.view.view
basicsr.losses.gan_loss.r1_penalty.detach
rois_mouths.torch.cat.to
self.opt.keys
math.sqrt.new_empty
self.gfpgan.squeeze
self.ConvUpLayer.super.__init__
self.optimizer_d_left_eye.zero_grad
torch.tensor.uniform_
i.self.condition_scale
self.net_g
self.se
torch.nn.GroupNorm
SEBlock
self.activate
numpy.tile
q.transpose.reshape
rois_eyes.torch.cat.to.append
self.mouths.detach
basicsr.utils.imfrombytes
numpy.max
torch.nn.MaxPool2d
tempfile.mkdtemp
tqdm.tqdm.update
torch.from_numpy
basicsr.utils.tensor2img
self.IRBlock.super.__init__
i.self.conv_body_down
range
torch.nn.functional.softmax
stylegan2_bilinear_arch.EqualLinear
basicsr.data.data_util.paths_from_folder
x.view
crt_v.view
x.self.avg_pool.view
self.reduce_loss_dict
self.up.insert
opt.get
list
os.path.exists
ori_k.replace.split
gfpgan.archs.gfpganv1_arch.GFPGANv1
self.conv_in
basicsr.archs.stylegan2_arch.EqualLinear
basicsr.utils.download_util.load_file_from_url
self.conv_body_up.append
self.style_mlp.unsqueeze
latent_in.self.style_mlp.mean
self.net_d.named_parameters
i.self.conv_body_up.view
stylegan2_bilinear_arch.ScaledLeakyReLU
i_block.i_level.self.down.attn
torch.zeros
basicsr.utils.get_root_logger
realesrgan.utils.RealESRGANer
style_code.view.size
ResUpBlock
self.decode
readme
loc.torch.from_numpy.float
torch.nn.functional.interpolate
self.GFPGANBilinear.super.__init__
dict
self.conv3
basicsr.archs.rrdbnet_arch.RRDBNet
self.bn2
w_.transpose.contiguous
torchvision.transforms.functional.adjust_contrast
MultiHeadDecoderTransformer
self.optimizers.append
z.permute.contiguous
self.test
torch.nn.Linear
random.randint
self.style_conv1
f.read.format
tuple
ModulatedConv2d
gfpgan.GFPGANer
setuptools.find_packages
saturation.saturation.torch.tensor.uniform_.item
self.setup_schedulers
ValueError
l_g_total.backward
self.net_d_mouth
self.stylegan_decoder.named_parameters
f.readlines
basicsr.utils.get_root_logger.warning
MultiHeadEncoder
self.stylegan_decoder.load_state_dict
self.loc_left_eyes.size
k.transpose.transpose
torch.nn.init.xavier_normal_
self.norm2
importlib.import_module
self.final_linear
train_opt.get
x.view.view
self.gfpgan
torch.nn.AdaptiveAvgPool2d
style_truncation.append
format
NormStyleCode.append
self.layer1
rlt_feats.append
to_rgb
self.feed_data
i_level.self.down.downsample
get_requirements
torch.cuda.empty_cache
self.net_g_ema.eval
self.layer2
self.print_network
torch.nn.functional.leaky_relu_.size
basicsr.utils.scandir
get_version
basicsr.data.degradations.random_add_gaussian_noise
self.ConvLayer.super.__init__
self.style_mlp
torch.device
os.path.realpath
self.face_helper.paste_faces_to_input_image
self.gfpgan.to
self.style_convs.append
self.optimizer_g.zero_grad
self.load_network
self.RestoreFormer.super.__init__
self.norm1
collections.OrderedDict
brightness.brightness.torch.tensor.uniform_.item
basicsr.data.degradations.random_mixed_kernels
self.dropout
self.face_helper.get_face_landmarks_5
os.path.abspath
tqdm.tqdm
os.path.isdir
self.conv_shortcut
conv1
conv3x3
MultiHeadAttnBlock
torch.nn.functional.leaky_relu_
super.__init__
self.file_client.get
self.maxpool
str
self.optimizer_d_right_eye.zero_grad
conv2.new_empty
self.quantize.named_parameters
block
basicsr.archs.arch_util.default_init_weights
os.unlink
torch.randperm
self.modulated_conv
realesrgan.RealESRGANer
self.network_identity.parameters
map
i.self.condition_scale.clone
style.self.modulation.view
basicsr.archs.stylegan2_arch.ResBlock
self.mid.block_2
torch.min
styles.unsqueeze.repeat
out_rgbs.append
basicsr.utils.imwrite
self.ResNetArcFace.super.__init__
i.self.conv_body_up
torch.mean
v.transpose.permute
self.q
half_len_left_eye.mean_left_eye.half_len_left_eye.mean_left_eye.np.hstack.astype
self.EqualConv2d.super.__init__
argparse.ArgumentParser.parse_args
self.output.detach.cpu
self.color_jitter_pt
criterion
cv2.imread
self.relu
basicsr.utils.FileClient
self.noises.register_buffer
cv2.cvtColor
basicsr.utils.get_root_logger.info
self.nondist_validation
self.cri_l1
in_channels.out_channels.torch.randn.div_
self.n_e.indices.shape.torch.zeros.to.scatter_
self.StyleGAN2GeneratorClean.super.__init__
conditions.append
self.BasicBlock.super.__init__
self.modules
basicsr.train.train_pipeline
fake_d_pred.detach.mean
argparse.ArgumentParser.add_argument
self.decoder
os.makedirs
torch.sum
shift.shift.np.random.uniform.astype
self.toRGB.append
numpy.random.uniform
rois_mouths.torch.cat.to.append
torch.nn.Sequential
self.avg_pool
self.norm_out
gfpgan.archs.gfpganv1_clean_arch.GFPGANv1Clean
tb_logger.add_scalar
basicsr.archs.build_network
self.post_quant_conv.named_parameters
self.net_d_mouth.parameters
torch.nn.init.constant_
self.v
self.setup_optimizers
torch.cuda.is_available
basicsr.losses.build_loss
self.model_to_device

@developer
Could please help me check this issue?
May I pull a request to fix it?
Thank you very much.

Originally created by @PyDR-Tool on GitHub (Mar 12, 2023). Hi, In **GFPGAN**, inappropriate dependency versioning constraints can cause risks. Below are the dependencies and version constraints that the project is using ``` basicsr>=1.4.2 facexlib>=0.2.5 numpy tqdm ``` The version constraint **==** will introduce the risk of dependency conflicts because the scope of dependencies is too strict. The version constraint **No Upper Bound** and **\*** will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs. After further analysis, in this project, The version constraint of dependency **tqdm** can be changed to *>=3.4.0,<=4.64.0*. The above modification suggestions can reduce the dependency conflicts as much as possible, and introduce the latest version as much as possible without calling Error in the projects. The invocation of the current project includes all the following methods. In version tqdm-3.1.4, the API **tqdm.tqdm.set_description** whch is used by the current project in **gfpgan/models/gfpgan_model.py** is missing. <img width="494" alt="image" src="https://user-images.githubusercontent.com/109138844/224530410-0d31f4e3-5b75-4110-8967-836f5bbb8d9a.png"> <details> <summary>The calling methods from the tqdm</summary> <pre> tqdm.tqdm.close tqdm.tqdm.update tqdm.tqdm tqdm.tqdm.set_description </pre> </details> <details> <summary>The calling methods from the all methods</summary> <pre> basicsr.archs.srvgg_arch.SRVGGNetCompact torchvision.transforms.functional.adjust_saturation z.permute.contiguous.detach join torch.nn.functional.avg_pool2d basicsr.data.degradations.random_add_jpg_compression basicsr.data.transforms.augment self.model_ema self.stylegan_decoder NormStyleCode.extend os.path.splitext float Upsample i_block.i_level.self.down.block conv2 crt_v.size os.environ.get tqdm.tqdm.close _minimal_ext_cmd.strip f.read.strip.split ConstantInput subprocess.Popen basicsr.archs.stylegan2_arch.EqualConv2d shutil.rmtree z_q.permute.contiguous self.net_g.eval k.transpose.transpose.permute basicsr.losses.gan_loss.r1_penalty self.final_conv self.opt.items torch.nn.functional.leaky_relu self.mid.attn_1 clean_folder self.skip self.ResBlock.super.__init__ y.self.fc.view os.path.dirname gt_gray.self.network_identity.detach self.output.detach self.cri_pix main EqualConv2d self.net_d_left_eye basicsr.utils.registry.MODEL_REGISTRY.register numpy.min self.conv_out line.replace numpy.array basicsr.utils.registry.ARCH_REGISTRY.register self.condition_scale.append self.FFHQDegradationDataset.super.__init__ self.opt.build_network.to self.activation unet_skips.insert self.k i.self.conv_body_up.size stylegan2_bilinear_arch.EqualConv2d self.GFPGANv1Clean.super.__init__ gfpgan.GFPGANer.enhance self.encode self.net_g.train self.to_rgbs.append f.read.strip self.mid.block_1 self.cri_gan ori_k.replace.replace cropped_face_t.unsqueeze.to.unsqueeze torch.nn.functional.conv2d self.proj_out.permute torch.nn.Module open modify_checkpoint self.StyleGAN2GeneratorCSFT.super.__init__ self.FacialComponentDiscriminator.super.__init__ self.bn5.view torch.nn.ModuleList self.face_helper.clean_all basicsr.archs.stylegan2_arch.ScaledLeakyReLU torch.nn.Conv2d self.ToRGB.super.__init__ self.embedding.weight.t real_d_pred.detach.mean self.conv5.clone self.down.append self.net_d_mouth.train self.io_backend_opt.pop feat_gt.detach self.n_e.indices.shape.torch.zeros.to getattr z.permute.contiguous.view torch.nn.ModuleList.append line.split torch.split self.cri_perceptual self.encoder.named_parameters torch.nn.ReLU i.self.condition_shift.clone basicsr.ops.fused_act.fused_leaky_relu l_d_r1.detach.mean self.gray_resize_for_identity.unsqueeze torch.nn.Sigmoid v.transpose.reshape self.net_g_ema self.conv5.size torch.clamp.round cog.Input self.construct_img_pyramid locals self.network_identity style_code.view.view self.right_eyes.detach self.color_jitter NormStyleCode torchvision.transforms.functional.adjust_hue gfpganv1_arch.ResUpBlock self.save_training_state self.optimizer_d.step torch.cat torch.save cv2.imwrite half_len_mouth.mean_mouth.half_len_mouth.mean_mouth.np.hstack.astype torch.exp self.encoder _minimal_ext_cmd self.conv_body_first self.optimizer_d_left_eye.step torch.nn.BatchNorm1d k.transpose.transpose.reshape z_q.permute.contiguous.detach torch.nn.Dropout self.prelu self._initialize_best_metric_results i_level.self.up.upsample q.transpose.mul_ v.endswith torchvision.transforms.functional.adjust_brightness torch.clamp self.proj_out.view len hasattr self.face_enhancer.enhance torch.nn.LeakyReLU self.temb_proj self.conv2 torch.sigmoid self.VectorQuantizer.super.__init__ self.cri_gan.backward self.proj_out.transpose print self.constant_input self.fc5 numpy.prod self.conv4 self.net_d_right_eye.train self.gfpgan.eval basicsr.utils.download_util.load_file_from_url.startswith self.n_e.min_encoding_indices.shape.torch.zeros.to ResnetBlock basicsr.utils.img2tensor self.net_d.train self.bn3 self.net_d_right_eye.parameters self.optimizer_g.step restored_face.astype.astype self.Bottleneck.super.__init__ self.get_component_coordinates.append basicsr.archs.stylegan2_arch.ConvLayer self.proj_out.matmul basicsr.utils.registry.DATASET_REGISTRY.register min_encoding_indices.unsqueeze.unsqueeze self.weight.repeat ResBlock weight.pow.sum self.bn0 self.net_d_left_eye.train self.gt.detach.cpu half_len_right_eye.mean_right_eye.half_len_right_eye.mean_right_eye.np.hstack.astype tqdm.tqdm.set_description data.to w.h.b.out.new_empty.normal_ math.log z_q.permute.contiguous.view i.self.condition_shift reversed args.input.endswith torch.nn.BatchNorm2d os.path.isfile rois_eyes.torch.cat.to self.StyleGAN2GeneratorSFT.super.__init__ out.strip.decode torchvision.transforms.functional.normalize torch.nn.Embedding self.register_parameter numpy.mean train_opt.pop StyleGAN2GeneratorCSFT self.net_d self.construct_img_pyramid.insert ToRGB numpy.hstack self.network_identity.eval i_block.i_level.self.up.block torch.log cropped_face_t.unsqueeze.to self.to_rgb1 super self.net_d.parameters _comp_style self.cri_component basicsr.utils.FileClient.get glob.glob exec self.nin_shortcut self.metric_results.keys self.EqualLinear.super.__init__ numpy.concatenate self.left_eyes.detach basicsr.metrics.calculate_metric ScaledLeakyReLU x.view.transpose json.load self.downsample write_version_py self.gray_resize_for_identity basicsr.losses.gan_loss.r1_penalty.backward layers.append isinstance self.conv1 self.optimizer_d.zero_grad self.optimizer_d_mouth.step warnings.warn v.transpose.transpose numpy.clip i.self.toRGB StyleGAN2GeneratorBilinearSFT json.load.values torch.randn env.subprocess.PIPE.cmd.subprocess.Popen.communicate Downsample torch.tensor torch.no_grad weight.view.pow torch.randn.append self.face_helper.align_warp_face sorted checkpoint_bilinear.items self.quantize conv2.view self._make_layer q.transpose.permute os.system time.asctime q.transpose.transpose self.layer4 self.bn5 x.isdigit f.write z_q.permute.contiguous.permute ori_v.size z.permute.contiguous.permute self.GFPGANv1.super.__init__ torch.load get_git_hash self.gt.detach self.final_conv.size cog.Path math.sqrt.view stylegan2_bilinear_arch.ConvLayer self.ModulatedConv2d.super.__init__ self.embedding.weight.min_encodings.torch.matmul.view ConvUpLayer cv2.resize gfpgan.archs.restoreformer_arch.RestoreFormer torch.rsqrt.view self.get_component_coordinates torch.matmul self._log_validation_metric_values self.conv_body_down.append k.transpose.transpose.transpose torchvision.ops.roi_align cv2.filter2D i_block.i_level.self.up.attn self.bn1 conv2.size torch.rsqrt self._gram_mat self.GFPGANModel.super.__init__ gfpgan.archs.gfpgan_bilinear_arch.GFPGANBilinear self.bn4 self.StyleGAN2GeneratorBilinear.super.__init__ x.view.bmm hue.hue.torch.tensor.uniform_.item self.StyleGAN2GeneratorBilinearSFT.super.__init__ self.StyleConv.super.__init__ self.net_g.named_parameters torch.nn.functional.linear torch.nn.PReLU argparse.ArgumentParser self.condition_shift.append enumerate train_opt.build_loss.to self.quant_conv self.modulation self.net_d_right_eye StyleConv int out_channels.torch.zeros.fill_ self.proj_out torch.nn.functional.pad self.metric_results.items self.gfpgan.load_state_dict self.optimizer_d_right_eye.step VectorQuantizer basicsr.ops.fused_act.FusedLeakyReLU stylegan2_bilinear_arch.ResBlock self.ScaledLeakyReLU.super.__init__ z.z_q.detach os.path.join self.post_quant_conv self.n_e.indices.shape.torch.zeros.to.float self.optimizer_d_mouth.zero_grad self.bn5.size self.net_d_left_eye.parameters self.face_helper.get_inverse_affine contrast.contrast.torch.tensor.uniform_.item normal_params.append self.opt.get torch.nn.Upsample self.face_helper.add_restored_face os.listdir self.SEBlock.super.__init__ os.path.basename self.save_network setuptools.setup facexlib.utils.face_restoration_helper.FaceRestoreHelper gfpgan.archs.gfpganv1_clean_arch.GFPGANv1Clean.state_dict self._update_best_metric_result self.layer3 self.embedding.weight.data.uniform_ self.init_training_settings self.net_d.detach nonlinearity ConvLayer torch.nn.Parameter self.loc_left_eyes.new_full self.ResUpBlock.super.__init__ os.path.islink EqualLinear f.read self.gt_folder.endswith self.conv5.view self.face_helper.read_image self.fc self.decoder.named_parameters torch.stack self.conv self.get_roi_regions self.bg_upsampler.enhance StyleGAN2GeneratorSFT zip math.sqrt x.size self.cri_component.backward compile self.get_optimizer Normalize self.ConstantInput.super.__init__ self.conv5 get_hash weight.view.view basicsr.losses.gan_loss.r1_penalty.detach rois_mouths.torch.cat.to self.opt.keys math.sqrt.new_empty self.gfpgan.squeeze self.ConvUpLayer.super.__init__ self.optimizer_d_left_eye.zero_grad torch.tensor.uniform_ i.self.condition_scale self.net_g self.se torch.nn.GroupNorm SEBlock self.activate numpy.tile q.transpose.reshape rois_eyes.torch.cat.to.append self.mouths.detach basicsr.utils.imfrombytes numpy.max torch.nn.MaxPool2d tempfile.mkdtemp tqdm.tqdm.update torch.from_numpy basicsr.utils.tensor2img self.IRBlock.super.__init__ i.self.conv_body_down range torch.nn.functional.softmax stylegan2_bilinear_arch.EqualLinear basicsr.data.data_util.paths_from_folder x.view crt_v.view x.self.avg_pool.view self.reduce_loss_dict self.up.insert opt.get list os.path.exists ori_k.replace.split gfpgan.archs.gfpganv1_arch.GFPGANv1 self.conv_in basicsr.archs.stylegan2_arch.EqualLinear basicsr.utils.download_util.load_file_from_url self.conv_body_up.append self.style_mlp.unsqueeze latent_in.self.style_mlp.mean self.net_d.named_parameters i.self.conv_body_up.view stylegan2_bilinear_arch.ScaledLeakyReLU i_block.i_level.self.down.attn torch.zeros basicsr.utils.get_root_logger realesrgan.utils.RealESRGANer style_code.view.size ResUpBlock self.decode readme loc.torch.from_numpy.float torch.nn.functional.interpolate self.GFPGANBilinear.super.__init__ dict self.conv3 basicsr.archs.rrdbnet_arch.RRDBNet self.bn2 w_.transpose.contiguous torchvision.transforms.functional.adjust_contrast MultiHeadDecoderTransformer self.optimizers.append z.permute.contiguous self.test torch.nn.Linear random.randint self.style_conv1 f.read.format tuple ModulatedConv2d gfpgan.GFPGANer setuptools.find_packages saturation.saturation.torch.tensor.uniform_.item self.setup_schedulers ValueError l_g_total.backward self.net_d_mouth self.stylegan_decoder.named_parameters f.readlines basicsr.utils.get_root_logger.warning MultiHeadEncoder self.stylegan_decoder.load_state_dict self.loc_left_eyes.size k.transpose.transpose torch.nn.init.xavier_normal_ self.norm2 importlib.import_module self.final_linear train_opt.get x.view.view self.gfpgan torch.nn.AdaptiveAvgPool2d style_truncation.append format NormStyleCode.append self.layer1 rlt_feats.append to_rgb self.feed_data i_level.self.down.downsample get_requirements torch.cuda.empty_cache self.net_g_ema.eval self.layer2 self.print_network torch.nn.functional.leaky_relu_.size basicsr.utils.scandir get_version basicsr.data.degradations.random_add_gaussian_noise self.ConvLayer.super.__init__ self.style_mlp torch.device os.path.realpath self.face_helper.paste_faces_to_input_image self.gfpgan.to self.style_convs.append self.optimizer_g.zero_grad self.load_network self.RestoreFormer.super.__init__ self.norm1 collections.OrderedDict brightness.brightness.torch.tensor.uniform_.item basicsr.data.degradations.random_mixed_kernels self.dropout self.face_helper.get_face_landmarks_5 os.path.abspath tqdm.tqdm os.path.isdir self.conv_shortcut conv1 conv3x3 MultiHeadAttnBlock torch.nn.functional.leaky_relu_ super.__init__ self.file_client.get self.maxpool str self.optimizer_d_right_eye.zero_grad conv2.new_empty self.quantize.named_parameters block basicsr.archs.arch_util.default_init_weights os.unlink torch.randperm self.modulated_conv realesrgan.RealESRGANer self.network_identity.parameters map i.self.condition_scale.clone style.self.modulation.view basicsr.archs.stylegan2_arch.ResBlock self.mid.block_2 torch.min styles.unsqueeze.repeat out_rgbs.append basicsr.utils.imwrite self.ResNetArcFace.super.__init__ i.self.conv_body_up torch.mean v.transpose.permute self.q half_len_left_eye.mean_left_eye.half_len_left_eye.mean_left_eye.np.hstack.astype self.EqualConv2d.super.__init__ argparse.ArgumentParser.parse_args self.output.detach.cpu self.color_jitter_pt criterion cv2.imread self.relu basicsr.utils.FileClient self.noises.register_buffer cv2.cvtColor basicsr.utils.get_root_logger.info self.nondist_validation self.cri_l1 in_channels.out_channels.torch.randn.div_ self.n_e.indices.shape.torch.zeros.to.scatter_ self.StyleGAN2GeneratorClean.super.__init__ conditions.append self.BasicBlock.super.__init__ self.modules basicsr.train.train_pipeline fake_d_pred.detach.mean argparse.ArgumentParser.add_argument self.decoder os.makedirs torch.sum shift.shift.np.random.uniform.astype self.toRGB.append numpy.random.uniform rois_mouths.torch.cat.to.append torch.nn.Sequential self.avg_pool self.norm_out gfpgan.archs.gfpganv1_clean_arch.GFPGANv1Clean tb_logger.add_scalar basicsr.archs.build_network self.post_quant_conv.named_parameters self.net_d_mouth.parameters torch.nn.init.constant_ self.v self.setup_optimizers torch.cuda.is_available basicsr.losses.build_loss self.model_to_device </pre> </details> @developer Could please help me check this issue? May I pull a request to fix it? Thank you very much.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TencentARC/GFPGAN#324