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.1.tar.gz (1.3 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.1.tar.gz.

File metadata

File hashes

Hashes for captioned_image_dataset_loader-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1e0fe49eb549c20ad174f2ff87c97feaa23d1f45d4c16ec0aea9a849bbf10bb8
MD5 60e3c6854e8c53766209fb0ed063c435
BLAKE2b-256 1ea51bf5a6aef04ce1f2bae5fdb57719dd502f65011c59e7da6b39e0db4c5b73

See more details on using hashes here.

Provenance

The following attestation bundles were made for captioned_image_dataset_loader-1.0.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for captioned_image_dataset_loader-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef6f8d1fa60a86d9875b0429d8ac2a3dab4bbdbb3aad9639dc2a079c5b9b61f8
MD5 c66aadf224234fcddcb97eb04ef5503b
BLAKE2b-256 02188d50227f76a0ff98f9e11275d2c83266b991ce1751e7a30379c48bbd76c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for captioned_image_dataset_loader-1.0.1-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