Official implementation of "SinIR: Efficient General Image Manipulation with Single Image Reconstruction" (ICML 2021)

Related tags

Deep LearningSinIR
Overview

SinIR (Official Implementation)

Requirements

To install requirements:

pip install -r requirements.txt

We used Python 3.7.4 and f-strings which are introduced in python 3.6+

Training

To train a model, write a proper yaml config file in 'config_train' folder (sample yaml files provided in the config_train folder), and run this command:

python train.py <gpu_num> -y <yaml_file_in_'config_train'_folder>

For example, if you want to train a model with config_train/photo.yaml on gpu 0, run:

python train.py 0 -y photo

This will output a trained model, training logs, training output images and so on, to a subdirectory of 'outs' folder with proper naming and numbering which are used for inference.

Note that even though we provide one yaml file for each task, they can be used interchangeably, except few tasks.

You can copy and modify them depending on your purpose. Detailed explanation about configuration is written in the sample yaml files. Please read through it carefully if you need.

Inference

To carry out inference (i.e., image manipulation), you can specify inference yaml files in training yaml files. Please see provided sample training yaml files.

Or alternatively you can run this command:

python infer.py <output_dirnum> <gpu_num> -y <yaml_file_in_config_folder>

For example, if you want to carry out inference with a trained model numbered 002, with config_infer/photo_infer.yaml on gpu 0, run:

python infer.py 2 0 -y photo_infer

Then it will automatically find an output folder numbered 002 and conduct image manipulation, saving related results in the subdirectory.

Note that duplicated numbering (which can be avoided with a normal usage) will incur error. In this case, please keep only one output folder.

We also provide sample yaml files for inference which are paired with yaml files for training. Feel free to copy and modify depending on your purpose.

Acknowledgement

This repository includes images from:

  1. https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/bsds/ (BSD dataset)
  2. https://github.com/luanfujun/deep-painterly-harmonization/ (https://arxiv.org/abs/1804.03189)
  3. https://github.com/luanfujun/deep-photo-styletransfer (https://arxiv.org/abs/1703.07511)
  4. The Web (free images)

This repository includes codes snippets from:

  1. SSIM: https://github.com/VainF/pytorch-msssim
  2. Anti-aliasing + Bicubic resampling: https://github.com/thstkdgus35/bicubic_pytorch
  3. dilated mask: https://github.com/tamarott/SinGAN
Image to Image translation, image generataton, few shot learning

Semi-supervised Learning for Few-shot Image-to-Image Translation [paper] Abstract: In the last few years, unpaired image-to-image translation has witn

yaxingwang 49 Nov 18, 2022
Package for working with hypernetworks in PyTorch.

Package for working with hypernetworks in PyTorch.

Christian Henning 71 Jan 05, 2023
Bu repo SAHI uygulamasını mantığını öğreniyoruz.

SAHI-Learn: SAHI'den Beraber Kodlamak İster Misiniz Herkese merhabalar ben Kadir Nar. SAHI kütüphanesine gönüllü geliştiriciyim. Bu repo SAHI kütüphan

Kadir Nar 11 Aug 22, 2022
A Library for Modelling Probabilistic Hierarchical Graphical Models in PyTorch

A Library for Modelling Probabilistic Hierarchical Graphical Models in PyTorch

Korbinian Pöppel 47 Nov 28, 2022
bio_inspired_min_nets_improve_the_performance_and_robustness_of_deep_networks

Code Submission for: Bio-inspired Min-Nets Improve the Performance and Robustness of Deep Networks Run with docker To build a docker environment, chan

0 Dec 09, 2021
Urban mobility simulations with Python3, RLlib (Deep Reinforcement Learning) and Mesa (Agent-based modeling)

Deep Reinforcement Learning for Smart Cities Documentation RLlib: https://docs.ray.io/en/master/rllib.html Mesa: https://mesa.readthedocs.io/en/stable

1 May 15, 2022
Landmarks Recogntion Web application using Streamlit.

Landmark Recognition Web-App using Streamlit Watch Tutorial for this project Source Trained model landmarks_classifier_asia_V1/1 is taken from the Ten

Kushal Bhavsar 5 Dec 12, 2022
Code for the paper "Unsupervised Contrastive Learning of Sound Event Representations", ICASSP 2021.

Unsupervised Contrastive Learning of Sound Event Representations This repository contains the code for the following paper. If you use this code or pa

Eduardo Fonseca 81 Dec 22, 2022
Parameter-ensemble-differential-evolution - Shows how to do parameter ensembling using differential evolution.

Ensembling parameters with differential evolution This repository shows how to ensemble parameters of two trained neural networks using differential e

Sayak Paul 9 May 04, 2022
Official implementation of Rethinking Graph Neural Architecture Search from Message-passing (CVPR2021)

Rethinking Graph Neural Architecture Search from Message-passing Intro The GNAS can automatically learn better architecture with the optimal depth of

Shaofei Cai 48 Sep 30, 2022
Denoising Diffusion Implicit Models

Denoising Diffusion Implicit Models (DDIM) Jiaming Song, Chenlin Meng and Stefano Ermon, Stanford Implements sampling from an implicit model that is t

465 Jan 05, 2023
AutoDeeplab / auto-deeplab / AutoML for semantic segmentation, implemented in Pytorch

AutoML for Image Semantic Segmentation Currently this repo contains the only working open-source implementation of Auto-Deeplab which, by the way out-

AI Necromancer 299 Dec 17, 2022
DAN: Unfolding the Alternating Optimization for Blind Super Resolution

DAN-Basd-on-Openmmlab DAN: Unfolding the Alternating Optimization for Blind Super Resolution We reproduce DAN via mmediting based on open-sourced code

AlexZou 72 Dec 13, 2022
Conceptual 12M is a dataset containing (image-URL, caption) pairs collected for vision-and-language pre-training.

Conceptual 12M We introduce the Conceptual 12M (CC12M), a dataset with ~12 million image-text pairs meant to be used for vision-and-language pre-train

Google Research Datasets 226 Dec 07, 2022
Create UIs for prototyping your machine learning model in 3 minutes

Note: We just launched Hosted, where anyone can upload their interface for permanent hosting. Check it out! Welcome to Gradio Quickly create customiza

Gradio 11.7k Jan 07, 2023
Implementation of the method described in the Speech Resynthesis from Discrete Disentangled Self-Supervised Representations.

Speech Resynthesis from Discrete Disentangled Self-Supervised Representations Implementation of the method described in the Speech Resynthesis from Di

4 Mar 11, 2022
This repository will be a summary and outlook on all our open, medical, AI advancements.

medical by LAION This repository will be a summary and outlook on all our open, medical, AI advancements. See the medical-general channel in the medic

LAION AI 18 Dec 30, 2022
Syntax-Aware Action Targeting for Video Captioning

Syntax-Aware Action Targeting for Video Captioning Code for SAAT from "Syntax-Aware Action Targeting for Video Captioning" (Accepted to CVPR 2020). Th

59 Oct 13, 2022
This repository contains the scripts for downloading and validating scripts for the documents

HC4: HLTCOE CLIR Common-Crawl Collection This repository contains the scripts for downloading and validating scripts for the documents. Document ids,

JHU Human Language Technology Center of Excellence 6 Jun 07, 2022
MIMO-UNet - Official Pytorch Implementation

MIMO-UNet - Official Pytorch Implementation This repository provides the official PyTorch implementation of the following paper: Rethinking Coarse-to-

Sungjin Cho 248 Jan 02, 2023