17 from demo_superpoint
import SuperPointFrontend
19 torch.set_grad_enabled(
False)
28 device =
'cuda' if torch.cuda.is_available()
and cuda
else 'cpu' 32 superpoint = SuperPointFrontend(weights_path=
"superpoint_v1.pth",
41 image = np.asarray(imageBuffer)
42 image = (image.astype(
'float32') / 255.)
45 pts, desc, heatmap = superpoint.run(image)
48 pts = np.float32(np.transpose(pts)).copy()
49 desc = np.float32(np.transpose(desc)).copy()
53 if __name__ ==
'__main__':
56 detect(np.random.rand(640,480)*255)