Code Monkey home page Code Monkey logo

i2v-gan's Introduction

I2V-GAN

This repository is the official Pytorch implementation for ACMMM2021 paper
"I2V-GAN: Unpaired Infrared-to-Visible Video Translation". [Arxiv] [ACM DL]

Traffic I2V Example:

Download a pretrained model from Baidu Netdisk [Access code: Traf] or Google drive.

compair_gif01

Monitoring I2V Example:

compair_gif02

Flower Translation Example:

compair_gif03

Introduction

Abstract

Human vision is often adversely affected by complex environmental factors, especially in night vision scenarios. Thus, infrared cameras are often leveraged to help enhance the visual effects via detecting infrared radiation in the surrounding environment, but the infrared videos are undesirable due to the lack of detailed semantic information. In such a case, an effective video-to-video translation method from the infrared domain to the visible counterpart is strongly needed by overcoming the intrinsic huge gap between infrared and visible fields.
Our work propose an infrared-to-visible (I2V) video translation method I2V-GAN to generate fine-grained and spatial-temporal consistent visible light video by given an unpaired infrared video.
The backbone network follows Cycle-GAN and Recycle-GAN.
compaire

Technically, our model capitalizes on three types of constraints: adversarial constraint to generate synthetic frame that is similar to the real one, cyclic consistency with the introduced perceptual loss for effective content conversion as well as style preservation, and similarity constraint across and within domains to enhance the content and motion consistency in both spatial and temporal spaces at a fine-grained level.

network-all

IRVI Dataset

Download from Baidu Netdisk [Access code: IRVI] or Google Drive.

data_samples

Data Structure

SUBSET TRAIN TEST TOTAL FRAME
Traffic 17000 1000 18000
Mornitoring sub-1 1384 347 1731 6352
sub-2 1040 260 1300
sub-3 1232 308 1540
sub-4 672 169 841
sub-5 752 188 940

Installation

The code is implemented with Python(3.6) and Pytorch(1.9.0) for CUDA Version 11.2

Install dependencies:
pip install -r requirements.txt

Usage

Train

python train.py --dataroot /path/to/dataset \
--display_env visdom_env_name --name exp_name \
--model i2vgan --which_model_netG resnet_6blocks \
--no_dropout --pool_size 0 \
--which_model_netP unet_128 --npf 8 --dataset_mode unaligned_triplet

Test

python test.py --dataroot /path/to/dataset \
--which_epoch latest --name exp_name --model cycle_gan \
--which_model_netG resnet_6blocks --which_model_netP unet_128 \
--dataset_mode unaligned --no_dropout --loadSize 256 --resize_or_crop crop

Citation

If you find our work useful in your research or publication, please cite our work:

@inproceedings{I2V-GAN2021,
  title     = {I2V-GAN: Unpaired Infrared-to-Visible Video Translation},
  author    = {Shuang Li and Bingfeng Han and Zhenjie Yu and Chi Harold Liu and Kai Chen and Shuigen Wang},
  booktitle = {ACMMM},
  year      = {2021}
}

Acknowledgements

This code borrows heavily from the PyTorch implementation of Cycle-GAN and Pix2Pix and RecycleGAN.
A huge thanks to them!

@inproceedings{CycleGAN2017,
  title     = {Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networkss},
  author    = {Zhu, Jun-Yan and Park, Taesung and Isola, Phillip and Efros, Alexei A},
  booktitle = {ICCV},
  year      = {2017}
}

@inproceedings{Recycle-GAN2018,
  title     = {Recycle-GAN: Unsupervised Video Retargeting},
  author    = {Aayush Bansal and Shugao Ma and Deva Ramanan and Yaser Sheikh},
  booktitle = {ECCV},
  year      = {2018}
}

i2v-gan's People

Contributors

bingfenghan avatar paperheart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

i2v-gan's Issues

测试有问题

你好,我使用下载的预训练模型,直接使用IRVI/single/traffic/testA 和IRVI/single/traffic/testB 两个文件夹下的数据进行测试,生成的结果中*_real_A.png明显和testA中是一样的,testB也是一样的。

下载的预训练模型放在I2V-GAN/checkpoints/experiment_name下,testA testB 放在I2V-GAN/img下 测试的命令如下:
python .\test.py --dataroot .\img\ --name experiment_name

我的问题是:

  1. 生成的结果中*_real_A.png是预测的结果,而*_real_B.png是参照图像,描述是否正确?
  2. 生成的结果为什么*_real_A.png和testA中是一样的,都是红外图,没有任何变化?

目前在研究这方面的算法,希望能得到你详细的解答,非常感谢!!!

CUDA error: out of memory

Hello! thanks for sharing your work. I followed the instructions for running the python train.py, but it has the following error.
image
Could you give me some suggestions? The dataroot I used is IRVI/triplet/traffic, and my GPU device is RTX3090.

测试结果有关的问题

000001_fake_A
000001_fake_B
000001_real_A
000001_real_B
000001_rec_A
000001_rec_B
抱歉,再次叨扰您。昨天我跑了测试的代码,我想问结果中的_fake_A, _fake_B, _rec_A, _rec_B分别代表什么意思呢?为什么没有红外影像变为可见光的结果呢?

Unable to Download IRVI Dataset

I'm trying to download the data from the provided link. It asked to install Baidu Net Disk which I installed but it also requires a Baidu account which I don't have. It seems like we can't open a Baidu account from outside China now. Is there other ways to download the data?

测试结果有问题

你好,我使用了预训练模型,直接进行测试我的数据,testA文件夹:测试集 testB文件夹:对应的ground truth,结果发现:

  1. 生成结果中 real_A.png和real_B.png分别和 testA testB文件夹内的数据一样
  2. 测试集为红外测试集,生成的结果 real_A.png仍然是红外,只是大小不同

问题如下:

  1. 结果是否是生成的real_A.png? 如果是,结果和输入没啥变化,换了提供的测试集也是这样的效果,原因是什么?

FID evaluation in IRVI benchmark

Hi, thanks for your great work! This is a good contribution. Could you please advise me on how you calculated the FID score for your benchmark?
Thank you!

求助

请问这个代码在运行时一直卡顿在这一步没有反应了是什么原因呢?
我是在windows,cpu环境下运行的。

IV2训练

IV2训练时数据集是要选择triplet是么?

关于生成样本评估

您好,非常感谢您的工作。
我现在在做可见光转红外的工作,但是不知道如何评估生成的红外图质量,我的测试集很小,100多张。
并且只有可见光图像,没有对应的红外gt图,想问下有没有什么方法可以评价生成的红外图是否好呢?
期待您的回答,感谢~

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.