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.2.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.2-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for sign_language_data_loading-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2ee0d24c892f57f80ed0c74d31d053366eb17f6bd7423d155267a2072437692b
MD5 184a8ca7667efa0c1aa3ec60fbddcfec
BLAKE2b-256 5354f4d037ead2f142140d5981d8bb4178accc0e34d3b0e5c9b63d3900dde041

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sign_language_data_loading-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a92d2001a2da32675da8e8931b02e2362094ba401c94b80e4a7f660c78868d41
MD5 6ecd0cbf09e7b5ec4b69e20f53b5072d
BLAKE2b-256 84af2923008f0816ab8a5b413e19c3a9080ff9f47fa592cab8e2c66671a5ae26

See more details on using hashes here.

Provenance

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