Skip to main content

Flexible dataset tool for creating a 🤗 Datasets dataset from image-caption pairs.

Project description

Captioned Image Dataset Formatter

Flexible dataset tool for creating a 🤗 Datasets dataset from image-caption pairs.

The tool expects duplicate directory structures and filenames (excluding file extentions) for the images and captions. Subdirectories will be used as additional tabular attributes.

This file structure is chosen to allow for efficient changes between caption sets, and to easily integrate with my VLM-Captioner.

Ex.

Input File Structure:

dataset/
├── image_folder/
|   ├── subdir1/
|   │   ├── image_1.png
|   │   ├── image_2.png
|   │   └── ...
|   └── subdir2/
|       ├── image_1001.png
|       └── ...
└── caption_folder/
    ├── subdir1/
    │   ├── image_1.txt
    │   ├── image_2.txt
    │   └── ...
    └── subdir2/
        ├── image_1001.txt
        └── ...

Output Dataset:

image caption attribute_1
image_1.png image_1.txt subdir1
image_2.png image_2.txt subdir1
... ... ...
image_1001.png image_1001.txt subdir2

Installation and Usage

First, install the package from PyPI:

pip install captioned-image-dataset-loader

Datasets can then be loaded using the following:

from captioned_image_dataset_generator import load_captioned_image_dataset

dataset = load_captioned_image_dataset("data/images", "data/captions")

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

captioned_image_dataset_loader-1.0.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file captioned_image_dataset_loader-1.0.0.tar.gz.

File metadata

File hashes

Hashes for captioned_image_dataset_loader-1.0.0.tar.gz
Algorithm Hash digest
SHA256 77852c1350928525d8e63d12b6da196d8b58290a8aa10c58a86b5d3c12405690
MD5 d481ebfdc2237a77d3c5415ef4c04e5c
BLAKE2b-256 2be00e50a1dee506b61078134d7995463117ecd904f2546c6d609bcff0dff8fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for captioned_image_dataset_loader-1.0.0.tar.gz:

Publisher: pypi-publish.yml on alexsenden/captioned-image-dataset-loader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file captioned_image_dataset_loader-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for captioned_image_dataset_loader-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42a05b033e51bd4fed882a15b77a020d643179c3a7f04415ec317c9ccc6bbf71
MD5 b41a05fd380c2f935367b01dff68bf79
BLAKE2b-256 c14eebc6b0e96312acda371a2cbd3e558894d09c6f214fdbeb5a151a4e8ddd3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for captioned_image_dataset_loader-1.0.0-py3-none-any.whl:

Publisher: pypi-publish.yml on alexsenden/captioned-image-dataset-loader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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