fiftyone.utils.kineticsΒΆ
Utilities for working with the Kinetics dataset <https://deepmind.com/research/open-source/kinetics>.
Functions:
|
Utility that downloads full or partial splits of the Kinetics dataset. |
Classes:
|
Class that manages the sample IDs and labels that need to be downloaded as well as performing the actual downloading. |
|
Clas that downloads and extracts Kinetics tars from AWS. |
|
Config class for a Kinetics download run. |
|
Class that contains information such as paths, labels, and sample IDs for a Kinetics download. |
|
Kinetics 400-specific dataset info. |
|
|
|
Kinetics 600-specific dataset info. |
|
Kinetics 700-2020-specific dataset info. |
|
Kinetics 700-specific dataset info. |
-
fiftyone.utils.kinetics.
download_kinetics_split
(dataset_dir, split, classes=None, num_workers=None, shuffle=None, seed=None, max_samples=None, retry_errors=False, scratch_dir=None, version='700-2020')ΒΆ Utility that downloads full or partial splits of the Kinetics dataset.
The downloaded splits are stored on disk in VideoClassificationDirectoryTree format.
- Parameters
dataset_dir β the directory to download the dataset
split β the split to download. Supported values are
("train", "validation", "test")
classes (None) β a string or list of strings specifying required classes to load. If provided, only samples containing at least one instance of a specified class will be loaded
num_workers (None) β a suggested number of threads to use when downloading individual videos
shuffle (False) β whether to randomly shuffle the order in which samples are chosen for partial downloads
seed (None) β a random seed to use when shuffling
max_samples (None) β a maximum number of samples to load per split. If
classes
are also specified, only up to the number of samples that contain at least one specified class will be loaded. By default, all matching samples are loadedretry_errors (False) β whether to retry downloading samples from YouTube that have previously raised an error
scratch_dir (None) β a scratch directory to use to store temporary files
version ("700-2020") β the version of the Kinetics dataset to download (β400β, β600β, β700β, or β700-2020β)
- Returns
a tuple of
num_samples: the total number of downloaded videos, or
None
if everything was already downloadedclasses: the list of all classes, or
None
if everything was already downloadeddid_download: whether any content was downloaded (True) or if all necessary files were already downloaded (False)
-
class
fiftyone.utils.kinetics.
KineticsDatasetManager
(info)ΒΆ Bases:
object
Class that manages the sample IDs and labels that need to be downloaded as well as performing the actual downloading.
Methods:
download
(config,Β downloader)download_partial_split
(config,Β downloader)-
download
(config, downloader)ΒΆ
-
download_partial_split
(config, downloader)ΒΆ
-
-
class
fiftyone.utils.kinetics.
KineticsDatasetDownloader
(num_workers=None)ΒΆ Bases:
object
Clas that downloads and extracts Kinetics tars from AWS.
Methods:
download_entire_split
(info)download_classes
(info,Β classes)-
download_entire_split
(info)ΒΆ
-
download_classes
(info, classes)ΒΆ
-
-
class
fiftyone.utils.kinetics.
KineticsDownloadConfig
(split, classes=None, num_workers=None, shuffle=None, seed=None, max_samples=None, retry_errors=False)ΒΆ Bases:
object
Config class for a Kinetics download run.
Attributes:
Methods:
validate
()-
property
load_entire_split
ΒΆ
-
validate
()ΒΆ
-
validate_split
()ΒΆ
-
property
-
class
fiftyone.utils.kinetics.
KineticsDatasetInfo
(kinetics_dir, scratch_dir, split)ΒΆ Bases:
object
Class that contains information such as paths, labels, and sample IDs for a Kinetics download.
Attributes:
Methods:
raw_anno_path_split
(split)class_dir
(c)id_from_filename
(video_fn)filename_from_id
(video_id)segment_from_id
(video_id)url_from_id
(video_id)id_from_url
(video_url)get_video_class
(video_id)validate_classes
(classes)get_kinetics_dir
(dataset_dir)build_for_version
(version,Β dataset_dir,Β β¦)-
property
splits
ΒΆ
-
property
version
ΒΆ
-
property
supports_classwise_s3_downloads
ΒΆ
-
property
raw_dir
ΒΆ
-
property
raw_anno_path
ΒΆ
-
raw_anno_path_split
(split)ΒΆ
-
property
urls_s3_file
ΒΆ
-
property
urls_filename
ΒΆ
-
property
urls_path
ΒΆ
-
property
error_path
ΒΆ
-
property
prev_errors
ΒΆ
-
property
loaded_tar_path
ΒΆ
-
property
prev_loaded_tars
ΒΆ
-
property
multisplit_urls
ΒΆ
-
property
split_dir
ΒΆ
-
class_dir
(c)ΒΆ
-
class_existing_sample_ids
(c)ΒΆ
-
class_sample_ids
(c)ΒΆ
-
id_from_filename
(video_fn)ΒΆ
-
filename_from_id
(video_id)ΒΆ
-
segment_from_id
(video_id)ΒΆ
-
url_from_id
(video_id)ΒΆ
-
id_from_url
(video_url)ΒΆ
-
get_video_class
(video_id)ΒΆ
-
cleanup_partial_downloads
()ΒΆ
-
cleanup_excess_videos
()ΒΆ
-
update_existing_sample_ids
()ΒΆ
-
get_incomplete_classes
()ΒΆ
-
validate_classes
(classes)ΒΆ
-
classmethod
get_kinetics_dir
(dataset_dir)ΒΆ
-
classmethod
build_for_version
(version, dataset_dir, scratch_dir, split)ΒΆ
-
property
-
class
fiftyone.utils.kinetics.
Kinetics400DatasetInfo
(kinetics_dir, scratch_dir, split)ΒΆ Bases:
fiftyone.utils.kinetics.KineticsDatasetInfo
Kinetics 400-specific dataset info.
Attributes:
Methods:
build_for_version
(version,Β dataset_dir,Β β¦)class_dir
(c)filename_from_id
(video_id)get_kinetics_dir
(dataset_dir)get_video_class
(video_id)id_from_filename
(video_fn)id_from_url
(video_url)raw_anno_path_split
(split)segment_from_id
(video_id)url_from_id
(video_id)validate_classes
(classes)-
property
supports_classwise_s3_downloads
ΒΆ
-
property
version
ΒΆ
-
property
multisplit_urls
ΒΆ
-
classmethod
build_for_version
(version, dataset_dir, scratch_dir, split)ΒΆ
-
class_dir
(c)ΒΆ
-
class_existing_sample_ids
(c)ΒΆ
-
class_sample_ids
(c)ΒΆ
-
cleanup_excess_videos
()ΒΆ
-
cleanup_partial_downloads
()ΒΆ
-
property
error_path
ΒΆ
-
filename_from_id
(video_id)ΒΆ
-
get_incomplete_classes
()ΒΆ
-
classmethod
get_kinetics_dir
(dataset_dir)ΒΆ
-
get_video_class
(video_id)ΒΆ
-
id_from_filename
(video_fn)ΒΆ
-
id_from_url
(video_url)ΒΆ
-
property
loaded_tar_path
ΒΆ
-
property
prev_errors
ΒΆ
-
property
prev_loaded_tars
ΒΆ
-
property
raw_anno_path
ΒΆ
-
raw_anno_path_split
(split)ΒΆ
-
property
raw_dir
ΒΆ
-
segment_from_id
(video_id)ΒΆ
-
property
split_dir
ΒΆ
-
property
splits
ΒΆ
-
update_existing_sample_ids
()ΒΆ
-
url_from_id
(video_id)ΒΆ
-
property
urls_filename
ΒΆ
-
property
urls_path
ΒΆ
-
property
urls_s3_file
ΒΆ
-
validate_classes
(classes)ΒΆ
-
property
-
class
fiftyone.utils.kinetics.
ClasswiseS3KineticsDatasetInfo
(kinetics_dir, scratch_dir, split)ΒΆ Bases:
fiftyone.utils.kinetics.KineticsDatasetInfo
Attributes:
Methods:
class_url
(c)unloaded_class_urls
(classes)build_for_version
(version,Β dataset_dir,Β β¦)class_dir
(c)filename_from_id
(video_id)get_kinetics_dir
(dataset_dir)get_video_class
(video_id)id_from_filename
(video_fn)id_from_url
(video_url)raw_anno_path_split
(split)segment_from_id
(video_id)url_from_id
(video_id)validate_classes
(classes)-
property
supports_classwise_s3_downloads
ΒΆ
-
class_url
(c)ΒΆ
-
unloaded_class_urls
(classes)ΒΆ
-
classmethod
build_for_version
(version, dataset_dir, scratch_dir, split)ΒΆ
-
class_dir
(c)ΒΆ
-
class_existing_sample_ids
(c)ΒΆ
-
class_sample_ids
(c)ΒΆ
-
cleanup_excess_videos
()ΒΆ
-
cleanup_partial_downloads
()ΒΆ
-
property
error_path
ΒΆ
-
filename_from_id
(video_id)ΒΆ
-
get_incomplete_classes
()ΒΆ
-
classmethod
get_kinetics_dir
(dataset_dir)ΒΆ
-
get_video_class
(video_id)ΒΆ
-
id_from_filename
(video_fn)ΒΆ
-
id_from_url
(video_url)ΒΆ
-
property
loaded_tar_path
ΒΆ
-
property
multisplit_urls
ΒΆ
-
property
prev_errors
ΒΆ
-
property
prev_loaded_tars
ΒΆ
-
property
raw_anno_path
ΒΆ
-
raw_anno_path_split
(split)ΒΆ
-
property
raw_dir
ΒΆ
-
segment_from_id
(video_id)ΒΆ
-
property
split_dir
ΒΆ
-
property
splits
ΒΆ
-
update_existing_sample_ids
()ΒΆ
-
url_from_id
(video_id)ΒΆ
-
property
urls_filename
ΒΆ
-
property
urls_path
ΒΆ
-
property
urls_s3_file
ΒΆ
-
validate_classes
(classes)ΒΆ
-
property
version
ΒΆ
-
property
-
class
fiftyone.utils.kinetics.
Kinetics600DatasetInfo
(kinetics_dir, scratch_dir, split)ΒΆ Bases:
fiftyone.utils.kinetics.ClasswiseS3KineticsDatasetInfo
Kinetics 600-specific dataset info.
Attributes:
Methods:
build_for_version
(version,Β dataset_dir,Β β¦)class_dir
(c)class_url
(c)filename_from_id
(video_id)get_kinetics_dir
(dataset_dir)get_video_class
(video_id)id_from_filename
(video_fn)id_from_url
(video_url)raw_anno_path_split
(split)segment_from_id
(video_id)unloaded_class_urls
(classes)url_from_id
(video_id)validate_classes
(classes)-
property
version
ΒΆ
-
classmethod
build_for_version
(version, dataset_dir, scratch_dir, split)ΒΆ
-
class_dir
(c)ΒΆ
-
class_existing_sample_ids
(c)ΒΆ
-
class_sample_ids
(c)ΒΆ
-
class_url
(c)ΒΆ
-
cleanup_excess_videos
()ΒΆ
-
cleanup_partial_downloads
()ΒΆ
-
property
error_path
ΒΆ
-
filename_from_id
(video_id)ΒΆ
-
get_incomplete_classes
()ΒΆ
-
classmethod
get_kinetics_dir
(dataset_dir)ΒΆ
-
get_video_class
(video_id)ΒΆ
-
id_from_filename
(video_fn)ΒΆ
-
id_from_url
(video_url)ΒΆ
-
property
loaded_tar_path
ΒΆ
-
property
multisplit_urls
ΒΆ
-
property
prev_errors
ΒΆ
-
property
prev_loaded_tars
ΒΆ
-
property
raw_anno_path
ΒΆ
-
raw_anno_path_split
(split)ΒΆ
-
property
raw_dir
ΒΆ
-
segment_from_id
(video_id)ΒΆ
-
property
split_dir
ΒΆ
-
property
splits
ΒΆ
-
property
supports_classwise_s3_downloads
ΒΆ
-
unloaded_class_urls
(classes)ΒΆ
-
update_existing_sample_ids
()ΒΆ
-
url_from_id
(video_id)ΒΆ
-
property
urls_filename
ΒΆ
-
property
urls_path
ΒΆ
-
property
urls_s3_file
ΒΆ
-
validate_classes
(classes)ΒΆ
-
property
-
class
fiftyone.utils.kinetics.
Kinetics7002020DatasetInfo
(kinetics_dir, scratch_dir, split)ΒΆ Bases:
fiftyone.utils.kinetics.ClasswiseS3KineticsDatasetInfo
Kinetics 700-2020-specific dataset info.
Attributes:
Methods:
class_url
(c)build_for_version
(version,Β dataset_dir,Β β¦)class_dir
(c)filename_from_id
(video_id)get_kinetics_dir
(dataset_dir)get_video_class
(video_id)id_from_filename
(video_fn)id_from_url
(video_url)raw_anno_path_split
(split)segment_from_id
(video_id)unloaded_class_urls
(classes)url_from_id
(video_id)validate_classes
(classes)-
property
version
ΒΆ
-
class_url
(c)ΒΆ
-
classmethod
build_for_version
(version, dataset_dir, scratch_dir, split)ΒΆ
-
class_dir
(c)ΒΆ
-
class_existing_sample_ids
(c)ΒΆ
-
class_sample_ids
(c)ΒΆ
-
cleanup_excess_videos
()ΒΆ
-
cleanup_partial_downloads
()ΒΆ
-
property
error_path
ΒΆ
-
filename_from_id
(video_id)ΒΆ
-
get_incomplete_classes
()ΒΆ
-
classmethod
get_kinetics_dir
(dataset_dir)ΒΆ
-
get_video_class
(video_id)ΒΆ
-
id_from_filename
(video_fn)ΒΆ
-
id_from_url
(video_url)ΒΆ
-
property
loaded_tar_path
ΒΆ
-
property
multisplit_urls
ΒΆ
-
property
prev_errors
ΒΆ
-
property
prev_loaded_tars
ΒΆ
-
property
raw_anno_path
ΒΆ
-
raw_anno_path_split
(split)ΒΆ
-
property
raw_dir
ΒΆ
-
segment_from_id
(video_id)ΒΆ
-
property
split_dir
ΒΆ
-
property
splits
ΒΆ
-
property
supports_classwise_s3_downloads
ΒΆ
-
unloaded_class_urls
(classes)ΒΆ
-
update_existing_sample_ids
()ΒΆ
-
url_from_id
(video_id)ΒΆ
-
property
urls_filename
ΒΆ
-
property
urls_path
ΒΆ
-
property
urls_s3_file
ΒΆ
-
validate_classes
(classes)ΒΆ
-
property
-
class
fiftyone.utils.kinetics.
Kinetics700DatasetInfo
(kinetics_dir, scratch_dir, split)ΒΆ Bases:
fiftyone.utils.kinetics.Kinetics7002020DatasetInfo
Kinetics 700-specific dataset info.
Attributes:
Methods:
build_for_version
(version,Β dataset_dir,Β β¦)class_dir
(c)class_url
(c)filename_from_id
(video_id)get_kinetics_dir
(dataset_dir)get_video_class
(video_id)id_from_filename
(video_fn)id_from_url
(video_url)raw_anno_path_split
(split)segment_from_id
(video_id)unloaded_class_urls
(classes)url_from_id
(video_id)validate_classes
(classes)-
property
version
ΒΆ
-
property
urls_s3_file
ΒΆ
-
classmethod
build_for_version
(version, dataset_dir, scratch_dir, split)ΒΆ
-
class_dir
(c)ΒΆ
-
class_existing_sample_ids
(c)ΒΆ
-
class_sample_ids
(c)ΒΆ
-
class_url
(c)ΒΆ
-
cleanup_excess_videos
()ΒΆ
-
cleanup_partial_downloads
()ΒΆ
-
property
error_path
ΒΆ
-
filename_from_id
(video_id)ΒΆ
-
get_incomplete_classes
()ΒΆ
-
classmethod
get_kinetics_dir
(dataset_dir)ΒΆ
-
get_video_class
(video_id)ΒΆ
-
id_from_filename
(video_fn)ΒΆ
-
id_from_url
(video_url)ΒΆ
-
property
loaded_tar_path
ΒΆ
-
property
multisplit_urls
ΒΆ
-
property
prev_errors
ΒΆ
-
property
prev_loaded_tars
ΒΆ
-
property
raw_anno_path
ΒΆ
-
raw_anno_path_split
(split)ΒΆ
-
property
raw_dir
ΒΆ
-
segment_from_id
(video_id)ΒΆ
-
property
split_dir
ΒΆ
-
property
splits
ΒΆ
-
property
supports_classwise_s3_downloads
ΒΆ
-
unloaded_class_urls
(classes)ΒΆ
-
update_existing_sample_ids
()ΒΆ
-
url_from_id
(video_id)ΒΆ
-
property
urls_filename
ΒΆ
-
property
urls_path
ΒΆ
-
validate_classes
(classes)ΒΆ
-
property