No output on console
💡 Your Question
I am trying to print the bounding box cordinates , labels and confidence , everything is working fine but it is not printing the output.
Code snippet
import cv2 from super_gradients.common.object_names import Models from super_gradients.training import models image = cv2.imread('Videos/test3.jpg') image = cv2.resize(image,(1000,500)) img = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) model = models.get(Models.YOLO_NAS_L, pretrained_weights="coco") results = list(model.predict(img)) box = list(results[0].prediction.bboxes_xyxy) lab = list(results[0].prediction.labels) conf_list = list(results[0].prediction.confidence) print(box) print(lab) print(conf_list)
Versions
No response
Any chance you are using 'silent_mode' in training hyperparameters?
Any chance you are using 'silent_mode' in training hyperparameters?
Silent_mode is set False, still no output getting printed.
I can confirm this happens to me as well when using Colab.
ah, I'm also experiencing this issue. It looks like something in the super_gradients library is redirecting stdout.
print("a")
from super_gradients.training import models
print("b")
print("c", flush=True)
crash=crash
print("d")
print("e", flush=True)
will only print "a" and then correctly crash at the crash=crash line
You can wrap the import with a stored stdout to undo the redirect.
import sys
stdout = sys.stdout
from super_gradients.training import models
sys.stdout = stdout