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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file captioned_image_dataset_loader-1.0.1.tar.gz.
File metadata
- Download URL: captioned_image_dataset_loader-1.0.1.tar.gz
- Upload date:
- Size: 1.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e0fe49eb549c20ad174f2ff87c97feaa23d1f45d4c16ec0aea9a849bbf10bb8
|
|
| MD5 |
60e3c6854e8c53766209fb0ed063c435
|
|
| BLAKE2b-256 |
1ea51bf5a6aef04ce1f2bae5fdb57719dd502f65011c59e7da6b39e0db4c5b73
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
captioned_image_dataset_loader-1.0.1.tar.gz -
Subject digest:
1e0fe49eb549c20ad174f2ff87c97feaa23d1f45d4c16ec0aea9a849bbf10bb8 - Sigstore transparency entry: 363929986
- Sigstore integration time:
-
Permalink:
alexsenden/captioned-image-dataset-loader@338efe6a0c5911718c227de1253a937b367d02f5 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/alexsenden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@338efe6a0c5911718c227de1253a937b367d02f5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file captioned_image_dataset_loader-1.0.1-py3-none-any.whl.
File metadata
- Download URL: captioned_image_dataset_loader-1.0.1-py3-none-any.whl
- Upload date:
- Size: 1.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef6f8d1fa60a86d9875b0429d8ac2a3dab4bbdbb3aad9639dc2a079c5b9b61f8
|
|
| MD5 |
c66aadf224234fcddcb97eb04ef5503b
|
|
| BLAKE2b-256 |
02188d50227f76a0ff98f9e11275d2c83266b991ce1751e7a30379c48bbd76c1
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
captioned_image_dataset_loader-1.0.1-py3-none-any.whl -
Subject digest:
ef6f8d1fa60a86d9875b0429d8ac2a3dab4bbdbb3aad9639dc2a079c5b9b61f8 - Sigstore transparency entry: 363930046
- Sigstore integration time:
-
Permalink:
alexsenden/captioned-image-dataset-loader@338efe6a0c5911718c227de1253a937b367d02f5 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/alexsenden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@338efe6a0c5911718c227de1253a937b367d02f5 -
Trigger Event:
push
-
Statement type: