Open demonove opened 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])
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
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])