size_display
sleap_nn.config_generator.tui.widgets.size_display
¶
Size display widget.
Shows image size transformations through the pipeline.
Classes:
| Name | Description |
|---|---|
EffectiveSizeDisplay |
Compact effective size display showing key dimensions. |
ModelInfoDisplay |
Display for model architecture information. |
SigmaVisualization |
Visual representation of confidence map sigma. |
SizeDisplay |
Widget displaying image size transformation pipeline. |
EffectiveSizeDisplay
¶
Bases: Static
Compact effective size display showing key dimensions.
Shows a one-line summary of input and output sizes.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize the effective size display. |
render |
Render the effective size display. |
update |
Update size values. |
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
__init__(input_size=(0, 0), output_size=(0, 0), id=None, classes=None)
¶
Initialize the effective size display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_size
|
Tuple[int, int]
|
Model input dimensions (width, height). |
(0, 0)
|
output_size
|
Tuple[int, int]
|
Model output dimensions (width, height). |
(0, 0)
|
id
|
Optional[str]
|
Widget ID. |
None
|
classes
|
Optional[str]
|
CSS classes. |
None
|
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
render()
¶
Render the effective size display.
update(input_size=None, output_size=None)
¶
Update size values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_size
|
Optional[Tuple[int, int]]
|
New input dimensions. |
None
|
output_size
|
Optional[Tuple[int, int]]
|
New output dimensions. |
None
|
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
ModelInfoDisplay
¶
Bases: Static
Display for model architecture information.
Shows key model metrics like parameter count, receptive field, and encoder/decoder block counts.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize the model info display. |
render |
Render the model info display. |
update_info |
Update model info values. |
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
__init__(params=0, receptive_field=0, encoder_blocks=0, decoder_blocks=0, title='Model Architecture', id=None, classes=None)
¶
Initialize the model info display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
int
|
Total parameter count. |
0
|
receptive_field
|
int
|
Receptive field size in pixels. |
0
|
encoder_blocks
|
int
|
Number of encoder blocks. |
0
|
decoder_blocks
|
int
|
Number of decoder blocks. |
0
|
title
|
str
|
Display title. |
'Model Architecture'
|
id
|
Optional[str]
|
Widget ID. |
None
|
classes
|
Optional[str]
|
CSS classes. |
None
|
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
render()
¶
Render the model info display.
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
update_info(params=None, receptive_field=None, encoder_blocks=None, decoder_blocks=None)
¶
Update model info values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
Optional[int]
|
New parameter count. |
None
|
receptive_field
|
Optional[int]
|
New receptive field. |
None
|
encoder_blocks
|
Optional[int]
|
New encoder block count. |
None
|
decoder_blocks
|
Optional[int]
|
New decoder block count. |
None
|
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
SigmaVisualization
¶
Bases: Static
Visual representation of confidence map sigma.
Shows a text-based representation of the Gaussian spread for confidence maps at the current sigma setting.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize the sigma visualization. |
render |
Render the sigma visualization. |
update_sigma |
Update sigma value. |
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 | |
__init__(sigma=5.0, output_stride=1, id=None, classes=None)
¶
Initialize the sigma visualization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
float
|
Sigma value in pixels. |
5.0
|
output_stride
|
int
|
Output stride for scaling. |
1
|
id
|
Optional[str]
|
Widget ID. |
None
|
classes
|
Optional[str]
|
CSS classes. |
None
|
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
render()
¶
Render the sigma visualization.
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
update_sigma(sigma, output_stride=None)
¶
Update sigma value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
float
|
New sigma value. |
required |
output_stride
|
Optional[int]
|
New output stride. |
None
|
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
SizeDisplay
¶
Bases: Static
Widget displaying image size transformation pipeline.
Shows how image dimensions change through preprocessing steps: Original → Scaled → Cropped → Output
Useful for visualizing the effect of scale and output stride settings.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize the size display. |
render |
Render the size display. |
update_sizes |
Update size parameters. |
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
__init__(original=(0, 0), scale=1.0, max_size=None, crop_size=None, output_stride=1, title='Image Size Pipeline', id=None, classes=None)
¶
Initialize the size display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
original
|
Tuple[int, int]
|
Original image dimensions (width, height). |
(0, 0)
|
scale
|
float
|
Input scaling factor. |
1.0
|
max_size
|
Optional[Tuple[int, int]]
|
Optional maximum size constraint (width, height). |
None
|
crop_size
|
Optional[int]
|
Optional crop size (for centered instance). |
None
|
output_stride
|
int
|
Output stride for final dimensions. |
1
|
title
|
str
|
Display title. |
'Image Size Pipeline'
|
id
|
Optional[str]
|
Widget ID. |
None
|
classes
|
Optional[str]
|
CSS classes. |
None
|
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
render()
¶
Render the size display.
Source code in sleap_nn/config_generator/tui/widgets/size_display.py
update_sizes(original=None, scale=None, max_size=None, crop_size=None, output_stride=None)
¶
Update size parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
original
|
Optional[Tuple[int, int]]
|
New original dimensions. |
None
|
scale
|
Optional[float]
|
New scale factor. |
None
|
max_size
|
Optional[Tuple[int, int]]
|
New maximum size constraint. |
None
|
crop_size
|
Optional[int]
|
New crop size. |
None
|
output_stride
|
Optional[int]
|
New output stride. |
None
|