1

I need to change the label font and bounding box color, in the inference

i have assigned a variable for torch hub model and pass it to running the inference but coudnt change the bounding box color and and text font

model = torch.hub.load('ultralytics/yolov5', 'custom', path=r'C:\Users\rohin\Desktop\NewData\yolo training\last.pt', force_reload=True)
cap = cv2.VideoCapture(0)
while cap.isOpened():
    ret, frame = cap.read()

    # Make detections
    results = model(frame)

    cv2.imshow('YOLO', np.squeeze(results.render()))

    if cv2.waitKey(10) & 0xFF == ord('q'):
        break
cap.release()
cv2.destroyAllWindows()



rohin
  • 31
  • 2

0 Answers0