Widget for previewing receptive field on sample image using model hyperparams.

class sleap.gui.learning.receptivefield.ReceptiveFieldImageWidget(*args, **kwargs)[source]

Widget for showing image with receptive field.


Re-draw receptive field when needed by overriding QGraphicsView method.

class sleap.gui.learning.receptivefield.ReceptiveFieldWidget(head_name: str = '', *args, **kwargs)[source]

Widget for previewing receptive field on sample image, with caption.


head_name – If given, then used in caption to show which model the preview is for.


Create, then call setImage and setModelConfig methods.

setImage(*args, **kwargs)[source]

Sets image on which receptive field box will be drawn.

setModelConfig(model_cfg: sleap.nn.config.model.ModelConfig, scale: float)[source]

Updates receptive field preview from model config.

sleap.gui.learning.receptivefield.compute_rf(down_blocks: int, convs_per_block: int = 2, kernel_size: int = 3) → int[source]

Computes receptive field for specified model architecture.

Ref: (Eq. 2)

sleap.gui.learning.receptivefield.receptive_field_info_from_model_cfg(model_cfg: sleap.nn.config.model.ModelConfig) → dict[source]

Gets receptive field information given specific model configuration.