Initial Commit
This commit is contained in:
20
export_label_id.py
Normal file
20
export_label_id.py
Normal file
@@ -0,0 +1,20 @@
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user