Skip to main content

Efficient data loading utilities for sign language datasets.

Project description

sign-language-data-loading

sign-language-data-loading (sldl)

Efficient, PyTorch-friendly data loading for sign language datasets stored as WebDataset shards — poses, videos, and temporal annotations, with windowing and target encoding built in.

Installation

You can simply install it in your Python environment:

pip install sign-language-data-loading

The package is imported as sldl (see examples).

Some features need extra dependencies. Typically, data-loaders and custom targets need PyTorch. If you load the videos too, torchcodec is required. You can install them along with:

# For SignLanguageCollator and the built-in target encoders (sldl.targets.*)
pip install "sign-language-data-loading[torch]"

# For on-the-fly video loading (load_videos=True)
pip install "sign-language-data-loading[video]"

However, we do recommend setting them up yourself in your environment before installing sign-language-data-loading.

Quickstart

Load an isolated-sign dataset

from sldl import SignLanguageDataset
from sldl.configs import LSFBIsolConfig

dataset = SignLanguageDataset.from_config(
    LSFBIsolConfig(
        root="path/to/lsfb-isol",
        variant="500",
        split="training",
    )
)

sample = dataset[0]
print(sample["label"])          # e.g. "bonjour"
print(sample["poses"]["upper_pose"].shape)

Load a continuous dataset

from sldl import SignLanguageDataset
from sldl.configs import LSFBContConfig

dataset = SignLanguageDataset.from_config(
    LSFBContConfig(
        root="path/to/lsfb-cont",
        split="training",
    )
)

sample = dataset[0]
print(sample["annotations"]["both_hands"].head())

Batch samples for training

from torch.utils.data import DataLoader
from sldl import SignLanguageCollator

loader = DataLoader(dataset, batch_size=8, collate_fn=SignLanguageCollator())
batch = next(iter(loader))
print(batch["poses"]["upper_pose"].shape)   # (batch, max_n_frames, ...)
print(batch["masks"].shape)                 # (batch, max_n_frames)

Going further

  • Custom dataset paths, windowing, and target encoders: see SignLanguageDataset and sldl.targets.
  • Full worked examples (loading, visualizing poses/video, windowing, target encoding) are in examples/.

Related projects

  • sign-language-tools (PyPI) — pose and annotation transforms (e.g. SegmentsToFrameLabels, SegmentsToBoundaryOffsets) used by some of the built-in target encoders (sldl.targets.FrameLabelsTarget, sldl.targets.TemporalBoundaryOffsetsTarget).
  • lsfb-cont dataset — French-Belgian Sign Language (LSFB) dataset, available on HuggingFace. It is very useful for Sign Language Processing tasks that requires a Continuous Sign Language Dataset, such as Continuous Sign Language Recognition (CSLR) and Sign Language Segmentation (SLS).
  • lsfb-isol dataset — Isolated version, i.e. ONE sign per video, of the LSFB dataset. Very useful for Isolated Sign Language Recognition (ISLR).

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

sign_language_data_loading-1.0.1.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

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

sign_language_data_loading-1.0.1-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file sign_language_data_loading-1.0.1.tar.gz.

File metadata

File hashes

Hashes for sign_language_data_loading-1.0.1.tar.gz
Algorithm Hash digest
SHA256 98adcd33b647b8c382f03ba3f8a4ee8ba319ecf7a852f62779516caa4d9e76cf
MD5 3c69120671310bddde313cee3f6b5d43
BLAKE2b-256 874f8e97113e91cae42c9a44e33cf3c335c26981c54225b19dac4b388dff4385

See more details on using hashes here.

Provenance

The following attestation bundles were made for sign_language_data_loading-1.0.1.tar.gz:

Publisher: publish.yml on ppoitier/sign-language-data-loading

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

File details

Details for the file sign_language_data_loading-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sign_language_data_loading-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2fa1428111e450529b2282381b291f1626305bd52e2dc6d3e0f69d23783ca33b
MD5 5d8ab69b4671a2a38b10893d6f08299b
BLAKE2b-256 c0b65d2188f718a3771f30539d0b1f880f47e3168874d4b4e3bac36bac24b9c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for sign_language_data_loading-1.0.1-py3-none-any.whl:

Publisher: publish.yml on ppoitier/sign-language-data-loading

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