Skip to content

Commit

Permalink
fix native parser file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlov721 committed Jan 14, 2025
1 parent 8de4ad0 commit 590fda8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion luxonis_ml/data/parsers/native_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ def from_split(self, annotation_path: Path) -> ParserOutput:
"""

def generator() -> DatasetIterator:
yield from json.loads(annotation_path.read_text())
for record in json.loads(annotation_path.read_text()):
if "file" not in record:
raise ValueError(
"The annotation record must contain 'file' key."
)
record["file"] = annotation_path.parent / record["file"]
yield record

added_images = self._get_added_images(generator())

Expand Down

0 comments on commit 590fda8

Please sign in to comment.