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.

204 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.8-final"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python388jvsc74a57bd0e2d1507a0fcefcbd70c2e8d5c2edae879585b2c8df0be6cdbe280bf251175c7f",
"display_name": "Python 3.8.8 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": 2,
"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": 3,
"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": 4,
"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<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-04-07T10:41:21.832467</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.4.1, 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(#p7b0b3a4453)\">\n <image height=\"259.2\" id=\"image139b1066a2\" 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+1EsX103cR87XtyuRxyuVyYbLlcDrPZDIvFAmtra2Hc85nrJLYx66llABBIEJO2x1UA2f4fE8pa91KphHq9jlqthlKphFKphGKxiFqthnq9jlwuh263i4cPH+Kjjz7CZDJx8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t9WctUYM6lzwyvAZBptDIV8EajUcyU6Nk5/dNgXwhRjLlRFFGv1+fe0UC+VqsVeTGBvKbT+uSd9tNllQFNdp8t68NvhWuCpjvJUxm4XDafWh6a75Sl4+ovZhpl913v27y7+LSNGWb/cgFa89rOv6sP2fkzyQXMzTHO5MvkdxnQ7Lpv8+yqUzOfrmf2O6ddL+LLbMcuOarptddeO1WOLwXQtQuAzqS24GiLsRZKZgXY05d249JC71/8i38xV5lSSnq9Hj//8z9fWBzX19f52Mc+xmc/+1l2d3cL3g4ODopp609/+tMcHBwQhiH3338/Tz/9NGEY8rnPfa4Ib1uLNCjTDaparZIkSWH10vm0BYfnedRqtQKk6zIxpzIrlUqRnhb0tVrthMuOFub6mKZpMRBrHoEC0GoFwfM8ut0uaZqyurpalO1gMCjcNoIgYDwe0+12WV1dPeF6BFCr1QpBb4JBDS7MDm5acuM
},
"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, text)"
]
},
{
"source": [
"## Outdoor Example"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 5,
"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": 6,
"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": 7,
"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<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-04-07T10:41:43.419556</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.4.1, 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(#p4da5760efc)\">\n <image height=\"205.44\" id=\"image96b0692821\" 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/6FgwGMRqNZC50Gw6HAACn0ynXc3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kiQVPb/Vjq2F+jxWy0N9PbPnoH4Vyne1/PTKoc5TXV/achYq83oGlsX2zZZLfZ2K7a8OiaVXL2up4/WUcbVrqveb+joW2rdYHtn7Wy9P7Uv9u7rMevej+nwK1Z1emdXtRG//tdRdobwLlTl7vOxLC71thY6txnr/V9TXQvtftX///rVmZhB0AzcEEZkrKrvKWRaJILJ5xa7SQ4BN+HEVizeRXILpo9fI+PQRsPnyFwKq2AbmAgsKKQqEL8HMYZU6Pgglm/MJubeI/3wFUebz1PF5hnBSSsWKb7yCDkpoxqw6n4SicFKUOCZdI+TzcopX2CfYaR2hwTyI13QSG1OUCApOZQETcWxKJ0S3cO54muRiE1aqsVptCIKQ+/9Ip9PEYjGam5vZs2cPVqvVWLTo5YcbJ+h6nbLZbL6uk87LtAB5fyEJuja/QqRAryO9URKlhvomUu8vSdJ1xLYQKdHbT03SteVdrdx657qeOlYTgWLnsNZ8i016KZS/+hjaz9r064Ve/WSvY6GBXKHj/ncRdL3f10LQC33Xg7ZD0BtUqQfo2jy16W+UoGt/1yOm6kHUesj5WvbRDhqz74UGCKthvYMrPRTrrA8cOGAQdAMvKCKkOZezqyxxgSX8WHNkvJsArXgwF5vMuXQ
},
"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, text)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
]
}