wrappers
sleap_nn.export.wrappers
¶
ONNX/TensorRT export wrappers.
Modules:
| Name | Description |
|---|---|
base |
Base classes and shared helpers for export wrappers. |
bottomup |
Bottom-up ONNX wrapper. |
bottomup_multiclass |
ONNX wrapper for bottom-up multiclass (supervised ID) models. |
centered_instance |
Centered-instance ONNX wrapper. |
centroid |
Centroid ONNX wrapper. |
embedding |
ONNX export wrapper for the |
single_instance |
Single-instance ONNX wrapper. |
topdown |
Top-down ONNX wrapper. |
topdown_multiclass |
ONNX wrapper for top-down multiclass (supervised ID) models. |
Classes:
| Name | Description |
|---|---|
BaseExportWrapper |
Base class for ONNX-exportable wrappers. |
BottomUpMultiClassONNXWrapper |
ONNX-exportable wrapper for bottom-up multiclass (supervised ID) models. |
BottomUpONNXWrapper |
ONNX-exportable wrapper for bottom-up inference up to PAF scoring. |
CenteredInstanceONNXWrapper |
ONNX-exportable wrapper for centered-instance models. |
CentroidONNXWrapper |
ONNX-exportable wrapper for centroid models. |
EmbeddingONNXWrapper |
Wrap an embedding model for ONNX export: crop -> appearance vector. |
SingleInstanceONNXWrapper |
ONNX-exportable wrapper for single-instance models. |
TopDownMultiClassCombinedONNXWrapper |
ONNX-exportable wrapper for combined centroid + multiclass instance models. |
TopDownMultiClassONNXWrapper |
ONNX-exportable wrapper for top-down multiclass (supervised ID) models. |
TopDownONNXWrapper |
ONNX-exportable wrapper for top-down (centroid + centered-instance) inference. |
BaseExportWrapper
¶
Bases: Module
Base class for ONNX-exportable wrappers.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize wrapper with the underlying model. |
Source code in sleap_nn/export/wrappers/base.py
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 | |
__init__(model)
¶
Initialize wrapper with the underlying model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Module
|
The PyTorch model to wrap for export. |
required |
BottomUpMultiClassONNXWrapper
¶
Bases: BaseExportWrapper
ONNX-exportable wrapper for bottom-up multiclass (supervised ID) models.
This wrapper handles models that output both confidence maps for keypoint detection and class maps for identity classification. Unlike PAF-based bottom-up models, multiclass models use class maps to assign identity to each detected peak, then group peaks by identity.
The wrapper performs: 1. Peak detection in confidence maps (GPU) 2. Class probability sampling at peak locations (GPU) 3. Returns fixed-size tensors for CPU-side grouping
Expects input images as uint8 tensors in [0, 255].
Attributes:
| Name | Type | Description |
|---|---|---|
model |
The underlying PyTorch model. |
|
n_nodes |
Number of keypoint nodes in the skeleton. |
|
n_classes |
Number of identity classes. |
|
max_peaks_per_node |
Maximum number of peaks to detect per node. |
|
cms_output_stride |
Output stride of the confidence map head. |
|
class_maps_output_stride |
Output stride of the class maps head. |
|
input_scale |
Scale factor applied to input images before inference. |
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize the wrapper. |
forward |
Run bottom-up multiclass inference. |
Source code in sleap_nn/export/wrappers/bottomup_multiclass.py
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 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
__init__(model, n_nodes, n_classes=2, max_peaks_per_node=20, cms_output_stride=4, class_maps_output_stride=8, input_scale=1.0, peak_threshold=0.2)
¶
Initialize the wrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Module
|
The underlying PyTorch model. |
required |
n_nodes
|
int
|
Number of keypoint nodes. |
required |
n_classes
|
int
|
Number of identity classes (e.g., 2 for male/female). |
2
|
max_peaks_per_node
|
int
|
Maximum peaks per node to detect. |
20
|
cms_output_stride
|
int
|
Output stride of confidence maps. |
4
|
class_maps_output_stride
|
int
|
Output stride of class maps. |
8
|
input_scale
|
float
|
Scale factor for input images. |
1.0
|
peak_threshold
|
float
|
Minimum confidence for a peak to be considered valid. |
0.2
|
Source code in sleap_nn/export/wrappers/bottomup_multiclass.py
forward(image)
¶
Run bottom-up multiclass inference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Tensor
|
Input image tensor of shape (batch, channels, height, width). Expected to be uint8 in [0, 255]. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Tensor]
|
Dictionary with keys: - "peaks": Detected peak coordinates (batch, n_nodes, max_peaks, 2). Coordinates are in input image space (x, y). - "peak_vals": Peak confidence values (batch, n_nodes, max_peaks). - "peak_mask": Boolean mask for valid peaks (batch, n_nodes, max_peaks). - "class_probs": Class probabilities at each peak location (batch, n_nodes, max_peaks, n_classes). Postprocessing on CPU uses |
Source code in sleap_nn/export/wrappers/bottomup_multiclass.py
BottomUpONNXWrapper
¶
Bases: BaseExportWrapper
ONNX-exportable wrapper for bottom-up inference up to PAF scoring.
Expects input images as uint8 tensors in [0, 255].
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize bottom-up ONNX wrapper. |
forward |
Run bottom-up inference and return fixed-size outputs. |
Source code in sleap_nn/export/wrappers/bottomup.py
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 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
__init__(model, skeleton_edges, n_nodes, max_peaks_per_node=20, n_line_points=10, cms_output_stride=4, pafs_output_stride=8, max_edge_length_ratio=0.25, dist_penalty_weight=1.0, input_scale=1.0, peak_threshold=0.2)
¶
Initialize bottom-up ONNX wrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Module
|
Bottom-up model producing confidence maps and PAFs. |
required |
skeleton_edges
|
list
|
List of (src, dst) edge tuples defining skeleton. |
required |
n_nodes
|
int
|
Number of nodes in the skeleton. |
required |
max_peaks_per_node
|
int
|
Maximum peaks to detect per node type. |
20
|
n_line_points
|
int
|
Points to sample along PAF edges. |
10
|
cms_output_stride
|
int
|
Confidence map output stride. |
4
|
pafs_output_stride
|
int
|
PAF output stride. |
8
|
max_edge_length_ratio
|
float
|
Maximum edge length as ratio of image size. |
0.25
|
dist_penalty_weight
|
float
|
Weight for distance penalty in scoring. |
1.0
|
input_scale
|
float
|
Input scaling factor. |
1.0
|
peak_threshold
|
float
|
Minimum confidence for a peak to be considered valid. |
0.2
|
Source code in sleap_nn/export/wrappers/bottomup.py
forward(image)
¶
Run bottom-up inference and return fixed-size outputs.
Note: confmaps and pafs are NOT returned to avoid D2H transfer bottleneck. Peak detection and PAF scoring are performed on GPU within this wrapper.
Source code in sleap_nn/export/wrappers/bottomup.py
CenteredInstanceONNXWrapper
¶
Bases: BaseExportWrapper
ONNX-exportable wrapper for centered-instance models.
Expects input images as uint8 tensors in [0, 255].
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize centered instance ONNX wrapper. |
forward |
Run centered-instance inference on crops. |
Source code in sleap_nn/export/wrappers/centered_instance.py
__init__(model, output_stride=4, input_scale=1.0, peak_threshold=0.2)
¶
Initialize centered instance ONNX wrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Module
|
Centered instance model for pose estimation. |
required |
output_stride
|
int
|
Output stride for confidence maps. |
4
|
input_scale
|
float
|
Input scaling factor. |
1.0
|
peak_threshold
|
float
|
Minimum confidence for a peak to be considered valid. |
0.2
|
Source code in sleap_nn/export/wrappers/centered_instance.py
forward(image)
¶
Run centered-instance inference on crops.
Source code in sleap_nn/export/wrappers/centered_instance.py
CentroidONNXWrapper
¶
Bases: BaseExportWrapper
ONNX-exportable wrapper for centroid models.
Expects input images as uint8 tensors in [0, 255].
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize centroid ONNX wrapper. |
forward |
Run centroid inference and return fixed-size outputs. |
Source code in sleap_nn/export/wrappers/centroid.py
__init__(model, max_instances=20, output_stride=2, input_scale=1.0, peak_threshold=0.2)
¶
Initialize centroid ONNX wrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Module
|
Centroid detection model. |
required |
max_instances
|
int
|
Maximum number of instances to detect. |
20
|
output_stride
|
int
|
Output stride for confidence maps. |
2
|
input_scale
|
float
|
Input scaling factor. |
1.0
|
peak_threshold
|
float
|
Minimum confidence for a peak to be considered valid. |
0.2
|
Source code in sleap_nn/export/wrappers/centroid.py
forward(image)
¶
Run centroid inference and return fixed-size outputs.
Source code in sleap_nn/export/wrappers/centroid.py
EmbeddingONNXWrapper
¶
Bases: BaseExportWrapper
Wrap an embedding model for ONNX export: crop -> appearance vector.
The simplest wrapper (single input/output, no peak finding): WHOLE-crop per-crop
standardize the input, run the encoder + head, optionally L2-normalize. Output:
{"embedding": (B, D)}.
Parity: this exactly reproduces native inference for a burn_in=False embedder
(whose _standardize also normalizes over the whole crop). A burn_in=True
embedder standardizes over the FOREGROUND (mask) only and fills the background, which
this single-input graph cannot replicate — its exported embeddings therefore DIVERGE
from native masked inference. The export CLI records burn_in/background_fill
in the metadata and warns on a burn_in=True export; use the native
sleap-nn predict ... --save_embeddings slp path for exact parity with such
a model.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize. |
forward |
image: (B, C, H, W) [0, 255] -> {"embedding": (B, D)}. |
Source code in sleap_nn/export/wrappers/embedding.py
__init__(model, normalize=True, eps=1e-05)
¶
Initialize.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
The underlying |
required | |
normalize
|
bool
|
L2-normalize the output embedding. |
True
|
eps
|
float
|
Standardization epsilon. |
1e-05
|
Source code in sleap_nn/export/wrappers/embedding.py
forward(image)
¶
image: (B, C, H, W) [0, 255] -> {"embedding": (B, D)}.
Replicates EmbeddingLightningModule._standardize's MASKLESS path exactly
(i.e. the burn_in=False native path): reduce over the spatial dims only so
each channel is standardized independently. For grayscale (C=1) this is the plain
per-crop standardize; for RGB (C=3) it is a true per-channel zero-mean/unit-std,
matching the PyTorch inference path. Computing the count from a ones tensor
(rather than a baked H*W constant) keeps the graph valid under dynamic spatial
axes. NOTE: a burn_in=True model's masked (foreground-only) standardize is NOT
reproduced here — see the class docstring.
Source code in sleap_nn/export/wrappers/embedding.py
SingleInstanceONNXWrapper
¶
Bases: BaseExportWrapper
ONNX-exportable wrapper for single-instance models.
This wrapper handles full-frame inference assuming a single instance per frame. For each body part (channel), it finds the global maximum in the confidence map.
Expects input images as uint8 tensors in [0, 255].
Attributes:
| Name | Type | Description |
|---|---|---|
model |
The trained backbone model that outputs confidence maps. |
|
output_stride |
Output stride of the model (e.g., 4 means confmaps are ¼ the input resolution). |
|
input_scale |
Factor to scale input images before inference. |
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize the single-instance wrapper. |
forward |
Run single-instance inference. |
Source code in sleap_nn/export/wrappers/single_instance.py
__init__(model, output_stride=4, input_scale=1.0, peak_threshold=0.2)
¶
Initialize the single-instance wrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Module
|
The trained backbone model. |
required |
output_stride
|
int
|
Output stride of the model. Default: 4. |
4
|
input_scale
|
float
|
Factor to scale input images. Default: 1.0. |
1.0
|
peak_threshold
|
float
|
Minimum confidence for a peak to be considered valid. |
0.2
|
Source code in sleap_nn/export/wrappers/single_instance.py
forward(image)
¶
Run single-instance inference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Tensor
|
Input image tensor of shape (batch, channels, height, width). Expected as uint8 [0, 255] values. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Tensor]
|
Dictionary with: peaks: Peak coordinates of shape (batch, n_nodes, 2) in (x, y) format. peak_vals: Peak confidence values of shape (batch, n_nodes). |
Source code in sleap_nn/export/wrappers/single_instance.py
TopDownMultiClassCombinedONNXWrapper
¶
Bases: BaseExportWrapper
ONNX-exportable wrapper for combined centroid + multiclass instance models.
This wrapper combines a centroid detection model with a centered instance multiclass model. It performs: 1. Centroid detection on full images 2. Cropping around each centroid using vectorized grid_sample 3. Instance keypoint detection + identity classification on each crop
Expects input images as uint8 tensors in [0, 255].
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize the combined wrapper. |
forward |
Run combined top-down multiclass inference. |
Source code in sleap_nn/export/wrappers/topdown_multiclass.py
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 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 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 | |
__init__(centroid_model, instance_model, max_instances=20, crop_size=(192, 192), centroid_output_stride=4, instance_output_stride=2, centroid_input_scale=1.0, instance_input_scale=1.0, n_nodes=13, n_classes=2, centroid_peak_threshold=0.2, instance_peak_threshold=0.2)
¶
Initialize the combined wrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
centroid_model
|
Module
|
Model for centroid detection. |
required |
instance_model
|
Module
|
Model for instance keypoints + class prediction. |
required |
max_instances
|
int
|
Maximum number of instances to detect. |
20
|
crop_size
|
tuple
|
Size of crops around centroids (height, width). |
(192, 192)
|
centroid_output_stride
|
int
|
Output stride of centroid model. |
4
|
instance_output_stride
|
int
|
Output stride of instance model. |
2
|
centroid_input_scale
|
float
|
Input scale for centroid model. |
1.0
|
instance_input_scale
|
float
|
Input scale for instance model. |
1.0
|
n_nodes
|
int
|
Number of keypoint nodes per instance. |
13
|
n_classes
|
int
|
Number of identity classes. |
2
|
centroid_peak_threshold
|
float
|
Minimum confidence for centroid peaks. |
0.2
|
instance_peak_threshold
|
float
|
Minimum confidence for instance peaks. |
0.2
|
Source code in sleap_nn/export/wrappers/topdown_multiclass.py
forward(image)
¶
Run combined top-down multiclass inference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Tensor
|
Input image tensor of shape (batch, channels, height, width). Expected to be uint8 in [0, 255]. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Tensor]
|
Dictionary with keys: - "centroids": Detected centroids (batch, max_instances, 2). - "centroid_vals": Centroid confidence values (batch, max_instances). - "peaks": Instance peaks (batch, max_instances, n_nodes, 2). - "peak_vals": Peak values (batch, max_instances, n_nodes). - "class_logits": Class logits per instance (batch, max_instances, n_classes). - "instance_valid": Validity mask (batch, max_instances). |
Source code in sleap_nn/export/wrappers/topdown_multiclass.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
TopDownMultiClassONNXWrapper
¶
Bases: BaseExportWrapper
ONNX-exportable wrapper for top-down multiclass (supervised ID) models.
This wrapper handles models that output both confidence maps for keypoint detection and class logits for identity classification. It runs on instance crops (centered around detected centroids).
Expects input images as uint8 tensors in [0, 255].
Attributes:
| Name | Type | Description |
|---|---|---|
model |
The underlying PyTorch model (centered instance + class vectors heads). |
|
output_stride |
Output stride of the confmap head. |
|
input_scale |
Scale factor applied to input images before inference. |
|
n_classes |
Number of identity classes. |
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize the wrapper. |
forward |
Run top-down multiclass inference on crops. |
Source code in sleap_nn/export/wrappers/topdown_multiclass.py
__init__(model, output_stride=2, input_scale=1.0, n_classes=2, peak_threshold=0.2)
¶
Initialize the wrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Module
|
The underlying PyTorch model. |
required |
output_stride
|
int
|
Output stride of the confidence maps. |
2
|
input_scale
|
float
|
Scale factor for input images. |
1.0
|
n_classes
|
int
|
Number of identity classes (e.g., 2 for male/female). |
2
|
peak_threshold
|
float
|
Minimum confidence for a peak to be considered valid. |
0.2
|
Source code in sleap_nn/export/wrappers/topdown_multiclass.py
forward(image)
¶
Run top-down multiclass inference on crops.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Tensor
|
Input image tensor of shape (batch, channels, height, width). Expected to be uint8 in [0, 255]. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Tensor]
|
Dictionary with keys: - "peaks": Predicted peak coordinates (batch, n_nodes, 2) in (x, y). - "peak_vals": Peak confidence values (batch, n_nodes). - "class_logits": Raw class logits (batch, n_classes). The class assignment is done on CPU using Hungarian matching
via |
Source code in sleap_nn/export/wrappers/topdown_multiclass.py
TopDownONNXWrapper
¶
Bases: BaseExportWrapper
ONNX-exportable wrapper for top-down (centroid + centered-instance) inference.
Expects input images as uint8 tensors in [0, 255].
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize top-down ONNX wrapper. |
forward |
Run top-down inference and return fixed-size outputs. |
Source code in sleap_nn/export/wrappers/topdown.py
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 184 185 186 187 188 | |
__init__(centroid_model, instance_model, max_instances=20, crop_size=(192, 192), centroid_output_stride=2, instance_output_stride=4, centroid_input_scale=1.0, instance_input_scale=1.0, n_nodes=1, centroid_peak_threshold=0.2, instance_peak_threshold=0.2)
¶
Initialize top-down ONNX wrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
centroid_model
|
Module
|
Centroid detection model. |
required |
instance_model
|
Module
|
Instance pose estimation model. |
required |
max_instances
|
int
|
Maximum number of instances to detect. |
20
|
crop_size
|
Tuple[int, int]
|
Size of instance crops (height, width). |
(192, 192)
|
centroid_output_stride
|
int
|
Centroid model output stride. |
2
|
instance_output_stride
|
int
|
Instance model output stride. |
4
|
centroid_input_scale
|
float
|
Centroid input scaling factor. |
1.0
|
instance_input_scale
|
float
|
Instance input scaling factor. |
1.0
|
n_nodes
|
int
|
Number of skeleton nodes. |
1
|
centroid_peak_threshold
|
float
|
Minimum confidence for centroid peaks. |
0.2
|
instance_peak_threshold
|
float
|
Minimum confidence for instance peaks. |
0.2
|
Source code in sleap_nn/export/wrappers/topdown.py
forward(image)
¶
Run top-down inference and return fixed-size outputs.