Code Monkey home page Code Monkey logo

deeprectangling's Introduction

Deep Rectangling for Image stitching: A Learning Baseline (paper)

Lang Nie1, Chunyu Lin1 *, Kang Liao1, Shuaicheng Liu2, Yao Zhao1

1Institute of Information Science, Beijing Jiaotong University

2School of Information and Communication Engineering, University of Electronic Science and Technology of China

{nielang, cylin, kang_liao, yzhao}@bjtu.edu.cn, [email protected]

Dataset (DIR-D)

The details of the dataset can be found in our paper.

We release our testing results with the proposed dataset together. One can download it at Google Drive or Baidu Cloud(Extraction code: 1234).

Requirement

  • python 3.6
  • numpy 1.18.1
  • tensorflow 1.13.1

If you encounter some problems about the tensorflow environment, please refer to this issue.

For windows system

For windows OS users, you have to change '/' to '\\' in 'line 52 of Codes/utils.py'.

Training

Step 1: Download the pretrained vgg19 model

Download VGG-19. Search imagenet-vgg-verydeep-19 in this page and download imagenet-vgg-verydeep-19.mat.

Step 2: Train the network

Modify the 'Codes/constant.py' to set the 'TRAIN_FOLDER'/'ITERATIONS'/'GPU'. In our experiment, we set 'ITERATIONS' to 100,000.

cd Codes/
python train.py

Testing

Pretrained model for deep rectangling

Our pretrained rectangling model can be available at Google Drive or Baidu Cloud(Extraction code: 1234). And place the four files to 'Codes/checkpoints/Ptrained_model/' folder.

Testing

Modidy the 'Codes/constant.py'to set the 'TEST_FOLDER'/'GPU'. The path for the checkpoint file can be modified in 'Codes/inference.py'.

cd Codes/
python inference.py

Testing with arbitrary resolution images

Modidy the 'Codes_for_Arbitrary_Resolution/constant.py'to set the 'TEST_FOLDER'/'GPU'. The path for the checkpoint file can be modified in 'Codes_for_Arbitrary_Resolution/inference.py'. Then, put the testing images into the folder 'Codes_for_Arbitrary_Resolution/other_dataset/' (including input and mask) and run:

cd Codes_for_Arbitrary_Resolution/
python inference.py

The rectangling results can be found in Codes_for_Arbitrary_Resolution/rectangling/.

Citation

This paper has been accepted by CVPR2022 as oral presentation. If you have any questions, please feel free to contact me.

NIE Lang -- [email protected]

@inproceedings{nie2022deep,
  title={Deep Rectangling for Image Stitching: A Learning Baseline},
  author={Nie, Lang and Lin, Chunyu and Liao, Kang and Liu, Shuaicheng and Zhao, Yao},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={5740--5748},
  year={2022}
}

Reference

  1. Lang Nie, Chunyu Lin, Kang Liao, Shuaicheng Liu, and Yao Zhao. Depth-aware multi-grid deep homography estimation with contextual correlation. IEEE Trans. on Circuits and Systems for Video Technology, 2021.

  2. Kaiming He, Huiwen Chang, Jian Sun. Rectangling panoramic images via warping. SIGGRAPH, 2013.

deeprectangling's People

Contributors

nie-lang 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  avatar  avatar

deeprectangling's Issues

Mistakes in the paper

I read your paper 'Deep Rectangling for Image Stitching: A Learning Baseline'. In the Experiments section, you used the No-reference blind image quality metric BIQUE, I cannot found any metric call BIQUE.

So I read the reference paper '[29] Blind image quality evaluation using perception based features.' and found it is Perception-based Image QUality Evaluator (PIQUE).

I guess you wrote the metric wrong in your paper.

How can i get mask image?

I have Stitched Image using UnsupervisedDeepImageStitching in your github.

But I don't have mask image.

Should I simply OR calculate the mask1 result and mask2 result?

I'm getting a lot of help. Thank You.

Colab version

Is there a Jupyter notebook or Colab file for the training stage?
I've tried implementing the project through Colab, and it seems the dependencies can not be satisfied
due to Colab's environmental limitations

您好,我想请教一些问题

作者您好,我是一名小白,在运行您提供的源码时,遇到了些问题,望得到您的回复。我用您提供的预训练模型跑inference.py的程序时,加载预训练模型,权重之后,遇到了IndexError: list index out of range,在不知道您是否也遇到过相同的问题?
感谢您百忙之中能够回复我的留言!

VGG model download

Excuse me, would you mind providing imagenet-vgg-verydeep-19.mat in Baidu Cloud, I have been downloaded this model in the page but the speed is two slow. Thank you !

iteration相關問題

你好,想詢問為何iteration數是自行設定的,而不是根據input data的數量及batch size的大小來得到有多少個iteration;另外也想詢問為何在train.py沒有看到設定epoch的值

怎么制作自己的数据集

我看了DIR-D的数据结构

但是还是不了解
怎么样把我的数据 转换为 DIR-D的数据结构

比如gt原图

input
mask
是怎么生成的

Training Error

当我使用DIR-D训练时,出现以下错误:
Traceback (most recent call last):
File "train.py", line 81, in
train_data_dataset = train_data_loader(batch_size=batch_size)
File "/home/zhangao/MVS/Image-Stitching/DeepRectangling/Codes/utils.py", line 22, in call
length = data_info_list[0]['length']
IndexError: list index out of range

questions about masks

I'd like to ask the boundary term of objective function. the paper said that you want to constrain the warped mask close to an all-one matrix E, I am wondering why and what it means, thank you!

ground truth and mesh

你好
如果我以自己拍攝的兩張照片經由UnsupervisedDeepImageStitching完成拼接後,想藉由此份代碼來解決不規則邊界問題,輸入只有拼接完的圖,但缺少了gt 及mesh,這問題應該如何去解決

模型使用问题

您好!请问您所训练的模型具体是怎样使用的呢?能否公布具体的应用代码呢?在此不胜感激!

关于环境配置的一个疑问

您好,非常棒的一个工作!
我在配置环境的时候关于python的版本有个疑问,environment.yaml下python似乎是3.5.6,然而python不应是3.6吗?

Good Work! But how to do model selection without validation set?

A good work!

I have checked your dataset, and I did not find the validation set. And I also noticed in your code you have adopted the full training set for training. So, how can I do model selection without the explicit validation set? Or, how you determine your pretrained model in your training phase?

Test时提示访问列表中不存在的要素

您好,运行test时提示下面报错,数据有的,请问这是什么问题呢?感谢
Traceback (most recent call last):
File "E:\Project\DeepRectangling-main\DeepRectangling-main\Codes_for_Arbitrary_Resolution\inference.py", line 91, in
inference_func(snapshot_dir)
File "E:\Project\DeepRectangling-main\DeepRectangling-main\Codes_for_Arbitrary_Resolution\inference.py", line 75, in inference_func
input_clip = np.expand_dims(input_loader.get_data_clips(i), axis=0)
File "E:\Project\DeepRectangling-main\DeepRectangling-main\Codes_for_Arbitrary_Resolution\utils.py", line 35, in get_data_clips
batch.append(np_load_frame(data_info_list[0]['frame'][index]))
IndexError: list index out of range

test测试集上的可视化效果差的问题

您好!

我按照你的步骤,下载好了您预训练好的模型,运行您的inference.py脚本,但是发现在您的519张测试集上的rectangling效果很差,无论是从生成的可视化结果来看,还是从量化指标来看。
请问这是为什么呢?

如下是量化指标,average ssim只有0.3.
===================Results Analysis==================
average psnr: 9.62835509107355
average ssim: 0.31329677570284625

NAN results after running train.py

Hi there,

I am trying to create my own model by running train.py file, but I get nan values for Global Loss, mask Loss and mesh Loss. If I let the program finish its work, I get real bad model, that if I run inference.py on it, I get the following results for both running on GPU and CPU:

PSNR: 10.4..
SSIM: 0.32..

I have tried changing the learning rate to a lower value but it still did not work for me, what could be the problem?

In addition, when running inference.py on the CPU I get decent results:

PSNR: something like 21
SSIM: 0.709..

But when I run the code on GPU I get terrible results, something like 10 and 0.3. Am I supposed to run the train.py on GPU and the inference on CPU? It is confusing because the GPU runs much faster but it delivers bad accuracy.

Predefined target mesh相关

您好,在阅读完您的论文后我有一个关于Predefined target mesh的问题。我好奇在您的一阶段的方法中,Predefined target mesh是如何预定义的,是直接从原图(ground truth)进行网格划分的吗?还是通过优化约束项生成的?一开始我以为是从initial mesh中warp过来的呢,但是后面紧接着initial mesh和predefined mesh又进行了warp,所以我排除了这个想法。
此外,论文的效果很好,只有此处不甚理解,希望您能解答我的问题!

Questions about Inference

First of all, thank you for your fantastic work!

There are some questions I would like to ask you while executing your code.

How did you get the binary mask of the stitched image in the test process that you marked as an 'inference' step on the code? In this study, I understood well how you constructed the training dataset.

So, when performing 'cross-dataset evaluation' in the paper, did you perform ELA-based stitching, convert the resulting image into a square shape through the Kaiming He et al.'s method, and convert the all-one matrix using the inverse of the transformation matrix to obtain a binary mask of inference input?

According to the Q&A of issues #9 and #12, apart from the method of constructing the training dataset, did the inference process use UDIS-based stitching image and its binary mask because the main contribution in this study is to Rectangling an image that has already been stitched. Am I right?

The method, of converting ELA-based stitching -> He's Rectangling -> warp all-one matrix to obtain the same form of a binary mask as the stitching result is very burdensome and impractical. So I also think you would of course have chosen the latter rather than the former, but this is not stated, so I'm asking you directly.

Thank you!

矩阵化后变形问题

您好,请问有些图片矩阵化之后,图片里面有些物体会产生形变,这有啥解决方法不?

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.