write_signs_to_json.py
source scripts data preprocessing
File Path: scripts/write_signs_to_json.py
Purpose: Converts the Master Excel label file into a JSON dictionary for use in the application.
Overview
The script reads the sign language labels (Arabic and English) from an Excel sheet and creates a lightweight JSON file (labels.json). This ensures the live application has fast, indexed access to sign names without requiring an Excel parser at runtime.
Logic
- Read Excel: Uses
pandasto loadKARSL-502_Labels.xlsx. - Extract columns: Grabs “Sign-Arabic” and “Sign-English”.
- Save JSON: Writes to
LABELS_JSON_PATHwithensure_ascii=Falseto preserve Arabic characters.
Related Documentation
Depends On:
KARSL-502_Labels.xlsx(stored inLOCAL_INPUT_DATA_DIR).
Used By:
- main.py - To load labels for recognition output.