Update README.md
Browse files
README.md
CHANGED
@@ -81,10 +81,10 @@ import torch
|
|
81 |
from PIL import Image
|
82 |
import requests
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
images = [im1, im2]
|
89 |
|
90 |
processor = AutoImageProcessor.from_pretrained("stevenbucaille/superglue_indoor")
|
@@ -103,10 +103,10 @@ import torch
|
|
103 |
from PIL import Image
|
104 |
import requests
|
105 |
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
|
111 |
images = [image_1, image_2]
|
112 |
|
@@ -132,7 +132,7 @@ image1_matching_scores = outputs.matching_scores[0, 1][image1_indices]
|
|
132 |
|
133 |
You can use the `post_process_keypoint_matching` method from the `SuperGlueImageProcessor` to get the keypoints and matches in a more readable format:
|
134 |
```python
|
135 |
-
image_sizes = [(image.height, image.width) for image in images]
|
136 |
outputs = processor.post_process_keypoint_matching(outputs, image_sizes)
|
137 |
for i, output in enumerate(outputs):
|
138 |
print("For the image pair", i)
|
@@ -182,7 +182,7 @@ plt.savefig("matched_image.png", dpi=300, bbox_inches='tight')
|
|
182 |
plt.close()
|
183 |
```
|
184 |
|
185 |
-
.raw)
|
86 |
+
url_image2 = "https://github.com/magicleap/SuperGluePretrainedNetwork/blob/master/assets/scannet_sample_images/scene0758_00_frame-000165.jpg?raw=true"
|
87 |
+
image2 = Image.open(requests.get(url_image2, stream=True).raw)
|
88 |
images = [im1, im2]
|
89 |
|
90 |
processor = AutoImageProcessor.from_pretrained("stevenbucaille/superglue_indoor")
|
|
|
103 |
from PIL import Image
|
104 |
import requests
|
105 |
|
106 |
+
url_image1 = "https://github.com/magicleap/SuperGluePretrainedNetwork/blob/master/assets/scannet_sample_images/scene0758_00_frame-000510.jpg?raw=true"
|
107 |
+
image1 = Image.open(requests.get(url_image1, stream=True).raw)
|
108 |
+
url_image2 = "https://github.com/magicleap/SuperGluePretrainedNetwork/blob/master/assets/scannet_sample_images/scene0758_00_frame-000165.jpg?raw=true"
|
109 |
+
image2 = Image.open(requests.get(url_image2, stream=True).raw)
|
110 |
|
111 |
images = [image_1, image_2]
|
112 |
|
|
|
132 |
|
133 |
You can use the `post_process_keypoint_matching` method from the `SuperGlueImageProcessor` to get the keypoints and matches in a more readable format:
|
134 |
```python
|
135 |
+
image_sizes = [[(image.height, image.width) for image in images]]
|
136 |
outputs = processor.post_process_keypoint_matching(outputs, image_sizes)
|
137 |
for i, output in enumerate(outputs):
|
138 |
print("For the image pair", i)
|
|
|
182 |
plt.close()
|
183 |
```
|
184 |
|
185 |
+

|
186 |
|
187 |
## Training Details
|
188 |
|