Super Gradients Integration¶
FiftyOne integrates natively with Deci AI’s SuperGradients library, so you can run inference with YOLO-NAS architectures on your FiftyOne datasets with just a few lines of code!
Setup¶
To get started with
SuperGradients, just install
the super-gradients
package:
pip install super-gradients
Inference¶
You can directly pass SuperGradients YOLO-NAS models to your FiftyOne dataset’s
apply_model()
method:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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) |
Model zoo¶
SuperGradients YOLO-NAS is also available directly from the FiftyOne Model Zoo!
1 2 3 4 5 6 7 8 9 | 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) |