Instructions to use ETH-CVG/lightglue_superpoint with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ETH-CVG/lightglue_superpoint with Transformers:
# Load model directly from transformers import AutoImageProcessor, AutoModelForKeypointMatching processor = AutoImageProcessor.from_pretrained("ETH-CVG/lightglue_superpoint") model = AutoModelForKeypointMatching.from_pretrained("ETH-CVG/lightglue_superpoint") - Notebooks
- Google Colab
- Kaggle
Threshold Explanation
image_sizes = [[(image.height, image.width) for image in images]]
outputs = processor.post_process_keypoint_matching(outputs, image_sizes, threshold=0.2)
for i, output in enumerate(outputs):
print("For the image pair", i)
for keypoint0, keypoint1, matching_score in zip(
output["keypoints0"], output["keypoints1"], output["matching_scores"]
):
print(
f"Keypoint at coordinate {keypoint0.numpy()} in the first image matches with keypoint at coordinate {keypoint1.numpy()} in the second image with a score of {matching_score}."
)
In this code can you explain what does the threshold do? and what is the range of threshold?
Hi @sultanhaseeb05 , thanks for your interest in LightGlue.
The treshold is a filtering value on the matching score of keypoints, it ranges between 0 and 1