Utilities for working with datasets in YOLO format.
Class |
|
Class for writing annotations in YOLO-style TXT format. |
Class |
|
Exporter that writes YOLOv4 datasets to disk. |
Class |
|
Importer for YOLOv4 datasets stored on disk. |
Class |
|
Exporter that writes YOLOv5 datasets to disk. |
Class |
|
Importer for YOLOv5 datasets stored on disk. |
Function | add |
Adds the given YOLO-formatted labels to the collection. |
Function | load |
Loads the YOLO-style annotations from the given TXT file. |
Variable | logger |
Undocumented |
Function | _get |
Undocumented |
Function | _make |
Undocumented |
Function | _make |
Undocumented |
Function | _parse |
Undocumented |
Function | _parse |
Undocumented |
Function | _parse |
Undocumented |
Function | _read |
Undocumented |
Function | _read |
Undocumented |
Function | _to |
Undocumented |
Function | _to |
Undocumented |
Function | _write |
Undocumented |
Function | _write |
Undocumented |
Adds the given YOLO-formatted labels to the collection.
Each YOLO txt file should be a space-delimited file whose rows define objects in one of the following formats:
# Detections <target> <x-center> <y-center> <width> <height> <target> <x-center> <y-center> <width> <height> <confidence> # Polylines <target> <x1> <y1> <x2> <y2> <x3> <y3> ...
where target is the zero-based integer index of the object class label from classes and the bounding box coordinates are expressed as relative coordinates in [0, 1] x [0, 1].
Parameters | |
sample | a
fiftyone.core.collections.SampleCollection |
label | the label field in which to store the labels. The field will be created if necessary |
labels | the YOLO-formatted labels to load. This can be any of the following:
|
classes | the list of class label strings |
label | the label format to load. The supported values are ("detections", "polylines") |
includeFalse | whether to insert empty labels for any samples in the input collection whose label_field is None after import |
Loads the YOLO-style annotations from the given TXT file.
The txt file should be a space-delimited file where each row corresponds to an object in one the following formats:
# Detections <target> <x-center> <y-center> <width> <height> <target> <x-center> <y-center> <width> <height> <confidence> # Polylines <target> <x1> <y1> <x2> <y2> <x3> <y3> ...
where target is the zero-based integer index of the object class label from classes and all coordinates are expressed as relative values in [0, 1] x [0, 1].
Parameters | |
txt | the path to the annotations TXT file |
classes | the list of class label strings |
label | the label format to load. The supported values are ("detections", "polylines") |
Returns | |
a fiftyone.core.labels.Detections or
fiftyone.core.labels.Polylines |