cvg / LightGlue

LightGlue: Local Feature Matching at Light Speed (ICCV 2023)
Apache License 2.0
3.19k stars 296 forks source link

images in [assets] are used for matching, but getting 0 image matching correspondences #50

Open demonove opened 11 months ago

demonove commented 11 months ago

extractor = SuperPoint(max_num_keypoints=2048).eval().cuda() matcher = LightGlue(features='superpoint').eval().cuda()

image0 = load_image('path/assets/DSC_0410.jpg').cuda() image1 = load_image('path/assets/DSC_0411.jpg').cuda()

feats0 = extractor.extract(image0) feats1 = extractor.extract(image1)

matches01 = matcher({'image0': feats0, 'image1': feats1}) feats0, feats1, matches01 = [rbd(x) for x in [feats0, feats1, matches01]] kpts0 = feats0['keypoints'] kpts1 = feats1['keypoints'] print("kpts0 = ",kpts0.shape) print("kpts1 = ",kpts1.shape) matches = matches01['matches'] print("matches = ",matches.shape)

kpts0 = torch.Size([2048, 2]) kpts1 = torch.Size([2048, 2]) matches = torch.Size([0, 2])

demonove commented 11 months ago

emmm, maybe the code download from github is something different from git clone? when i use the .py in git clone the demo runs normal