fiftyone.core.media#

Sample media utilities.

Copyright 2017-2025, Voxel51, Inc.

Functions:

get_media_type(filepath)

Gets the media type for the given filepath.

Exceptions:

MediaTypeError

Exception raised when a problem with media types is encountered.

SelectGroupSlicesError([supported_media_types])

Exception raised when a grouped collection is passed to a method that expects a primitive media type to be selected.

fiftyone.core.media.get_media_type(filepath)#

Gets the media type for the given filepath.

Parameters:

filepath – a filepath

Returns:

the media type

exception fiftyone.core.media.MediaTypeError#

Bases: TypeError

Exception raised when a problem with media types is encountered.

Methods:

add_note

Exception.add_note(note) -- add a note to the exception

with_traceback

Exception.with_traceback(tb) -- set self.__traceback__ to tb and return self.

Attributes:

add_note()#

Exception.add_note(note) – add a note to the exception

args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception fiftyone.core.media.SelectGroupSlicesError(supported_media_types=None)#

Bases: ValueError

Exception raised when a grouped collection is passed to a method that expects a primitive media type to be selected.

Parameters:

supported_media_types (None) – an optional media type or iterable of media types that are supported

Methods:

add_note

Exception.add_note(note) -- add a note to the exception

with_traceback

Exception.with_traceback(tb) -- set self.__traceback__ to tb and return self.

Attributes:

add_note()#

Exception.add_note(note) – add a note to the exception

args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.