3DOM-FBK / deep-image-matching

Multiview matching with deep-learning and hand-crafted local features for COLMAP and other SfM software. Supports high-resolution formats and images with rotations. Both CLI and GUI are supported.
https://3dom-fbk.github.io/deep-image-matching/
BSD 3-Clause "New" or "Revised" License
349 stars 41 forks source link

It Seems Something's Wrong with the GPU Usage of the Matcher #83

Open 3942368 opened 1 week ago

3942368 commented 1 week ago

I experimented with superpoint + lightglue and aliked + lightglue.

The GPU on my local machine is a 1060 6GB, and the cloud environment on lightning.ai is using an L4 GPU.

On my local machine, the matcher speed is around 1.56 it/s, but in the cloud, it only reaches 3.52 it/s. I tested with around 600 images at a resolution of 1280x720. The command I used for testing was: -p aliked+lightglue --skip_reconstruction -s sequential --overlap 30 It seems like the matchers aren’t utilizing the GPU properly. Isn't this speed an issue?

this is local gpu speed(1060 6G) image this is cloud gpu(L4) image

image

lcmrl commented 1 week ago

Hi, thanks for reporting, could you check inside the conda environment prepared for DIM if cuda is really available?

> python
> import torch
> torch.cuda.is_available()
3942368 commented 1 week ago

image here you are

3942368 commented 1 week ago

Hi, thanks for reporting, could you check inside the conda environment prepared for DIM if cuda is really available?

> python
> import torch
> torch.cuda.is_available()

image image This is the result from running on the Colab environment set up on your side. It was a T4 GPU with the aliked+lightglue configuration. Of course, PyTorch is properly applied (since it's your Colab code). However, the speed in matching is only 1.27s/it. It seems like the GPU is not being fully utilized.

lcmrl commented 2 days ago

Hi, thanks for reporting. Did you solve the issue? A solution to significantly decrease the matching time is to use GeometricVerification.MAGSAC instead of GeometricVerification.PYDEGENSAC that is much slower