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.2.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.2.tar.gz.

File metadata

File hashes

Hashes for captioned_image_dataset_loader-1.0.2.tar.gz
Algorithm Hash digest
SHA256 a9ce1c681229021e4bd553d680758e329dbd0e67085597f87bbb220fb8cfe742
MD5 23a29bd630e6e3a67ee63f1454228f4d
BLAKE2b-256 f4e7601143c4a7173ff5da1720ff15b57d4c4dd81f49de38c3fdd6a717309ba1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for captioned_image_dataset_loader-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c29b5319c2645dc04a2594c19f02f27d6c1922b78bbc25a9b09c8774e7804d44
MD5 d9c0e3a2e3771fd25f90c0994ab54971
BLAKE2b-256 ec91e54d4c230cda2436a3d1628894e8522e2fd3fc9a2cad53926a7b176414c9

See more details on using hashes here.

Provenance

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