lixi042
commited on
Commit
·
cce956c
1
Parent(s):
fde86f9
update
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ def find_matches(image_0, image_1, conf_thres=0.2, border_rm=2, topk=10000):
|
|
| 45 |
|
| 46 |
_config = lower_config(config)
|
| 47 |
matcher = EDM(config=_config["edm"])
|
| 48 |
-
state_dict = torch.load("weights/edm_outdoor.ckpt")["state_dict"]
|
| 49 |
matcher.load_state_dict(state_dict)
|
| 50 |
matcher = matcher.eval()
|
| 51 |
|
|
@@ -76,9 +76,9 @@ def find_matches(image_0, image_1, conf_thres=0.2, border_rm=2, topk=10000):
|
|
| 76 |
with torch.no_grad():
|
| 77 |
matcher(batch)
|
| 78 |
|
| 79 |
-
mkpts0 = batch['mkpts0_f'].
|
| 80 |
-
mkpts1 = batch['mkpts1_f'].
|
| 81 |
-
mconf = batch['mconf'].
|
| 82 |
|
| 83 |
mkpts0[:, 0] *= w0_scale
|
| 84 |
mkpts0[:, 1] *= h0_scale
|
|
@@ -137,4 +137,4 @@ with gr.Blocks() as demo:
|
|
| 137 |
)
|
| 138 |
|
| 139 |
if __name__ == "__main__":
|
| 140 |
-
demo.launch(
|
|
|
|
| 45 |
|
| 46 |
_config = lower_config(config)
|
| 47 |
matcher = EDM(config=_config["edm"])
|
| 48 |
+
state_dict = torch.load("weights/edm_outdoor.ckpt", map_location=torch.device('cpu'))["state_dict"]
|
| 49 |
matcher.load_state_dict(state_dict)
|
| 50 |
matcher = matcher.eval()
|
| 51 |
|
|
|
|
| 76 |
with torch.no_grad():
|
| 77 |
matcher(batch)
|
| 78 |
|
| 79 |
+
mkpts0 = batch['mkpts0_f'].numpy()
|
| 80 |
+
mkpts1 = batch['mkpts1_f'].numpy()
|
| 81 |
+
mconf = batch['mconf'].numpy()
|
| 82 |
|
| 83 |
mkpts0[:, 0] *= w0_scale
|
| 84 |
mkpts0[:, 1] *= h0_scale
|
|
|
|
| 137 |
)
|
| 138 |
|
| 139 |
if __name__ == "__main__":
|
| 140 |
+
demo.launch()
|