question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Occupancy masks for geometric transforms

See original GitHub issue

Consideer an equivariance loss scenario: we have a source image src, we get view1 = k1(src); view2 = k2(src). Now we’d like to put on some loss on corresponding locations in view1 and view2.

For most of geometric augmentations, not all pixel locations in view1 would have correspondences in view2, and loss must be computed only for valid locations, i.e. we should not compute loss for black pixels in rotated images in https://github.com/kornia/kornia-examples/blob/master/data_augmenation_segmentation.ipynb

In this notebook is advised to use k1(img, k1._params) for repeating the sampled transformation on another input. Is there an easy way of performing an inverse transform given _params?

I think the correct expression for mask of valid locations in view is given by mask_valid_1 = k1(k2(k2(ones_like(src), k2._params), k2._params, INVERSE = True), k1._params), but one needs an easy way of doing an inverse transform.

(related https://github.com/kornia/kornia/issues/476#issuecomment-833147695)

As a workaround, I’m not manually using return_transform, and doing warp_affine with inverse transforms

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
edgarribacommented, May 6, 2021

absolutely - adding a return_inverse flag could be definitely quite neat. /cc @ducha-aiki @shijianjian @lferraz thoughts ?

0reactions
edgarribacommented, May 31, 2021

merged in #1013

Read more comments on GitHub >

github_iconTop Results From Across the Web

[QUESTION] Image segmentation mask transform #476 - GitHub
I am doing image segmentation and using random transforms. How do I get the image and mask to have the same transform done...
Read more >
3D Change Detection by Geometric Transformation Consistency
Mask -RCNN is a powerful method for 2D object detection. We deploy the 2D object detector, trained on the COCO dataset [22], on...
Read more >
Optimum design of chamfer masks using symmetric mean ...
The process may be implemented using chamfer-based sequential algorithms that apply small-neighborhood masks to estimate the Euclidean metric.
Read more >
Mask Field dynamics node - SideFX
The Mask Field DOP use a scalar field, vector field, or point cloud to define a three dimensional mask. The mask can be...
Read more >
Occupancy Flow: 4D Reconstruction by Learning Particle ...
Recently, our group proposed a new output representation for learning-based 3D reconstruction, called Occupancy Networks where geometry is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found