Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added instructions for extracting bounding boxes #1312

Merged
merged 11 commits into from
Aug 20, 2023
10 changes: 6 additions & 4 deletions YOLONAS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ YOLO-NAS's architecture employs quantization-aware blocks and selective quantiza

## Quickstart

## Extract bounding boxes
```python
import super_gradients

yolo_nas = super_gradients.training.models.get("yolo_nas_l", pretrained_weights="coco").cuda()
yolo_nas.predict("https://deci-pretrained-models.s3.amazonaws.com/sample_images/beatles-abbeyroad.jpg").show()
prediction = output[0].prediction
bboxes = prediction.bboxes_xyxy # [[Xmin,Ymin,Xmax,Ymax],..] list of all annotation(s) for detected object(s)
class_names = prediction.class_names. # ['Class1', 'Class2', ...] List of the class names
class_name_indexes = prediction.labels.astype(int) # [2, 3, 1, 1, 2, ....] Index of each detected object in class_names(corresponding to each bounding box)
confidences = prediction.confidence.astype(float) # [0.3, 0.1, 0.9, ...] Confidence value(s) in float for each bounding boxes
AkashParua marked this conversation as resolved.
Show resolved Hide resolved
```

![YOLO-NAS Predict Demo](documentation/source/images/yolo_nas_predict_demo.png)
Expand Down