NAFNet
NAFNet copied to clipboard
Project dependencies may have API risk issues
Hi, In NAFNet, inappropriate dependency versioning constraints can cause risks.
Below are the dependencies and version constraints that the project is using
addict
future
lmdb
numpy
opencv-python
Pillow
pyyaml
requests
scikit-image
scipy
tb-nightly
tqdm
yapf
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 numpy can be changed to >=1.8.0,<=1.23.0rc3. The version constraint of dependency requests can be changed to >=0.8.0,<=2.24.0. The version constraint of dependency requests can be changed to ==2.26.0. The version constraint of dependency scipy can be changed to >=0.12.0,<=0.12.1. The version constraint of dependency tqdm can be changed to >=4.36.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.
The calling methods from the numpy
numpy.linalg.pinv
The calling methods from the requests
requests.Session.get requests.Session
The calling methods from the scipy
scipy.linalg.sqrtm scipy.ndimage.filters.convolve scipy.ndimage.filters.gaussian_filter
The calling methods from the tqdm
tqdm.tqdm.update tqdm.tqdm.close tqdm.tqdm tqdm.tqdm.set_description
The calling methods from the all methods
range kernel_width.idx.idx.j.img_aug.transpose.mv get_confirm_token numpy.ones SCAM target.pred.mean.torch.log.mean metric_dict.items x.gaussian_filter.torch.from_numpy.type_as.unsqueeze.unsqueeze img.transpose.copy cv2.imread isinstance sym_len_he.in_h.sym_len_hs.img_aug.narrow.copy_ numpy.square torch.nn.init.kaiming_normal_ opt.copy.items model.get_current_visuals numpy.reciprocal x.cumsum print self._print_different_keys_loading self.batch.items Baseline.__init__ kernel_width.idx.idx.j.out_1_aug.mv self.CosineAnnealingRestartLR.super.__init__ zip basicsr.models.archs.inception.InceptionV3 prepare_keys img_name.replace.replace torch.distributed.init_process_group matplotlib.pyplot.savefig basicsr.utils.options.parse entry.is_file map self.coef.pred.sum IOError super torch.log index.self.gts.copy.astype generate_gaussian_kernel torch.distributed.get_world_size basicsr.data.transforms.mod_crop dlib.shape_predictor numpy.abs mc.pyvector numpy.nanmean AvgPool2d basicsr.utils.padding torch.nn.functional.interpolate random.random i.det_faces.rect.right basicsr.models.archs.define_network self.VideoRecurrentTestDataset.super.__init__ down logging.FileHandler _ssim self.neighbor_list.reverse self.test folder.self.imgs_gt.index_select self.inverse_affine_matrices.append weight.sum.dim img2.detach.cpu.numpy.transpose basicsr.utils.matlab_functions.bgr2ycbcr.astype face_areas.append model.grids_inverse self.ResidualBlockNoBN.super.__init__ PrefetchGenerator model self.conv2 cov_sqrt.np.isfinite.all numpy.floor indices.contiguous.contiguous _cal_ssim cubic setuptools.setup torch.nn.functional.grid_sample self.PairedImageSRLRDataset.super.__init__ i.self.optimizers.load_state_dict line.split self.metric_results.keys torch.distributed.is_available torch.utils.data.DataLoader f.read self.ending F_r2l.permute.permute p.p.p.torch.linspace.view.expand NAFSSR o.state_dict _convert_output_type_range self.txt_file.write abs self.cropped_faces.append p.sum os.getenv torch.ones dequantize_flow _psnr multiprocessing.Pool crt_net.state_dict.state_dict self.norm_l torch.nn.PixelShuffle random.randint self.coef.pred.sum.unsqueeze.size self.get_bare_model.load_state_dict scipy.ndimage.filters.convolve weight_reduce_loss.mean self.all_landmarks_68.append basicsr.utils.mkdir_and_rename skimage.metrics.structural_similarity opt.keys face_areas.index img2tensor v.endswith _ssim_cly entry.name.startswith img.detach.cpu response_file_size.headers.split x_r.self.norm_r.self.r_proj1.permute new_img.torch.stack.detach.cpu.numpy self.load_network opt_.pop self._client.Get self.feed_data backend.self._backends torch.nn.parallel.DataParallel self.net_g.eval basicsr.models.create_model.get_current_visuals torch.cuda.device_count weight_reduce_loss.size list.reverse os.path.basename self.reduce_loss_dict hasattr basicsr.models.lr_scheduler.VibrateLR u.view cri_perceptual_cls torch.cuda.set_device niqe datetime.timedelta self.MultiStepRestartLR.super.__init__ numpy.frombuffer torch.matmul idxes.append next torch.multiprocessing.set_start_method grad_output.sum.sum.sum self.get_bare_model.state_dict line.split.append basicsr.data.data_util.read_img_seq y.grad_output.sum torch.cuda.Stream r2.r1.x.cumsum.cumsum self.conv5 f.read.strip.split key.encode i.img.unsqueeze.unsqueeze torch.load h.w.np.float32.f.np.fromfile.reshape numpy.roll math.cos lmdb.open img.squeeze.squeeze x.squeeze.view NotImplementedError argparse.ArgumentParser set init_lr_groups_l.append torch.device self.LinearLR.super.__init__ importlib.import_module self.decoders.append x.mean session.get.iter_content weights.torch.sum.view.expand img.astype.transpose numpy.frombuffer.transpose self.VideoTestVimeo90KDataset.super.__init__ logger.get_root_logger.info readme tqdm.tqdm.update self.lq.detach.cpu math.sqrt numpy.concatenate.append weights.torch.sum.view basicsr.metrics.metric_util.to_y_channel.detach cv2.GaussianBlur basicsr.metrics.metric_util.to_y_channel.squeeze train_opt.pop self.save_training_state x_l.self.norm_l.self.l_proj1.permute self.sca torch.floor basicsr.utils.scandir_SIDD numpy.clip.astype i.img.unsqueeze.unsqueeze.conv.squeeze calculate_psnr img1.torch.tensor.float extension msg_logger torch.stack.insert basicsr.utils.img2tensor.unsqueeze gaussian_filter.torch.from_numpy.type_as torch.arange weight.sum.sum numpy.dot get_root_logger model_cls numpy.iscomplexobj self.PairedStereoImageDataset.super.__init__ random.seed model.eval basicsr.utils.create_lmdb.create_lmdb_for_gopro logging.Formatter encode self.read_input_image dict basicsr.utils.imfrombytes pred.detach.cpu model.test torch.zeros_like argparse.ArgumentParser.add_argument hr_lists.append tqdm.tqdm.close torch.distributed.reduce cnt.torch.tensor.float.to torch.abs torch.nn.parallel.DistributedDataParallel torch.linspace basicsr.utils.FileClient mkdir_and_rename get_version ssim_map.mean self.MSELoss.super.__init__ numpy.outer img2.detach.cpu.numpy _tensor.squeeze.float.detach.cpu.clamp_.squeeze self._get_init_lr _tensor.squeeze.float.detach.cpu.clamp_.numpy numpy.max collections.Counter torch.matmul.permute folder.self.imgs_lq.index_select _minimal_ext_cmd.strip img1.detach.cpu numpy.log setattr os.system module.modules self._set_lr opt.lower self.grids conv self.conv1 torch.cuda.manual_seed_all self.lq.detach _ssim_3d get_dist_info basicsr.models.create_model.get_current_learning_rate basicsr.metrics.metric_util.reorder_image default_init_weights out_2.numpy.transpose self.keys.extend basicsr.train.parse_options.get s.state_dict opt.copy.pop numpy.minimum dumper.represent_dict _augment self.downs.append self.PrefetchDataLoader.super.__init__ sym_len_hs.img_aug.narrow.copy_ os.path.join basicsr.utils.create_lmdb.create_lmdb_for_reds mc.ConvertBuffer img1.torch.tensor.float.cuda init_loggers self.coef.target.sum img2.torch.tensor.float self.REDSDataset.super.__init__ kernel_width.idx.idx.j.img_aug.transpose os.path.dirname get_requirements parse_options.items self.middle_blks self.conv3 time.strftime data.inception.view numpy.isnan torch.cuda.manual_seed getattr basicsr.utils.create_lmdb.create_lmdb_for_SIDD mu.x.pow.mean i.det_faces.rect.left scipy.linalg.sqrtm self.setup_schedulers write_version_py data.to F_l2r.permute.permute g.self.total_size.torch.randperm.tolist self.gt_folder.endswith scipy.ndimage.filters.gaussian_filter k.crt_net.size extract_subimages basicsr.utils.FileClient.get os.path.realpath time.time scipy.special.gamma client.begin _tensor.squeeze.float.detach.cpu.clamp_.dim i.det_faces.rect.top self.l_proj1 input_folder.endswith env.subprocess.PIPE.cmd.subprocess.Popen.communicate time.sleep i.det_face.rect.bottom self.cri_perceptual self.optimizers.append weights_h.size locals os.path.relpath Exception basicsr.models.lr_scheduler.LinearLR self.optimizer_g.zero_grad self.relu time.localtime img.astype.float warm_up_lr_l.append basicsr.data.prefetch_dataloader.PrefetchDataLoader sys.path.append img_name.replace.replace.replace.replace basicsr.data.create_dataset int torch.abs.type_as x_r.self.r_proj2.permute self.queue.put wandb.util.generate_id self.norm1 basicsr.models.archs.arch_util.LayerNorm2d math.isclose lmdb_path.endswith weight.view _tensor.squeeze.float.detach.cpu replace_layers cog.Input min_val.max_val.arr.levels.np.floor.astype functools.partial metric.self.metric_results.torch.tensor.float metric_type.metric_module.getattr i.self.schedulers.load_state_dict self.nondist_validation numpy.squeeze basicsr.version.__version__.split requests.Session basicsr.models.create_model.resume_training numpy.int32.flow.shape.flow.shape.np.array.tofile torch.nn.functional.mse_loss torch.multiprocessing.get_start_method self.init_training_settings open.write torch.load.pop inception numpy.concatenate.copy phase.split.split yaml.load m.children img.round.astype logging.getLogger.setLevel quantize_flow basicsr.utils.get_root_logger.warning f.read.strip torch.nn.functional.pad.chunk model.named_children new_img.torch.stack.detach subprocess.Popen torch.distributed.get_rank dataset_opt.get up train_opt.cri_perceptual_cls.to torch.sqrt self.preload k.load_net.size multiprocessing.Pool.apply_async basicsr.data.transforms.paired_random_crop torch.LongTensor basicsr.utils.get_env_info numpy.frombuffer.astype module numpy.random.rand torchvision.transforms.functional.normalize enumerate img.unsqueeze.unsqueeze.conv3d.squeeze os.path.expanduser encs.append torch.nn.functional.adaptive_avg_pool2d torch.cuda.synchronize img.round.size numpy.ascontiguousarray self.optimizer_g.step os.rename calculate_weights_indices torch.floor.view self.client.get numpy.int32.f.np.fromfile.squeeze keys.append out_length.u.view.expand logger.get_root_logger numpy.fromfile dataset_cls cv2.filter2D numpy.dstack.astype lmdb.open.close ssims.np.array.mean basicsr.data.transforms.augment torch.tensor numpy.array subprocess.getoutput module.split self.PairedImageDataset.super.__init__ self.shape_predictor_68 numpy.matmul log_vars.keys model.opt.get cv2.imdecode iter NAFNet basicsr.utils.set_random_seed opt.get sym_len_ws.out_1_aug.narrow.copy_ self.data_info.append torch.cuda.current_device f.flush _tensor.squeeze.float.detach collections.OrderedDict numpy.frombuffer.round str key.split self.collected_metrics.items index.self.gts.copy x.squeeze.unsqueeze torch.cuda.is_available sorted stereo_image_inference self.VibrateLR.super.__init__ filename_tmpl.format self.gelu torch.cuda.current_stream logging.getLogger.addHandler cv2.copyMakeBorder os.scandir self.start self.logger.info LayerNormFunction.apply self.output.detach.cpu x.squeeze.size os.path.relpath.find self.shape_predictor_68.parts fig.add_subplot.imshow train_opt.cri_pix_cls.to self.coef.to basicsr.utils.lmdb_util.make_lmdb_from_imgs bias.view type _generate_3d_gaussian_kernel math.log cv2.erode get_position_from_periods numpy.concatenate index.self.lqs.copy self.convert misc.sizeof_fmt numpy.split i.det_face.rect.left line.replace weights_w.size self.queue.get basicsr.data.data_sampler.EnlargedSampler.set_epoch distparam.np.isnan.any tuple cri_pix_cls torch.nn.Identity matplotlib.pyplot.subplots_adjust logging.FileHandler.setFormatter weights.contiguous.narrow multiprocessing.Pool.join f.read.decode imread torch.optim.Adam _tensor.squeeze.float.detach.cpu.clamp_ self.opt.keys _tensor.size.math.sqrt.int._tensor.make_grid.numpy _totensor dequantize torch.nn.init.constant_ read_img_worker folder.endswith eps.var.sqrt basicsr.metrics.metric_util.to_y_channel.max os.mkdir basicsr.utils.get_time_str self.gt.detach self.coef.pred.sum.unsqueeze basicsr.models.create_model.update_learning_rate cv2.imwrite self.schedulers.append torch.cat.unsqueeze self.encoders.append new_img.append basicsr.data.prefetch_dataloader.CPUPrefetcher torch.optim.lr_scheduler.CosineAnnealingLR self.net_g.parameters self.mixup_aug self._backends.keys x.squeeze.squeeze img.torch.from_numpy.float mse_loss indices.contiguous.min index.self.lqs.copy.astype NAFNet.__init__ os.path.relpath.endswith cv2.warpAffine os.makedirs sys.exit _tensor.squeeze.float basicsr.train.parse_options torch.FloatTensor dlib.load_rgb_image self.fusion torch.nn.utils.clip_grad_norm_ self.model_to_device state.append basicsr.models.create_model.get_current_log basicsr.utils.imwrite numpy.cov grad_output.sum data.items self.norm2 k.startswith self.Vimeo90KDataset.super.__init__ basicsr.utils.get_root_logger.info logging.getLogger.warning SimpleGate cnt.torch.tensor.float network.replace numpy.diagonal make_cuda_ext get_git_hash single_image_inference result.append os.path.abspath _init_dist_slurm logger.get_root_logger.warning self.file_client.get value.mean.item sym_patch.size i.det_face.rect.right calculate_ssim max basicsr.utils.dist_util.init_dist reduce_loss basicsr.models.create_model.save basicsr.models.lr_scheduler.MultiStepRestartLR basicsr.models.archs.local_arch.Local_Base.__init__ out.strip.decode img_path.split k.self.batch.to torch.cat.append self.similarity_trans.estimate feat.append cv2.imencode self.net_g.named_parameters basicsr.models.create_model.grids_inverse count_mt.preds.to grid_y.grid_x.torch.stack.float self.r_proj2 w.torch.arange.type_as self.coef.target.sum.unsqueeze basicsr.utils.img2tensor torch.no_grad parts.append img.round.transpose basicsr.utils.init_tb_logger cv2.flip content.format dataset.get basicsr.utils.check_resume flow.size torch.nn.Sigmoid numpy.dstack.tofile torch.nn.Conv3d indices.contiguous.narrow logging.basicConfig get_hash cv2.getGaussianKernel.transpose basicsr.data.prefetch_dataloader.CUDAPrefetcher _3d_gaussian_calculator feat.extend self.client.get_text dist_util.get_dist_info img.torch.from_numpy.float.detach x.size numpy.squeeze.astype basicsr.models.archs.NAFNet_arch.NAFBlock self.norm_r v.cv2.imread.astype lr_lists.append self.body model.feed_data self.tb_logger.add_scalar self.affine_matrices.append grad_output.sum.sum m.bias.data.fill_ env.begin.put self.output.detach torch.nn.Parameter torch.nn.functional.conv2d img2.detach.cpu basicsr.data.prefetch_dataloader.CUDAPrefetcher.next self.setup_optimizers basicsr.data.create_dataloader random.choice txn.get x.gaussian_filter.torch.from_numpy.type_as.unsqueeze absx.absx.type_as basicsr.data.data_util.paired_paths_from_lmdb queue.Queue basicsr.data.data_util.paired_paths_from_meta_info_file glob.glob numpy.stack i.img.unsqueeze compute_feature basicsr.models.archs.arch_util.MySequential self.intro copy.deepcopy.items f.readlines model.grids l1_loss i.det_face.rect.top f.write self.env.close torch.nn.ModuleList torch.stack torch.softmax sym_patch.size.torch.arange.long ssims.append basicsr.utils.scandir matplotlib.pyplot.title copy.deepcopy self.get_bare_model.to torch.nn.functional.pad cv2.getGaussianKernel torch.load.keys torch.Generator.manual_seed self._modules.values super.__iter__ functools.wraps torch.cat.astype self.cri_pix _convert_input_type_range parse_options.get logging.getLogger dlib.cnn_face_detection_model_v1 cog.Path torch.stack.append img.astype.astype parse_options torch.manual_seed self.all_landmarks_5.append basicsr.data.prefetch_dataloader.CUDAPrefetcher.reset out_length.left.view.expand new_img.torch.stack.detach.cpu torchvision.utils.make_grid multiprocessing.Pool.close torch.rand torch.cuda.current_stream.wait_stream i.img.unsqueeze.unsqueeze.conv.squeeze.squeeze torch.is_tensor numpy.arange basicsr.data.data_sampler.EnlargedSampler self.forward inp.chunk.chunk indices.contiguous.max value.mean img.torch.from_numpy.unsqueeze.unsqueeze self.io_backend_opt.pop save_path.replace.replace log_vars.items img2.torch.tensor.float.cuda basicsr.utils.get_root_logger self.get_bare_model.parameters get_time_str crt_net.state_dict.keys join log_vars.update i.det_faces.rect.bottom basicsr.models.create_model.grids os.path.exists logging.FileHandler.setLevel self.restored_faces.append self.grids_inverse outs.append decoder self.se basicsr.metrics.metric_util.to_y_channel torch.cuda.stream response.cookies.items gt_folder.endswith dict2str logging.getLogger.info torch.nn.ReLU torch.cuda.empty_cache m.append img.torch.from_numpy.unsqueeze basicsr.utils.dist_util.get_dist_info self.net_g.detach torch.nn.functional.l1_loss tqdm.tqdm.set_description basicsr.utils.MessageLogger argparse.ArgumentParser.parse_args numpy.mean v.split torch.optim.SGD sum h.torch.arange.type_as basicsr.utils.make_exp_dirs x.view.permute ImportError sys.argv.remove self.r_proj1 self.ImageRestorationModel.super.__init__ basicsr.utils.flow_util.dequantize_flow quantize func img.round.round pathlib.Path index.self.data_info.split numpy.allclose basicsr.utils.options.dict2str torch.nn.functional.pad.size numpy.clip pickle.dump mc.MemcachedClient.GetInstance self._log_validation_metric_values numpy.transpose sym_len_we.in_w.sym_len_ws.out_1_aug.narrow.copy_ BaselineBlock float grad_output.size all inception.nn.DataParallel.eval img.unsqueeze.unsqueeze.conv3d.squeeze.squeeze exec img.torch.from_numpy.float.unsqueeze torch.zeros img_name.replace.replace.replace save_path.replace.replace.replace matplotlib.pyplot.figure create_train_val_dataloader basicsr.utils.init_wandb_logger flow.transpose.transpose x.isdigit loader.construct_pairs str.encode flow.clone storage.cuda flatten_folders img_name.replace.replace.replace.replace.replace self.txn.commit numpy.log10 conv3d format layers.append pickle.load numpy.load self.sg NAFNetSR.__init__ log_vars.pop NAFBlockSR _generate_3d_gaussian_kernel.cuda compile self.save_network torch.stack.extend metric.self.metric_results.torch.tensor.float.to basicsr.models.archs.NAFNet_arch.LayerNorm2d torch.meshgrid img1.detach.cpu.numpy.transpose _scandir _minimal_ext_cmd self.get_current_visuals self.Upsample.super.__init__ x.cumsum.cumsum_ opt.pop self.check_image_size weight_reduce_loss.sum torch.utils.tensorboard.SummaryWriter math.ceil basicsr.models.create_model.validation self.register_parameter calculate_skimage_ssim basicsr.data.data_util.paired_paths_from_folder self.net_g.train self.dropout2 numpy.dstack self.blk yaml.Dumper.add_representer estimate_aggd_param _tensor.squeeze.float.detach.cpu.clamp_.size numpy.append self.L1Loss.super.__init__ self.eval y.g.mean torch.from_numpy basicsr.utils.matlab_functions.bgr2ycbcr self.FFHQDataset.super.__init__ time.perf_counter basicsr.data.transforms.paired_random_crop_hw matplotlib.pyplot.figure.add_subplot weight_reduce_loss self.PairedImageSRLRFullImageMemoryDataset.super.__init__ scheduler.step env.begin.commit yaml.Loader.add_constructor y.grad_output.sum.sum.sum weights.contiguous.contiguous train_opt.get torch.nn.Conv2d main basicsr.data.data_util.read_img_seq.squeeze_ self.net_g x_view.permute.reshape ctx.save_for_backward DropPath numpy.sum img.unsqueeze.unsqueeze torch.nn.functional._Reduction.get_enum self.env.begin x_l.self.l_proj2.permute list torch.tensor.reshape lmdb.open.begin os.environ.get zip.items weight_reduce_loss.dim logging.getLogger.hasHandlers dynamic_instantiation self.SingleImageDataset.super.__init__ img.detach.cpu.numpy optim_params.append ValueError basicsr.models.lr_scheduler.CosineAnnealingRestartLR encoder self.opt.get numpy.zeros Baseline math.floor basicsr.models.create_model.feed_data basicsr.utils.init_tb_logger.close setuptools.find_packages tqdm.tqdm len skimage.transform.SimilarityTransform self.VideoTestDataset.super.__init__ numpy.trace img.transpose.transpose sym_patch.index_select fig.add_subplot.axis torch.optim.AdamW self.data_info.extend NAFBlock requests.Session.get x.numel self.face_detector torch.randperm r2.r1.x.cumsum numpy.isfinite super.__init__ loss_func self.up weight.sum.size basicsr.utils.matlab_functions.bgr2ycbcr.transpose torch.nn.DataParallel basicsr.models.create_model.test self.ups.append self.dist_validation basicsr.data.data_util.paths_from_lmdb torch.Generator self.gt.detach.cpu numpy.random.seed cv2.resize wandb.init time.asctime torch.save out_2.numpy.transpose.numpy threading.Thread.__init__ torch.distributed.is_initialized ordered_yaml self.txt_file.close ptflops.get_model_complexity_info self.restarts.index torch.nn.GELU numpy.argmin load_net.deepcopy.items sum.backward os.path.splitext basicsr.utils.tensor2img self.module self.get_bare_model self.conv4 save_response_content torch.sum img.transpose.torch.from_numpy.float basicsr.models.create_model key.startswith torch.nn.AdaptiveAvgPool2d self.gt.size basicsr.data.data_util.duf_downsample self.PSNRLoss.super.__init__ tempfile.mkdtemp torch.nn.Sequential numpy.sqrt cv2.getRotationMatrix2D param.cpu self.LayerNorm2d.super.__init__ in_h.sym_len_hs.img_aug.narrow.copy_ self.txn.put basicsr.metrics.metric_util.to_y_channel.astype img.torch.from_numpy.float.squeeze x.view net_.state_dict.items open mu.x.pow torch.cat _augment_flow torch.nn.Dropout in_w.sym_len_ws.out_1_aug.narrow.copy_ opt.copy _init_dist_pytorch indices.append img1.detach.cpu.numpy block.flatten.flatten cv2.resize.astype os.listdir img.torch.from_numpy.unsqueeze.unsqueeze.float cv2.cvtColor data.inception.view.to torch.FloatTensor.narrow numpy.eye p.p.torch.linspace.view data.to.to target.pred.mean self.l_proj2 basicsr.data.data_util.generate_frame_indices inception.nn.DataParallel.eval.to yaml.load.items basicsr.models.create_model.optimize_parameters numpy.linalg.pinv self.dropout1 min cls_ y.grad_output.sum.sum basic_block TypeError self.shape_predictor_5 weight.view.mean open.close
@developer Could please help me check this issue? May I pull a request to fix it? Thank you very much.