Skip to content

Commit

Permalink
🎨 pre-commit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xaristeidou committed Aug 7, 2024
1 parent c4419cf commit a2be707
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions supervision/dataset/formats/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,15 @@ def save_yolo_annotations(
save_text_file(lines=lines, file_path=yolo_annotations_path)


def save_data_yaml(data_yaml_path: str, classes: List[str], subset_type: Union[str, None]) -> None:
def save_data_yaml(
data_yaml_path: str, classes: List[str], subset_type: Union[str, None]
) -> None:
if Path(data_yaml_path).exists():
data = read_yaml_file(data_yaml_path)
else:
data = {}
data["nc"] = len(classes)
data["names"] = classes
data["names"] = classes
if subset_type is not None:
data[subset_type] = f"{subset_type}/images"
Path(data_yaml_path).parent.mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit a2be707

Please sign in to comment.