YoloNAS Model¶
modern_yolonas.model.YoloNAS
¶
Bases: Module
YOLO-NAS object detection model.
Attributes backbone, neck, heads mirror the super-gradients
top-level structure for state_dict key compatibility.
Source code in src/modern_yolonas/model.py
forward_features(x)
¶
Run backbone and neck and return every intermediate feature map.
The detection head is skipped entirely — this is the representation the
model builds before it commits to boxes and classes, which is what an
image-retrieval or re-identification pipeline wants. See
:class:~modern_yolonas.inference.embed.YoloNASEmbedder for the
image-in, vector-out wrapper around it.
Deliberately a separate method rather than a flag on forward: the
signature of forward is what ONNX export, the Frigate graph, the
parity tests and the FX-traced quantization path all depend on.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Normalized input batch, |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Tensor]
|
|
dict[str, Tensor]
|
are the backbone outputs ( |
dict[str, Tensor]
|
neck's fused pyramid levels. At 640x640 the strides are 4, 8, 16, 32 |
dict[str, Tensor]
|
for |
Source code in src/modern_yolonas/model.py
Factory functions¶
modern_yolonas.yolo_nas_s(pretrained=False, num_classes=80)
¶
Create a YOLO-NAS S model.
Source code in src/modern_yolonas/__init__.py
modern_yolonas.yolo_nas_m(pretrained=False, num_classes=80)
¶
Create a YOLO-NAS M model.
Source code in src/modern_yolonas/__init__.py
modern_yolonas.yolo_nas_l(pretrained=False, num_classes=80)
¶
Create a YOLO-NAS L model.