DriverTrac/venv/lib/python3.12/site-packages/roboflow/util/annotations.py
2025-11-28 09:08:33 +05:30

14 lines
314 B
Python

import os
from typing import Callable
import yaml
def amend_data_yaml(path: str, callback: Callable[[dict], dict]):
with open(path) as source:
content = yaml.safe_load(source)
content = callback(content)
os.remove(path)
with open(path, "w") as target:
yaml.dump(content, target)