sign-predictor/export_json.py
Victor Mylle e13f365d81 Dev
2023-03-26 19:40:47 +00:00

17 lines
411 B
Python

import json
from src.identifiers import HAND_LANDMARKS, POSE_LANDMARKS
def export_json(pose_landmarks, hand_landmarks, filename):
l = {
"pose_landmarks": list(pose_landmarks.values()),
"hand_landmarks": list(hand_landmarks.values())
}
# write l to filename
with open(filename, 'w') as f:
json.dump(l, f)
export_json(POSE_LANDMARKS, HAND_LANDMARKS, "landmarks.json")