Comments (5)
uploading two images I used for testing
from glue-factory.
Can you share the code that yields the first results? Here's what I get with your images and SuperPoint-Open:
import torch
from gluefactory.utils.image import ImagePreprocessor
from gluefactory.visualization.viz2d import plot_images, plot_keypoints, plot_matches
from gluefactory.models.extractors.superpoint_open import SuperPoint
from gluefactory.models.matchers.nearest_neighbor_matcher import NearestNeighborMatcher
improc = ImagePreprocessor({'resize': 1024})
im0 = improc.load_image('test_data/receipt1.jpg')['image']
im1 = improc.load_image('test_data/receipt2.jpg')['image']
sp = SuperPoint({'nms_radius': 4}).cuda().eval()
with torch.no_grad():
pred0 = sp({'image': im0.cuda()[None]})
pred1 = sp({'image': im1.cuda()[None]})
pts0, pts1 = [p['keypoints'].squeeze(0).cpu() for p in (pred0, pred1)]
plot_images([im.permute(1,2,0) for im in (im0, im1)],
titles=[f'{len(p)} keypoints' for p in (pts0, pts1)])
plot_keypoints([pts0, pts1])
matcher = NearestNeighborMatcher({"distance_thresh": 0.5})
matches = matcher({'descriptors0': pred0['descriptors'], 'descriptors1': pred1['descriptors']})['matches0'].squeeze(0)
plot_images([im.permute(1,2,0) for im in (im0, im1)])
plot_matches(pts0[matches.cpu()!=-1], pts1[matches[matches!=-1].cpu()], a=0.5, lw=1)
from glue-factory.
Thanks for trying!
I just ran your code snippet on my end, it seems SuperPoint-Open generates different results with two versions of torch: 2.0.1 and 2.1.0. The difference might be because of some changes implemented in the new PyTorch, which was just relased couple days ago. So for now, I will use torch 2.0.1 for workaround.
import torch
print(torch.__version__)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
from gluefactory.utils.image import ImagePreprocessor
from gluefactory.models.extractors.superpoint_open import SuperPoint
from gluefactory.visualization.viz2d import plot_images, plot_keypoints, plot_matches
improc = ImagePreprocessor({'resize': 1024})
im0 = improc.load_image('../../test_images/01.jpeg')['image']
im1 = improc.load_image('../../test_images/02.jpeg')['image']
sp = SuperPoint({'nms_radius': 4}).cuda().eval()
with torch.no_grad():
pred0 = sp({'image': im0.cuda()[None]})
pred1 = sp({'image': im1.cuda()[None]})
pts0, pts1 = [p['keypoints'].squeeze(0).cpu() for p in (pred0, pred1)]
plot_images([im.permute(1,2,0) for im in (im0, im1)],
titles=[f'{len(p)} keypoints' for p in (pts0, pts1)])
plot_keypoints([pts0, pts1])
from glue-factory.
I obtain the exact same results with torch 2.1.0+cu121
, 2.0.1+cu117
, and 2.0.0+cu117
.
from glue-factory.
Okay, thank you for checking. I will test again with a clean environment here as well. Close this issue for the time being.
from glue-factory.
Related Issues (20)
- Questions about SIFT+LightGlue HOT 1
- Mismatched model shape upon MegaDepth finetuning HOT 2
- Why duplicating the log_assignment calculation? HOT 1
- question about homography transformations HOT 2
- Could you please provide some checksum for the dataset?
- what is the approximate training time for each stages? HOT 1
- stuck at the "Creating dataset ImagePairs" when evaluate lightglue on megadepth HOT 1
- How to train lightglue with my extractor? HOT 2
- train => disk +lg HOT 1
- pycolmap error HOT 1
- DeDoDe HOT 1
- memory not release
- mixed precision training
- Error:_pickle.UnpicklingError: invalid load key, '\x0a'.
- what is add_scale_ori and how to use it?
- gluestick training time HOT 3
- simpler GT line matching HOT 1
- the two places name the gamma differently?
- Performance
- The Required Datasets for Training.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glue-factory.