Skip to main content

Package to work with galleries of images

Project description

Galleries

Galleries is a python package to manage images galleries and is mainly designed for recognition purposes. With this package you can create a gallery specifying where to get the images from and how to get annotations (if exist) from each image.

Installation

pip install galleries

Usage

Gallery construction

from galleries.annotations_parsers.file_name_parser import FileNameSepParser
from galleries.gallery import Gallery
from galleries.images_providers.local_files_image_providers import LocalFilesImageProvider


images_provider = LocalFilesImageProvider("path/to/images")
annotations_parser = FileNameSepParser(["label", "age"], sep="_")
gallery = Gallery(images_provider, annotations_parser)

Traverse images

images = gallery.get_images()  # returns a generator
for image in images:
  # image is a numpy ndarray
  pass

Get annotations

annotations = gallery.get_annotations()  # returns a generator
for annotation in annotations:
  # annotation is a dictionary
  pass

You can also generate new data for each image and easily save it using a GalleryDataHandler, which is an abstract class. GalleryGenericDataHandler is an implementation of this class that takes information of how to generate the new data and where to save it.

For instance, this is a code example of how to extract features from a gallery and save it to disk:

from galleries.write_gallery_data import GalleryGenericDataHandler

feature_extractor = ...  # your feature extractor here which has a features(image) method
data_generator = "<folder name>", "<feature extractor name>", feature_extractor.features

# write features if do not exist
gallery_features_writer = GalleryGenericDataHandler(gallery, "directory/to/save/features")
exist_features = gallery_features_writer.exists_data(data_generator)
if not exist_features:
  gallery_features_writer.write_data(data_generator)

# read features
features = gallery_features_writer.read_data(data_generator)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

galleries-0.4.10.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

galleries-0.4.10-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file galleries-0.4.10.tar.gz.

File metadata

  • Download URL: galleries-0.4.10.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for galleries-0.4.10.tar.gz
Algorithm Hash digest
SHA256 80c14ee93e624f70259e92db2a048739818e2f27d832a3dc07426ff34e1e2f51
MD5 d05807b923f9a370b0cf7add73ee69dc
BLAKE2b-256 b3308657b2ec1344b5d367099d25d01f6e209ffa6625fd9b4c347d3e871f489e

See more details on using hashes here.

File details

Details for the file galleries-0.4.10-py3-none-any.whl.

File metadata

  • Download URL: galleries-0.4.10-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for galleries-0.4.10-py3-none-any.whl
Algorithm Hash digest
SHA256 35afa6018faa1b3a9fe647b5f13c85b7fa323d070a59fb0255e2e4e26a91f5c0
MD5 81be5d7a0cc83a23bbae1b2f9d4eed0f
BLAKE2b-256 97eaeb7629f50e6f844ed1ae2e4d88d3a7a64a495a24e466aa2d138406890509

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page