You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

197 lines
1.6 MiB

{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python3810jvsc74a57bd065d19ceb1c5e26d1d1e4e93c9824aa3d4633a56cbb655ff57f645571fa154c9a",
"display_name": "Python 3.8.10 64-bit ('loftr': conda)"
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"source": [
"# Demo LoFTR-DS on a single pair of images\n",
"\n",
"This notebook shows how to use the loftr matcher with default config(dual-softmax) and the pretrained weights."
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"os.chdir(\"..\")\n",
"import torch\n",
"import cv2\n",
"import numpy as np\n",
"import matplotlib.cm as cm\n",
"from src.utils.plotting import make_matching_figure"
]
},
{
"source": [
"## Indoor Example"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"from src.loftr import LoFTR, default_cfg\n",
"\n",
"# The default config uses dual-softmax.\n",
"# The outdoor and indoor models share the same config.\n",
"# You can change the default values like thr and coarse_match_type.\n",
"matcher = LoFTR(config=default_cfg)\n",
"matcher.load_state_dict(torch.load(\"weights/indoor_ds.ckpt\")['state_dict'])\n",
"matcher = matcher.eval().cuda()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"# Load example images\n",
"img0_pth = \"assets/scannet_sample_images/scene0711_00_frame-001680.jpg\"\n",
"img1_pth = \"assets/scannet_sample_images/scene0711_00_frame-001995.jpg\"\n",
"img0_raw = cv2.imread(img0_pth, cv2.IMREAD_GRAYSCALE)\n",
"img1_raw = cv2.imread(img1_pth, cv2.IMREAD_GRAYSCALE)\n",
"img0_raw = cv2.resize(img0_raw, (640, 480))\n",
"img1_raw = cv2.resize(img1_raw, (640, 480))\n",
"\n",
"img0 = torch.from_numpy(img0_raw)[None][None].cuda() / 255.\n",
"img1 = torch.from_numpy(img1_raw)[None][None].cuda() / 255.\n",
"batch = {'image0': img0, 'image1': img1}\n",
"\n",
"# Inference with LoFTR and get prediction\n",
"with torch.no_grad():\n",
" matcher(batch)\n",
" mkpts0 = batch['mkpts0_f'].cpu().numpy()\n",
" mkpts1 = batch['mkpts1_f'].cpu().numpy()\n",
" mconf = batch['mconf'].cpu().numpy()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 750x450 with 2 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"273.15pt\" version=\"1.1\" viewBox=\"0 0 714.4 273.15\" width=\"714.4pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <metadata>\n <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <cc:Work>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n <dc:date>2021-05-26T10:12:11.412281</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.3.3, https://matplotlib.org/</dc:title>\n </cc:Agent>\n </dc:creator>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs>\n <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 273.15 \nL 714.4 273.15 \nL 714.4 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 7.2 265.95 \nL 352.2 265.95 \nL 352.2 7.2 \nL 7.2 7.2 \nz\n\" style=\"fill:#ffffff;\"/>\n </g>\n <g clip-path=\"url(#pb2b2e353df)\">\n <image height=\"259.2\" id=\"imagea422b05a43\" transform=\"scale(1 -1)translate(0 -259.2)\" width=\"345.6\" x=\"7.2\" xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAWgAAAEOCAYAAACkSI2SAAEAAElEQVR4nOy9aZNkyXEdenKp3NfKWnvvngWDGQwwwBAgFpKiJDPyo8zEL/p5NP0BSabNSJFmogSjSJEPIEiCAGYGnKWnt9orMyv3ynwf6p3oc708bmZVdw8GfAyzssy6eW/cWI8f9/DwyABYbG5uIpfL4fT0FKPRCEyLxQIAkMlkLl2zKZPJRH/75/TP6Z/TP6d/TldP+Ww2i9///d9HrVZDv9/HZDLBYrHAZDLBZDLBbDbDZDLB2dkZjo6OMJvNMJvNMJ1Ow/fz83PM53Ocn5/j/PzcfRFB3oL4qwL1fxYWScG6yr1sM227VfP4p9beXr11DGcyGWSzWeTzeUynU8zn80ttsAqxib1rWWIZ0kiUnXPe///U+m1tbQ2NRgPdbjeBRS+jnplMZmlf2bmTzWbdfLQPcrlc6E8mYmyeN7VaLdTrdcxmM8zn83DDdDrFZDLBYDDAxsYGBoMBxuMxxuNxuGc8HmM0GmE4HIbnma8WihXg77ZCLzu9jLwXi4ULWGmD3F67ykSI5ed9XzW/fD6PbDa7tAzsO60bn81kMol+03JSMK9Sx+uAEcvEZ+1EsX103cR87XtyuRxyuVyYbLlcDrPZDIvFAmtra2Hc85nrJLYx66llABBIEJO2x1UA2f4fE8pa91KphHq9jlqthlKphFKphGKxiFqthn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okV98lb76bLKgCKzz5b14bfCNUHRreSpDFwum08lD/V3ytKx9Rc9jbL7tvdN3m18msYMvX/ZAK1+bebf1ofM/OlkA+b6GKfzpfO7DGi23Td5ttWpnk/bM/OdRdfz+NLbsU2OKnrttdcWyvGlALpyAVCZVBYcZTFWQkmvAHP60mxcSuj9u3/372YqM8syer0eP/dzP1dYHNfX1/nYxz7G5z73OXZ2dgre9vf3i2nrz3zmM+zv7+P7PnfddRePPfYYnufxW7/1W0V401qkQJlqUNVqlTiOC6uXyqcpOBzHoVarFSBdlYk+lVmpVIr0lKCv1WrHXHaUMFfHJEmKgVjxCBSAVikIjuPQ7XZJkoTV1dWibAeDQeG24Xke4/GYbrfL6urqMdcjgFqtVgh6HQwqcKF3cN2SG4Yh9Xo
},
"metadata": {}
}
],
"source": [
"# Draw\n",
"color = cm.jet(mconf)\n",
"text = [\n",
" 'LoFTR',\n",
" 'Matches: {}'.format(len(mkpts0)),\n",
"]\n",
"fig = make_matching_figure(img0_raw, img1_raw, mkpts0, mkpts1, color, mkpts0, mkpts1, text)"
]
},
{
"source": [
"## Outdoor Example"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"from src.loftr import LoFTR, default_cfg\n",
"\n",
"# The default config uses dual-softmax.\n",
"# The outdoor and indoor models share the same config.\n",
"# You can change the default values like thr and coarse_match_type.\n",
"matcher = LoFTR(config=default_cfg)\n",
"matcher.load_state_dict(torch.load(\"weights/outdoor_ds.ckpt\")['state_dict'])\n",
"matcher = matcher.eval().cuda()"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"# Load example images\n",
"img0_pth = \"assets/phototourism_sample_images/united_states_capitol_26757027_6717084061.jpg\"\n",
"img1_pth = \"assets/phototourism_sample_images/united_states_capitol_98169888_3347710852.jpg\"\n",
"img0_raw = cv2.imread(img0_pth, cv2.IMREAD_GRAYSCALE)\n",
"img1_raw = cv2.imread(img1_pth, cv2.IMREAD_GRAYSCALE)\n",
"img0_raw = cv2.resize(img0_raw, (img0_raw.shape[1]//8*8, img0_raw.shape[0]//8*8)) # input size shuold be divisible by 8\n",
"img1_raw = cv2.resize(img1_raw, (img1_raw.shape[1]//8*8, img1_raw.shape[0]//8*8))\n",
"\n",
"img0 = torch.from_numpy(img0_raw)[None][None].cuda() / 255.\n",
"img1 = torch.from_numpy(img1_raw)[None][None].cuda() / 255.\n",
"batch = {'image0': img0, 'image1': img1}\n",
"\n",
"# Inference with LoFTR and get prediction\n",
"with torch.no_grad():\n",
" matcher(batch)\n",
" mkpts0 = batch['mkpts0_f'].cpu().numpy()\n",
" mkpts1 = batch['mkpts1_f'].cpu().numpy()\n",
" mconf = batch['mconf'].cpu().numpy()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 750x450 with 2 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"272.470866pt\" version=\"1.1\" viewBox=\"0 0 714.4 272.470866\" width=\"714.4pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <metadata>\n <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <cc:Work>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n <dc:date>2021-05-26T10:12:18.147382</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.3.3, https://matplotlib.org/</dc:title>\n </cc:Agent>\n </dc:creator>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs>\n <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 272.470866 \nL 714.4 272.470866 \nL 714.4 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 7.2 238.945357 \nL 352.2 238.945357 \nL 352.2 33.525509 \nL 7.2 33.525509 \nz\n\" style=\"fill:#ffffff;\"/>\n </g>\n <g clip-path=\"url(#pbe492ffd1f)\">\n <image height=\"205.44\" id=\"image8cb5229717\" transform=\"scale(1 -1)translate(0 -205.44)\" width=\"345.6\" x=\"7.2\" xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAWgAAADWCAYAAAD8UhhkAAEAAElEQVR4nMz9SYyk2XUeDD9vzPOcERk5Z2XNQ7OryR7YTTbZzUEiKWqiBC0ICbYE2F4Y3mjhjWF444VXXgiGAcMbAaYhyLBkQNInWqREUmY3m2TP1V1zVc5DzHNExvwtQs/JE7feyKpq0d//XyCRmRHvcIdzz/Cc4Vpf/epXxx6PBzs7O9jZ2YHD4UA8HofL5UK1WkU4HEYoFMJ4PMZ4PIbD4QAAOBwONJtNlEol9Ho9BINBVKtVdLtdAIDL5cJoNEI4HEa73cZgMMBoNILD4YDT6cRoNILL5UI4HMZoNEI8Hkc2m8Xh4SGOjo5wfHwMAPB4POj1ehiNRhiPxwCAcDgMj8eDfr+PdrsNj8cDl8uF4XAIy7LgdDoxGAwwGAwwHA4xGAxgWRYAyG8A8jzLsmBZFlwuF9xuN7xeL/x+P3w+Hzwej/x2Op1wOp0YDocyBr5Ht9FohFqthnq9juFwiFarBZfLBa/Xi3g8jnA4DJ/Ph06ng7W1NeRyORSLRTx8+BAOhwOpVAqVSgX9fl/6FgwGMRqNZC50Gw6HAACn0ynXc3yWZcnajcdjWQO7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pBYRvWymjpeSxlXuqZGv2mvY7F9S6WRu7+N0tS/tL9ry2x0P2rPp1jdGZVZ206M9l9N3RVLu1iZc/nlXnoYbSuWtxZr/V/RXgv9f9W+fftWm5hJ0E3cECQULmnsKqdZIIrEpmW7Si9BNhLAXSreRGoRpg5fI+NTz4LdX7gQUNVWsBRZUEhVIXIBpg9q1PEhKNtUSMh9Jfzny4gxV6COzzGMi3Kqln3jVXRSRgsWzfkkVZXjkswR+Rohn1PS3OkYZ4dtlCbLED7xOHYmKRNUXOo8IgnsahfENnPmaIbUQjM2arHZ7AiCkP//yGQyxONxWlpa2L17NzabzVy06KWHGyfoRp2yxWK5rpMuSLQIeX8+Cbo+vWKkwKgjvVESpYX2JtLuL8vydcS2GCkx2k9L0vXlXancRue6ljrWEoFS57DadEtNeimWvjYP/Wf98WuFUf3krmOxgVyxfP+3CLrR76sh6MW+G0HfIRgNqrQDdH2a+uNvlKDrfzciptpB1FrI+Wr20Q8ac+/FBggrYa2DKyOU6qz3799vEnQTzyuiZDiTt6ssco5FAtjyZLyHIG14sZSazLl4sVA
},
"metadata": {}
}
],
"source": [
"# Draw\n",
"color = cm.jet(mconf)\n",
"text = [\n",
" 'LoFTR',\n",
" 'Matches: {}'.format(len(mkpts0)),\n",
"]\n",
"fig = make_matching_figure(img0_raw, img1_raw, mkpts0, mkpts1, color, mkpts0, mkpts1, text)"
]
}
]
}