Import Matplotlib and Numpy.


In [1]:
%matplotlib inline

import matplotlib
import numpy as np
import matplotlib.pyplot as plt

Import the annotatorlib package.


In [2]:
import pyannotatorlib as pan

Load imageset and storage plugins.


In [3]:
path_imagesets = '/annotatorlib/build/imagesets/'
path_storages = '/annotatorlib/build/storages'
pan.load_imagesets(path_imagesets)
pan.load_storages(path_storages)

Load project from file.


In [4]:
project = pan.Project.load_path("/home/annotator/flickr.pro.xml")

Get imageset.


In [5]:
imageset = project.get_imageset()

Get session.


In [6]:
session = project.get_session()

Get size of imageset.

Get first image and url in current imageset.


In [7]:
print(imageset.size())
print(imageset.get_image_path(0))


100


In [8]:
img = imageset.get_image(0)

Show the Image.


In [9]:
imgplot = plt.imshow(img)


Show other images.


In [10]:
plt.imshow(imageset.get_image(42))


Out[10]:
<matplotlib.image.AxesImage at 0x7f26a2b6e250>

In [ ]: