<!-- # hard line break macro for HTML -->

<a id="super-gradients-integration"></a>

# Super Gradients Integration


<div class="available-in">
    <div class="available-in-row">
        <span class="available-in-label">Available in:</span>
        <span class="available-in-pill available-in-pill--oss">Open Source</span><span class="available-in-pill available-in-pill--enterprise">Enterprise</span>
    </div>
    <div class="available-in-row">
        <span class="available-in-versions">Introduced in <a href="../release-notes.html#fiftyone-0-23-3">FiftyOne 0.23.3</a> &middot; <a href="../release-notes.html#fiftyone-enterprise-1-5-4">FiftyOne Enterprise 1.5.4</a></span>
    </div>
    
</div>

FiftyOne integrates natively with Deci AI’s
[SuperGradients](https://github.com/Deci-AI/super-gradients) library, so you
can run inference with YOLO-NAS architectures on your FiftyOne datasets with
just a few lines of code!

<a id="super-gradients-setup"></a>

## Setup

To get started with
[SuperGradients](https://github.com/Deci-AI/super-gradients), just install
the `super-gradients` package:

```shell
pip install super-gradients
```

<a id="super-gradients-inference"></a>

## Inference

You can directly pass SuperGradients YOLO-NAS models to your FiftyOne dataset’s
[`apply_model()`](../api/fiftyone.core.collections.md#fiftyone.core.collections.SampleCollection.apply_model)
method:

```python
import fiftyone as fo
import fiftyone.zoo as foz

from super_gradients.training import models

dataset = foz.load_zoo_dataset("quickstart", max_samples=25)
dataset.select_fields().keep_fields()

model = models.get("yolo_nas_m", pretrained_weights="coco")
# model = models.get("yolo_nas_l", pretrained_weights="coco")
# model = models.get("yolo_nas_s", pretrained_weights="coco")

dataset.apply_model(model, label_field="yolo_nas", confidence_thresh=0.7)

session = fo.launch_app(dataset)
```

<a id="super-gradients-model-zoo"></a>

## Model zoo

SuperGradients YOLO-NAS is also available directly from the
[FiftyOne Model Zoo](../model_zoo/models/yolo_nas_torch.md#model-zoo-yolo-nas-torch)!

```python
import fiftyone as fo
import fiftyone.zoo as foz

model = foz.load_zoo_model("yolo-nas-torch")

dataset = foz.load_zoo_dataset("quickstart")
dataset.apply_model(model, label_field="yolo_nas")

session = fo.launch_app(dataset)
```
