GithubHelp home page GithubHelp logo

svnit_ntnu_sisr's Introduction

How to test the baseline model?

  1. git clone https://github.com/zhengchen1999/NTIRE2023_ImageSR_x4.git
  2. Select the model you would like to test from run.sh
    CUDA_VISIBLE_DEVICES=0 python test_demo.py --data_dir [path to your data dir] --save_dir [path to your save dir] --model_id 0
    • Be sure the change the directories --data_dir and --save_dir.
    • We provide three baselines (team00): RFDN (default), SwinIR, and CAT. The code and pretrained models of the three models are provided. Three baselines are all test normally with run.sh.

How to add your model to this baseline?

  1. Register your team in the Google Spreadsheet and get your team ID.
  2. Put your the code of your model in ./models/[Your_Team_ID]_[Your_Model_Name].py
    • Please add only one file in the folder ./models. Please do not add other submodules.
    • Please zero pad [Your_Team_ID] into two digits: e.g. 00, 01, 02
  3. Put the pretrained model in ./model_zoo/[Your_Team_ID]_[Your_Model_Name].[pth or pt or ckpt]
    • Please zero pad [Your_Team_ID] into two digits: e.g. 00, 01, 02
    • Note: Please provide a download link for the pretrained model, if the file size exceeds 100 MB. Put the link in ./model_zoo/[Your_Team_ID]_[Your_Model_Name].txt: e.g. team00_cat.txt
  4. Add your model to the model loader ./test_demo/select_model as follows:
        elif model_id == [Your_Team_ID]:
            # define your model and load the checkpoint
    • Note: Please set the correct data_range, either 255.0 or 1.0
  5. Send us the command to download your code, e.g,
    • git clone [Your repository link]
    • We will do the following steps to add your code and model checkpoint to the repository.

How to calculate the number of parameters, FLOPs, and activations

    from utils.model_summary import get_model_flops, get_model_activation
    from models.team00_RFDN import RFDN
    model = RFDN()
    
    input_dim = (3, 256, 256)  # set the input dimension
    activations, num_conv = get_model_activation(model, input_dim)
    activations = activations / 10 ** 6
    print("{:>16s} : {:<.4f} [M]".format("#Activations", activations))
    print("{:>16s} : {:<d}".format("#Conv2d", num_conv))

    flops = get_model_flops(model, input_dim, False)
    flops = flops / 10 ** 9
    print("{:>16s} : {:<.4f} [G]".format("FLOPs", flops))

    num_parameters = sum(map(lambda x: x.numel(), model.parameters()))
    num_parameters = num_parameters / 10 ** 6
    print("{:>16s} : {:<.4f} [M]".format("#Params", num_parameters))

License and Acknowledgement

This code repository is release under MIT License.

svnit_ntnu_sisr's People

Contributors

zhengchen1999 avatar yulunzhang avatar

Watchers

Pragnesh Barik avatar

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.