sign_language_translator.config.enums module

Centralized String Constants for Sign Language Translator Package

This module defines enumerations for various string constants used throughout the package.

Enumerations:

Countries (Enum): Enumerates supported countries with their short codes. Organizations (Enum): Enumerates supported organizations with their short codes. SignCollections (Enum): Enumerates sign collections with their names. TextLanguages (Enum): Enumerates supported text languages with their short codes. SignLanguages (Enum): Enumerates supported sign languages with their names. SignFormats (Enum): Enumerates supported video feature models. ModelCodes (Enum): Enumerates model codes for different models.

Functions:

normalize_short_code (function): Normalizes a provided short code to a recognized standard form.

class sign_language_translator.config.enums.Countries(value)[source][source]

Bases: Enum

Enumeration of countries with their corresponding short codes.

- PAKISTAN

Short code for Pakistan.

Type:

str

...
PAKISTAN = 'pk'[source]
class sign_language_translator.config.enums.ModelCodes(value)[source][source]

Bases: Enum

Enumeration of model codes with their corresponding short codes.

- CONCATENATIVE_SYNTHESIS

Short code for the rule-based text-to-sign translation model.

Type:

str

- NGRAM_LM_UNIGRAM_NAMES

Short code for ngram model trained with window size 1 on en/ur person names data.

Type:

str

- NGRAM_LM_BIGRAM_NAMES

Short code for ngram model trained with window size 2 on en/ur person names data.

Type:

str

- NGRAM_LM_TRIGRAM_NAMES

Short code for ngram model trained with window size 3 on en/ur person names data.

Type:

str

- MIXER_LM_NGRAM_URDU

Short code for a mix of ngram models trained on urdu words of window size 1 to 6.

Type:

str

- TRANSFORMER_LM_UR_SUPPORTED

Short code for a transformer-based language model trained on ur supported tokens.

Type:

str

- MEDIAPIPE_POSE_V2_HAND_V1

Short code for a video embedding model which uses MediaPipe pose_landmarker_heavy & hand_landmarker.

Type:

str

- MEDIAPIPE_POSE_V1_HAND_V1

Short code for a video embedding model which uses MediaPipe pose_landmarker_full & hand_landmarker.

Type:

str

- MEDIAPIPE_POSE_V0_HAND_V1

Short code for a video embedding model which uses MediaPipe pose_landmarker_lite & hand_landmarker.

Type:

str

- LOOKUP_UR_FASTTEXT_CC

Short code for a text embedding model which uses a lookup table to embed Urdu tokens using fastText embeddings trained on Common Crawl.

Type:

str

CONCATENATIVE_SYNTHESIS = 'concatenative-synthesis'[source]

The core rule-based text to sign translation model that joins sign clips for each word in a text sentence.

LOOKUP_UR_FASTTEXT_CC = 'lookup-ur-fasttext-cc.pt'[source]

Short code for the text embedding model which uses a lookup table to embed Urdu tokens using fastText embeddings trained on Common Crawl.

MEDIAPIPE_POSE_V0_HAND_V1 = 'mediapipe-pose-0-hand-1'[source]

Short code for the video embedding model which uses MediaPipe pose_landmarker_lite & hand_landmarker to generate (33 pose + 2 * 21 hand) world & 75 image landmarks (x, y, z, visibility, presence) for each frame of the video.

MEDIAPIPE_POSE_V1_HAND_V1 = 'mediapipe-pose-1-hand-1'[source]

Short code for the video embedding model which uses MediaPipe pose_landmarker_full & hand_landmarker to generate (33 pose + 2 * 21 hand) world & 75 image landmarks (x, y, z, visibility, presence) for each frame of the video.

MEDIAPIPE_POSE_V2_HAND_V1 = 'mediapipe-pose-2-hand-1'[source]

Short code for the video embedding model which uses MediaPipe pose_landmarker_heavy & hand_landmarker to generate (33 pose + 2 * 21 hand) world & 75 image landmarks (x, y, z, visibility, presence) for each frame of the video.

MIXER_LM_NGRAM_URDU = 'ur-supported-token-unambiguous-mixed-ngram-w1-w6-lm.pkl'[source]

Simple hash table based n-gram language model with context size of 1-6 that generates unambiguous Urdu tokens.

NGRAM_LM_BIGRAM_NAMES = 'names-stat-lm-w2.json'[source]
NGRAM_LM_TRIGRAM_NAMES = 'names-stat-lm-w3.json'[source]
NGRAM_LM_UNIGRAM_NAMES = 'names-stat-lm-w1.json'[source]
TRANSFORMER_LM_UR_SUPPORTED = 'tlm_14.0M.pt'[source]
class sign_language_translator.config.enums.Organizations(value)[source][source]

Bases: Enum

Enumeration of organizations with their corresponding short codes.

- HFAD

Short code for HFAD (e.g., an organization for deaf in Pakistan).

Type:

str

...
HFAD = 'hfad'[source]

Hamza Foundation Academy for the Deaf (Lahore, Pakistan)

class sign_language_translator.config.enums.SignCollections(value)[source][source]

Bases: Enum

Enumeration of sign collections with their corresponding short codes.

- PK_HFAD_1

Short code for the first sign dictionary from HamzaFoundationAcademyDeaf, Pakistan.

Type:

str

- PK_HFAD_2

Short code for the second sign collection from HamzaFoundationAcademyDeaf, Pakistan.

Type:

str

...
PK_HFAD_1 = 'Countries.PAKISTAN-Organizations.HFAD-1'[source]

Short code for the first sign dictionary from HamzaFoundationAcademyDeaf, Pakistan. (788 videos)

PK_HFAD_2 = 'Countries.PAKISTAN-Organizations.HFAD-2'[source]

Short code for the second sign dictionary from HamzaFoundationAcademyDeaf, Pakistan.

class sign_language_translator.config.enums.SignEmbeddingModels(value)[source][source]

Bases: Enum

The Names of video embedding models that have been used to embed sign language videos in the available datasets.

MEDIAPIPE_WORLD[source]

Short code for the video embedding model which uses MediaPipe pose_landmarker_heavy & hand_landmarker to generate (33 pose + 2 * 21 hand) world landmarks (x, y, z, visibility, presence) for each frame of the video. World landmarks are 3D coordinates in meters with origin at the center of the hips for pose_landmarker and at the center of each hand for hand_landmarker model.

Type:

str

MEDIAPIPE_IMAGE[source]

Short code for the video embedding model which uses MediaPipe pose_landmarker_heavy & hand_landmarker to generate (33 pose + 2 * 21 hand) image landmarks (x, y, z, visibility, presence) for each frame of the video. Image landmarks are 2D coordinates as fraction of the frame width or height with origin at the top-left corner of the frame and z value is the depth from the camera.

Type:

str

MEDIAPIPE_IMAGE = 'mediapipe-image'[source]
MEDIAPIPE_WORLD = 'mediapipe-world'[source]
class sign_language_translator.config.enums.SignFormats(value)[source][source]

Bases: Enum

Enumeration of available sign formats with their corresponding short codes. For example, sign language can be a sequence of frames (video) or a sequence of pose vectors (landmarks) etc.

- VIDEO

Short code for raw video.

Type:

str

- LANDMARKS

Short code for body landmarks.

Type:

str

...
LANDMARKS = 'landmarks'[source]

Sequence of points on the body (n_frames, n_points, n_coordinates)

VIDEO = 'video'[source]

Sequence of RGB frames (num_frames, height, width, num_channels)

class sign_language_translator.config.enums.SignLanguages(value)[source][source]

Bases: Enum

Enumeration of sign languages with their corresponding short codes.

- PAKISTAN_SIGN_LANGUAGE

Short code for the Pakistan Sign Language.

Type:

str

...
PAKISTAN_SIGN_LANGUAGE = 'pakistan-sign-language'[source]
class sign_language_translator.config.enums.TextLanguages(value)[source][source]

Bases: Enum

Enumeration of text languages with their corresponding short codes.

- URDU

Short code for the Urdu language.

Type:

str

- HINDI

Short code for the Hindi language.

Type:

str

- ENGLISH

Short code for the English language.

Type:

str

ENGLISH = 'en'[source]
HINDI = 'hi'[source]
URDU = 'ur'[source]
sign_language_translator.config.enums.normalize_short_code(short_code: str | Enum) str[source][source]

Normalize the provided short code to a standard form that is recognized package wide.

Parameters:

short_code (str) – The short code to be normalized.

Returns:

The normalized short code.

Return type:

str