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:
EnumEnumeration of countries with their corresponding short codes.
- - PAKISTAN
Short code for Pakistan.
- Type:
str
- ...
- class sign_language_translator.config.enums.ModelCodes(value)[source][source]
Bases:
EnumEnumeration 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.
- class sign_language_translator.config.enums.Organizations(value)[source][source]
Bases:
EnumEnumeration of organizations with their corresponding short codes.
- - HFAD
Short code for HFAD (e.g., an organization for deaf in Pakistan).
- Type:
str
- ...
- class sign_language_translator.config.enums.SignCollections(value)[source][source]
Bases:
EnumEnumeration 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
- ...
- class sign_language_translator.config.enums.SignEmbeddingModels(value)[source][source]
Bases:
EnumThe 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
- class sign_language_translator.config.enums.SignFormats(value)[source][source]
Bases:
EnumEnumeration 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
- ...
- class sign_language_translator.config.enums.SignLanguages(value)[source][source]
Bases:
EnumEnumeration of sign languages with their corresponding short codes.
- - PAKISTAN_SIGN_LANGUAGE
Short code for the Pakistan Sign Language.
- Type:
str
- ...
- class sign_language_translator.config.enums.TextLanguages(value)[source][source]
Bases:
EnumEnumeration 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
- 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