--- title: Photo keywords: fastai sidebar: home_sidebar nb_path: "nbs/indexers.FacerecognitionIndexer.Photo.ipynb" ---
{% raw %}
{% endraw %}

This file contains many convenience functions and classes to work with photos in the context of importing data from external sources and machine learning. It contains functions for reading, plotting, resizing, etc.

{% raw %}
{% endraw %} {% raw %}

show_images[source]

show_images(images, cols=3, titles=None)

{% endraw %} {% raw %}

get_size[source]

get_size(img, maxsize)

{% endraw %} {% raw %}

resize[source]

resize(img, maxsize)

{% endraw %} {% raw %}

get_height_width_channels[source]

get_height_width_channels(img)

{% endraw %} {% raw %}
{% endraw %} {% raw %}

class IPhoto[source]

IPhoto(data=None, embedding=None, path=None, *args, **kwargs) :: Photo

Provides a base class for all items. All items in the schema inherit from this class, and it provides some basic functionality for consistency and to enable easier usage.

{% endraw %} {% raw %}
{% endraw %} {% raw %}
p = IPhoto.from_path(PYI_TESTDATA / "photos" / "faceclustering" / "modern_family1.jpg")
{% endraw %} {% raw %}
p.show()
{% endraw %} {% raw %}
box = [240,240,400,400] 
crop = p.get_crop(box)
crop = IPhoto.from_np(crop)
crop.show()
{% endraw %} {% raw %}
p.draw_boxes([box])
Plotting 1 face boundingboxes
{% endraw %}