pixano.datasets.dataset_info
DatasetInfo(**data)
Bases: BaseModel
Information of a dataset.
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
Dataset ID. Must be unique. |
name |
str
|
Dataset name. |
description |
str
|
Dataset description. |
estimated_size |
str
|
Dataset estimated size. |
preview |
str
|
Path to a preview thumbnail. |
Source code in pydantic/main.py
from_json(json_fp)
staticmethod
Read DatasetInfo from JSON file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
json_fp
|
Path
|
JSON file path. |
required |
Returns:
Type | Description |
---|---|
'DatasetInfo'
|
the dataset info object. |
Source code in pixano/datasets/dataset_info.py
load_directory(directory, return_path=False)
staticmethod
Load list of DatasetInfo from directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
directory
|
Path
|
Directory to load. |
required |
return_path
|
bool
|
Return the paths of the datasets. |
False
|
Returns:
Type | Description |
---|---|
list[tuple['DatasetInfo', Path]] | list['DatasetInfo']
|
The list of DatasetInfo and the paths of the datasets. |
Source code in pixano/datasets/dataset_info.py
load_id(id, directory, return_path=False)
staticmethod
Load a specific DatasetInfo from directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the dataset to load. |
required |
directory
|
Path
|
Directory to load. |
required |
return_path
|
bool
|
Return the path of the dataset. |
False
|
Returns:
Type | Description |
---|---|
tuple['DatasetInfo', Path] | 'DatasetInfo'
|
The DatasetInfo. |
Source code in pixano/datasets/dataset_info.py
to_json(json_fp)
Writes the DatasetInfo object to a JSON file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
json_fp
|
Path
|
The path to the file where the DatasetInfo object will be written. |
required |