zju3dv / pats

Code for "PATS: Patch Area Transportation with Subdivision for Local Feature Matching", CVPR 2023
Other
90 stars 7 forks source link

speed and memory #13

Open egbertYeah opened 2 months ago

egbertYeah commented 2 months ago

my inference size is 640 x 480, tested in 3090, when i set if_local as False, the pipe time is 1.22s, memory costing is large to 22G. however, when setting if_local to True, the pipe time is 2s, memeoy costing is 5.4G. https://github.com/zju3dv/pats/blob/98d2e03a80acb4cc94724117db41c17e09268d79/configs/test_demo.yaml#L9

the result is so difference, Any suggestions for solving this problem?

xuanlanxingkongxia commented 2 months ago

The "if_local" choice try to pre-decide the matched pairs from multiple possible ones, and reduce the space cost. It just can provide a trade-off beween time and space.

xuanlanxingkongxia commented 2 months ago

But our pre-decision algorithm here is not efficient enough and seems to crop some of useful pairs incorrectly, maybe you can write a more efficient one?

egbertYeah commented 2 months ago

I have some problems with the code implementation. Could you please explain roughly what these functions do? Thanks.

https://github.com/zju3dv/pats/blob/98d2e03a80acb4cc94724117db41c17e09268d79/models/first_layer.py#L122

https://github.com/zju3dv/pats/blob/98d2e03a80acb4cc94724117db41c17e09268d79/models/first_layer.py#L135

https://github.com/zju3dv/pats/blob/98d2e03a80acb4cc94724117db41c17e09268d79/models/first_layer.py#L140