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.2.18.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

galleries-0.2.18-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: galleries-0.2.18.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for galleries-0.2.18.tar.gz
Algorithm Hash digest
SHA256 25a1ed0c9ca6964104e70e6d69f6e9ff71e681e10a8df33cbb6663bb9534a948
MD5 2b46b7137508db775be4f335bc56715e
BLAKE2b-256 02815fb3bc7894976321cb6dcb7d87180d5f9cb7e94b0b3fb5f485667cb50df2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: galleries-0.2.18-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for galleries-0.2.18-py3-none-any.whl
Algorithm Hash digest
SHA256 1ea111f32cc8b5a42a38edb0f1c6ce6f5e1e59e9a0dae358763db7ba00bb77ee
MD5 1b8df8b95439542749c74b707bf31ce0
BLAKE2b-256 bfed13a16b11be308b157e4d761a731f630b399170d4ede11dacbb8ee11e4483

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