Skip to content

Instantly share code, notes, and snippets.

@hewumars
Last active September 16, 2020 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hewumars/d165a82c00df13e4eb7d314e0d513a3e to your computer and use it in GitHub Desktop.
Save hewumars/d165a82c00df13e4eb7d314e0d513a3e to your computer and use it in GitHub Desktop.
import matplotlib
# Needed before pyplot import for matplotlib to work properly.
# matplotlib.use('Agg')
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
from matplotlib.widgets import RectangleSelector
from matplotlib.patches import Circle,Rectangle
fig = plt.figure() # make a new plotting range
im = mpimg.imread(query_image_paths[idx]) # HxWxC
plt.imshow(im)
currentAxis = plt.gca()
#画圆
cir = plt.Circle(xy=(100,100), radius=10)
currentAxis.add_patch(cir)
#画框
rect=patches.Rectangle(xy=(200, 600),550,650,linewidth=1,edgecolor='r',facecolor='none')
currentAxis.add_patch(rect)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment