PruneTruong / DenseMatching

Dense matching library based on PyTorch
GNU Lesser General Public License v2.1
689 stars 81 forks source link

Some questions about the warped image #9

Closed Nianzhen-GU closed 3 years ago

Nianzhen-GU commented 3 years ago
  1. Is it possible to only get the warped image rather than several images bond together?
  2. Is the information of the warped image, say resolution, completely comes from the query image? I mean the reference image doesn't contribute any additional information to the final result.
PruneTruong commented 3 years ago

Hi,

  1. Sure, i updated the test_models.py file so you can add option --save_ind_images True, which will retrieve original images and warped images. You can remove the lines about the reference and query there if you don't want them. You could also save the confident mask if you want.
  2. the resolution of the warped image completely comes from the reference image. You are estimating a flow from every single pixel of the reference towards the query. This flow is subsequently used to warp the query. If you resize the reference (not the query, then it would require some scaling), you could however resize the flow like you would resize the reference image.
Nianzhen-GU commented 3 years ago

I'm sorry, I didn't find "--save_ind_images" in test_models.py.

PruneTruong commented 3 years ago

Ah my bad, I forgot to push and only committed. It's there now

Nianzhen-GU commented 3 years ago

I set --save_ind_images = True and it works. However, I still want the mask exists, what should I do?

PruneTruong commented 3 years ago

You can also save the confidence_map or confident_mask depending what you want, just like the warped image is saved.