module documentation
Data utilities.
Function | download |
Downloads the classification dataset specified by the given CSV file, which should have the following format: |
Function | download |
Downloads the images from the given URLs. |
Function | parse |
Parses the contents of the given image classification dataset directory tree, which should have the following format: |
Function | parse |
Parses the contents of the given directory of images. |
Function | parse |
Parses the contents of the given directory of videos. |
Variable | logger |
Undocumented |
Function | _download |
Undocumented |
Function | _download |
Undocumented |
Function | _download |
Undocumented |
def download_image_classification_dataset(csv_path, dataset_dir, classes=None, num_workers=None):
(source)
¶
Downloads the classification dataset specified by the given CSV file, which should have the following format:
<label1>,<image_url1> <label2>,<image_url2> ...
The image filenames are the basenames of the URLs, which are assumed to be unique.
The dataset is written to disk in
fiftyone.types.FiftyOneImageClassificationDataset
format.
Parameters | |
csv | a CSV file containing the labels and image URLs |
dataset | the directory to write the dataset |
classes:None | an optional list of classes. By default, this will be inferred from the contents of csv_path |
numNone | a suggested number of threads to use to download images |
Downloads the images from the given URLs.
The filenames in output_dir are the basenames of the URLs, which are assumed to be unique.
Parameters | |
image | a list of image URLs to download |
output | the directory to write the images |
numNone | a suggested number of threads to use |
Returns | |
the list of downloaded image paths |
Parses the contents of the given image classification dataset directory tree, which should have the following format:
<dataset_dir>/ <classA>/ <image1>.<ext> <image2>.<ext> ... <classB>/ <image1>.<ext> <image2>.<ext> ...
Parameters | |
dataset | the dataset directory |
Returns | |
samples | a list of (image_path, target) pairs classes: a list of class label strings |
Parses the contents of the given directory of images.
Parameters | |
dataset | the dataset directory |
recursive:True | whether to recursively traverse subdirectories |
Returns | |
a list of image paths |
Parses the contents of the given directory of videos.
Parameters | |
dataset | the dataset directory |
recursive:True | whether to recursively traverse subdirectories |
Returns | |
a list of video paths |