source/data/write_signs_to_json.py

source-code data processing json

File Path: src/data/write-signs-to-json.py

Purpose: Utility script to convert Excel labels to JSON format.

Overview

Reads the raw Excel file containing Arabic and English sign labels and exports them to a structured JSON file. This JSON file is then consumed by the application to load class labels.

Process

  1. Load Excel: Reads KARSL-502_Labels.xlsx from the input directory.
  2. Extract Columns: Selects Sign-Arabic and Sign-English.
  3. Format: Converts to dictionary format.
  4. Save: Writes to labels.json.
  5. Verify: Reloads the JSON to verify integrity.

Variables

  • LABELS_JSON_PATH: Output destination.
  • LOCAL_INPUT_DATA_DIR: Input directory containing the Excel file.

File Location: src/data/write-signs-to-json.py