from lightning import Lightning from sklearn import datasets
lgn = Lightning(ipython=True, host='http://public.lightning-viz.org')
Connected to server at http://public.lightning-viz.org
image-poly visualization let's you draw polygonal regions on images and then query them in the same notebook!
Try drawing a region on the image. Hold command to pan, and option to edit the region.
Note that we assign the visualization to an output variable, so that we can query it later, but we must print that output to get the image to show.
imgs = datasets.load_sample_images().images viz = lgn.imagepoly(imgs) viz
Draw some regions on the image above. Then check the value of
p = viz.polygons()
In this case we drew four regions, so we get four arrays of coordinates (in original image space).
The region overlays themselves do not persist on the image after a refresh, so you'll have to draw your own to see them.