Files
spoterembedding/export_label_id.py
2023-04-07 09:44:12 +00:00

20 lines
505 B
Python

import os
import json
# read data/wlasl/wlasl_class_list.txt
labels = {}
with open("data/sign_to_prediction_index_map.json", "r") as f:
sign_to_prediction_index_map = json.load(f)
# switch key and value
for key, value in sign_to_prediction_index_map.items():
labels[value] = key
if os.path.exists("data/processed/id_to_label.json"):
os.remove("data/processed/id_to_label.json")
with open("data/processed/id_to_label.json", "w") as f:
json.dump(labels, f)