Giter Club home page Giter Club logo

mdbn's Introduction

Architecture

Multi-Depth Branches Network for Efficient Image Super-Resolution

Huiyuan Tian, Li Zhang, Shijian Li, Min Yao and Gang Pan

Run

Environments

  1. Install python3.10
  2. Install PyTorch (tested on Release 1.12)
  3. BasicSR 1.4.2

Installation

# Clone the repo
git clone https://github.com/thy960112/MDBN.git
# Install dependent packages
cd MDBN
pip install -r requirements.txt
# Install BasicSR
python setup.py develop

Training

For different scales, the following commands can be used for training respectively:

# train MDBN for x2 SR
python basicsr/train.py -opt options/train/MDBN/train_MDBN_x2.yml
# train MDBN for x3 SR
python basicsr/train.py -opt options/train/MDBN/train_MDBN_x3.yml
# train MDBN for x4 SR
python basicsr/train.py -opt options/train/MDBN/train_MDBN_x4.yml

Testing

  1. Download the pre-trained models.
  2. Download the testing dataset.
  3. For different scales, the following commands can be used for testing respectively:
# test MDBN for x2 SR
python basicsr/test.py -opt options/test/MDBN/test_MDBN_x2.yml
# test MDBN for x3 SR
python basicsr/test.py -opt options/test/MDBN/test_MDBN_x3.yml
# test MDBN for x4 SR
python basicsr/test.py -opt options/test/MDBN/test_MDBN_x4.yml

Acknowledgement

This code is based on BasicSR toolbox. Thanks for the awesome work.

mdbn's People

Contributors

thy960112 avatar

Stargazers

 avatar  avatar Huiyuan Tian avatar LIU WENYANG avatar lin avatar doudou avatar Akif avatar  avatar HPC_Amateur avatar BinRen avatar Zichen Wang avatar An-zhi WANG avatar Andy Dennis avatar  avatar Adam Twardoch avatar

Watchers

 avatar

mdbn's Issues

I have solved this problem

in basic_loss.py

import torch
from torch import nn as nn
from torch.nn import functional as F

from basicsr.archs.vgg_arch import VGGFeatureExtractor
from basicsr.utils.registry import LOSS_REGISTRY
from .loss_util import weighted_loss

Do I need to define a vgg_arch myself?

KeyError: "No object named 'MDBN' found in 'arch' registry!"

$ python basicsr/test.py -opt options/test/MDBN/test_MDBN_x2.yml
C:\Python310\lib\site-packages\torchvision\transforms\functional_tensor.py:5: UserWarning: The torchvision.transforms.functional_tensor module is deprecated in 0.15 and will be **removed in 0.17**. Please don't rely on it. You probably just need to use APIs in torchvision.transforms.functional or in torchvision.transforms.v2.functional.
  warnings.warn(
Disable distributed.
Path already exists. Rename it to C:\MDBN-main\results\001_MDBN_x2_archived_20231009_203813
2023-10-09 20:38:13,476 INFO:
                ____                _       _____  ____
               / __ ) ____ _ _____ (_)_____/ ___/ / __ \
              / __  |/ __ `// ___// // ___/\__ \ / /_/ /
             / /_/ // /_/ /(__  )/ // /__ ___/ // _, _/
            /_____/ \__,_//____//_/ \___//____//_/ |_|
     ______                   __   __                 __      __
    / ____/____   ____   ____/ /  / /   __  __ _____ / /__   / /
   / / __ / __ \ / __ \ / __  /  / /   / / / // ___// //_/  / /
  / /_/ // /_/ // /_/ // /_/ /  / /___/ /_/ // /__ / /<    /_/
  \____/ \____/ \____/ \____/  /_____/\____/ \___//_/|_|  (_)

Version Information:
        BasicSR: 1.4.2
        PyTorch: 2.0.1+cu118
        TorchVision: 0.15.2+cu118
2023-10-09 20:38:13,476 INFO:
  name: 001_MDBN_x2
  model_type: SRModel
  scale: 2
  num_gpu: 1
  manual_seed: 2023
  datasets:[
    test_1:[
      name: Set5
      type: PairedImageDataset
      dataroot_gt: datasets/Set5/GTmod12
      dataroot_lq: datasets/Set5/LRbicx2
      io_backend:[
        type: disk
      ]
      phase: test
      scale: 2
    ]
  ]
  network_g:[
    type: MDBN
    num_in_ch: 3
    num_out_ch: 3
    num_feat: 64
    num_block: 6
    upscale: 2
    res_scale: 1.0
  ]
  path:[
    pretrain_network_g: experiments/pretrained_models/MDBN_x2.pth
    strict_load_g: True
    results_root: C:\MDBN-main\results\001_MDBN_x2
    log: C:\MDBN-main\results\001_MDBN_x2
    visualization: C:\MDBN-main\results\001_MDBN_x2\visualization
  ]
  val:[
    save_img: True
    suffix: None
    metrics:[
      psnr:[
        type: calculate_psnr
        crop_border: 4
        test_y_channel: ture
      ]
      ssim:[
        type: calculate_ssim
        crop_border: 4
        test_y_channel: ture
      ]
    ]
  ]
  dist: False
  rank: 0
  world_size: 1
  auto_resume: False
  is_train: False

2023-10-09 20:38:13,476 INFO: Dataset [PairedImageDataset] - Set5 is built.
2023-10-09 20:38:13,476 INFO: Number of test images in Set5: 2
Name MDBN is not found, use name: MDBN_basicsr!
Traceback (most recent call last):
  File "C:\MDBN-main\basicsr\test.py", line 45, in <module>
    test_pipeline(root_path)
  File "C:\MDBN-main\basicsr\test.py", line 35, in test_pipeline
    model = build_model(opt)
  File "C:\Python310\lib\site-packages\basicsr\models\__init__.py", line 26, in build_model
    model = MODEL_REGISTRY.get(opt['model_type'])(opt)
  File "C:\Python310\lib\site-packages\basicsr\models\sr_model.py", line 22, in __init__
    self.net_g = build_network(opt['network_g'])
  File "C:\Python310\lib\site-packages\basicsr\archs\__init__.py", line 22, in build_network
    net = ARCH_REGISTRY.get(network_type)(**opt)
  File "C:\Python310\lib\site-packages\basicsr\utils\registry.py", line 71, in get
    raise KeyError(f"No object named '{name}' found in '{self._name}' registry!")
KeyError: "No object named 'MDBN' found in 'arch' registry!"

basicsr.archs.vgg_arch

Hello, may I ask how to solve the problem "ModuleNotFoundError: No module named 'basicsr.archs.vgg_arch'".Thank you very much.

数据集

你好,请问数据集要怎么设置

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.