Spaces:
Running
Running
File size: 710 Bytes
78f883e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
"""
File: video_metadata.py
Author: Elena Ryumina and Dmitry Ryumin
Description: Utility functions for working with video metadata.
License: MIT License
"""
import yaml
from typing import List, Dict
# Importing necessary components for the Gradio app
def load_video_metadata(file_path: str) -> Dict[str, List]:
with open(file_path, "r") as file:
video_metadata = yaml.safe_load(file) or {}
result = {}
for key, value in video_metadata.get("video_metadata", {}).items():
alias = key.split("_")[0]
result[key] = value + [f"video{alias}"]
return result
yaml_file_path = "./video_metadata.yaml"
video_metadata = load_video_metadata(yaml_file_path)
|