fiftyone.server.metadata¶
FiftyOne Server JIT metadata utilities
Exceptions:
Exception raised when FFmpeg or FFprobe cannot be found. |
|
Exception raised when metadata for a media file cannot be computed. |
Classes:
|
Asynchronous file-like reader. |
Functions:
|
Gets the dimensions of an image from its file-like asynchronous byte stream. |
|
Gets the metadata for the given local media file. |
|
Returns a |
|
Calculates the metadata for the given local media path. |
-
async
fiftyone.server.metadata.
get_metadata
(filepath, metadata=None)¶ Gets the metadata for the given local media file.
- Parameters
filepath – the path to the file
metadata (None) – a pre-existing metadata dict to use if possible
- Returns
metadata dict
-
async
fiftyone.server.metadata.
read_metadata
(filepath, is_video)¶ Calculates the metadata for the given local media path.
- Parameters
filepath – a filepath
is_video – whether the file is a video
- Returns
dict
-
class
fiftyone.server.metadata.
Reader
(content)¶ Bases:
object
Asynchronous file-like reader.
- Parameters
content – a
aiohttp.StreamReader
Methods:
read
(bytes)seek
(bytes)-
async
read
(bytes)¶
-
async
seek
(bytes)¶
-
async
fiftyone.server.metadata.
get_stream_info
(path)¶ Returns a
eta.core.video.VideoStreamInfo
instance for the provided video path.- Parameters
path – a video filepath
- Returns
a
eta.core.video.VideoStreamInfo
-
async
fiftyone.server.metadata.
get_image_dimensions
(input)¶ Gets the dimensions of an image from its file-like asynchronous byte stream.
- Parameters
input – file-like object with async read and seek methods
- Returns
the
(width, height)