qualitylib.result.Result¶
- class Result(dataset_name, content_id, asset_id, feats, feat_names=array([], dtype='<U1'), agg_method='mean', score=None)[source]¶
Bases:
objectResult object containing extracted features and asset data.
- Parameters:
dataset_name (
str) – Name of dataset.content_id (
int) – ID of source content of input asset.asset_id (
int) – ID of input asset from which features were extracted.feats (
ndarray) – Array of features extracted from asset.feat_names (
ndarray) – Optional names of extracted features.agg_method (
Union[str,callable]) – Temporal aggregation method. Defaults to ‘mean’.score (
Optional[float]) – Optional ground-truth subjective score. Defaults to None.
- Raises:
ValueError – If feats is not a 2D array.
ValueError – If agg_method is neither a recognized string, nor a
Callable.ValueError – If the number of features in feats does not match the number of feature names, if provided.
Methods
Check if result file exists in cache.
Load result from input asset and name-version string of the
FeatureExtractorclass.Create result from dictionary.
Get path in cache to/from which result is saved/loaded.
Load result from path.
Save result to path.
Attributes
Aggregated features, using the agg_method.
Array of extracted features from each frame.
Number of extracted features.
Number of frames for which features are extracted.
- classmethod from_asset_and_fex(asset_dict, fex_name_version)[source]¶
Load result from input asset and name-version string of the
FeatureExtractorclass.
- static get_path(asset_dict, fex_name_version)[source]¶
Get path in cache to/from which result is saved/loaded.