Test¶
- test(
- frame_encoder: FrameEncoder,
- frame: Frame,
- frame_encoder_manager: FrameEncoderManager,
Evaluate the performance of a
FrameEncoder
when encoding aFrame
.- Parameters:
frame_encoder (FrameEncoder) – FrameEncoder to be evaluated.
frame (Frame) – The original frame to compress. It provides both the target (original non compressed frame) as well as the reference(s) (list of already decoded images)
lambda – Rate constraint lambda. Only requires to compute a meaningfull loss \(\mathcal{L} = \mathrm{D} + \lambda \mathrm{R}\)
frame_encoder_manager (FrameEncoderManager) – Contains (among other things) the rate constraint \(\lambda\). It is also used to track the total encoding time and encoding iterations.
- Returns:
Many logs on the performance of the FrameEncoder. See doc of
FrameEncoderLogs
.- Return type:
- class FrameEncoderLogs[source]¶
Output of the test function i.e. the actual results of the encoding of one frame by the frame encoder.
It inherits from LossFunctionOutput, meaning that all attributes of LossFunctionOutput are also attributes of FrameEncoderLogs. A FrameEncoderLogs is thus initialized from a LossFunctionOutput, all attribute of the LossFunctionOutput will be copied as new attributes for the class.
This is what is going to be saved to a log file.
- pretty_string(
- show_col_name: bool = False,
- mode: Literal['all', 'short'] = 'all',
- additional_data: Dict[str, Any] = {},
Return a pretty string formatting the data within the class.
- Parameters:
show_col_name (
bool, optional
) – True to also display col name. Defaults to False.mode (
str, optional
) – Either “short” or “all”. Defaults to ‘all’.additional_data (Dict[str, Any])
- Returns:
The formatted results
- Return type:
str
- __init__(
- loss_function_output: LossFunctionOutput,
- frame_encoder_output: FrameEncoderOutput,
- original_frame: Frame,
- detailed_rate_nn: DescriptorCoolChic,
- quantization_param_nn: DescriptorCoolChic,
- expgol_count_nn: DescriptorCoolChic,
- lmbda: float,
- encoding_time_second: float,
- encoding_iterations_cnt: int,
- mac_decoded_pixel: float = 0.0,
- *,
- loss: float | None = None,
- mse: float | None = None,
- rate_nn_bpp: float | None = None,
- rate_latent_bpp: float | None = None,
- Parameters:
loss_function_output (LossFunctionOutput)
frame_encoder_output (FrameEncoderOutput)
original_frame (Frame)
detailed_rate_nn (DescriptorCoolChic)
quantization_param_nn (DescriptorCoolChic)
expgol_count_nn (DescriptorCoolChic)
lmbda (float)
encoding_time_second (float)
encoding_iterations_cnt (int)
mac_decoded_pixel (float)
loss (float | None)
mse (float | None)
rate_nn_bpp (float | None)
rate_latent_bpp (float | None)
- Return type:
None