Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: inference takes long time #5

Open
lyp-deeplearning opened this issue May 24, 2024 · 2 comments
Open

Question: inference takes long time #5

lyp-deeplearning opened this issue May 24, 2024 · 2 comments

Comments

@lyp-deeplearning
Copy link

Thank you for providing the source code for this interesting work. However, I have a question regarding the inference time. On my device ( RTX 3090 (24GB)), a single inference takes 2.92 seconds (average of 100 runs), whereas the paper reports that it can achieve about 50 fps. I look forward to your response.

@hwjiang1510
Copy link
Collaborator

The released code is based on tensorflow without using any efficient transformer implementation. The reported number is based on a re-implementation using pytorch glue-factory.

@arjunkarpur
Copy link
Collaborator

@lyp-deeplearning one other thing to mention:

The TF models should take advantage of the GPU automatically, but the PyTorch DINOv2 code needs some modifications to dino_extract.py:

  • Line 38: after this line, add a call self.model.cuda() to send the model to GPU mem
  • Line 113: replace with: out = self.model.get_intermediate_layers(image.cuda(), n=self.feature_layer)[0] - i.e., send image to GPU mem with a .cuda() call

After this, hopefully all models are run on GPU and you should see some inference latency improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants