Closed rvryan67 closed 8 months ago
Since 3.6 when input is a single image, the prediction result is not iterable object anymore.
No need in for p in model_predictions
:
model_predictions = yolo_nas.predict(url, conf=conf, iou=0.1, fuse_model=False)
model_predictions.prediction.bboxes_xyxy
How do I get detected labels in print format,as in 3.5 version we can use loop to get that but In latest version it is producing an error using loop so how we can get detected objects in output format
https://github.com/Deci-AI/super-gradients/issues/1801#issuecomment-1916521475 Please see the solution here
anyone who have solved it>??
I don't know if it useful or not, but I was having same error and surrounded with try except worked for me:
for image_name, image in ds.images.items():
try:
result = best_model.predict(image, conf=CONFIDENCE_TRESHOLD, fuse_model=False)
except ImageDetectionPrediction as ecc:
print("ERROR: ", ecc)
detections = sv.Detections(
xyxy=result.prediction.bboxes_xyxy,
confidence=result.prediction.confidence,
class_id=result.prediction.labels.astype(int)
)
predictions[image_name] = detections
🐛 Describe the bug
I'm getting the following error with latest version 3.6.
I wasn't getting this error in version 3.5
TypeError: 'ImageDetectionPrediction' object is not iterable
<class 'super_gradients.training.utils.predict.prediction_results.ImageDetectionPrediction'>
Versions
-