Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
Fix scale computation in attention visualization example (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmassa authored Aug 21, 2020
1 parent f6bc5d2 commit 3e92cd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notebooks/detr_attention.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@
"fcenter_ax = fig.add_subplot(gs[:, 1:-1])\n",
"fcenter_ax.imshow(im)\n",
"for (y, x) in idxs:\n",
" scale = im.height / img.shape[-1]\n",
" scale = im.height / img.shape[-2]\n",
" x = ((x // fact) + 0.5) * fact\n",
" y = ((y // fact) + 0.5) * fact\n",
" fcenter_ax.add_patch(plt.Circle((x * scale, y * scale), fact // 2, color='r'))\n",
Expand Down Expand Up @@ -1619,4 +1619,4 @@
]
}
]
}
}

0 comments on commit 3e92cd7

Please sign in to comment.