imlab.picture.Picture

class imlab.picture.Picture(image: object, box_cla: [((<class 'float'>, <class 'float'>, <class 'float'>, <class 'float'>), <class 'str'>)])[source]

Bases: object

Picture. Transform a Picture to one with bouding box and its classes

__init__(image: object, box_cla: [((<class 'float'>, <class 'float'>, <class 'float'>, <class 'float'>), <class 'str'>)]) None[source]

__init__.

Parameters
  • image (object) – image to transform

  • box_cla ([((float, float, float, float), str)]) – bouding box and classes

Return type

None

Methods

__init__(image, box_cla)

__init__.

draw([conf_prec, font])

draw.

get_all_classes()

get_all_classes.

draw(conf_prec: int = 2, font: str = '/usr/local/lib/python3.10/dist-packages/imlab/font/FUTURAM.ttf') <module 'PIL.Image' from '/usr/lib/python3/dist-packages/PIL/Image.py'>[source]

draw. draw the bouding box, classes and conf

Parameters
  • conf_prec (int) – decimals of conf score to draw, 0 = no conf drawn

  • font (str) – font to be used

Return type

Image

get_all_classes() list[str][source]

get_all_classes. get all classes to draw

Return type

list[str]