def draw_boxes_and_labels(image, bbox, labels, class_names):
img_copy = image.copy()
for i in range(len(bbox)):
x, y, w, h = bbox[i].numpy().astype('int')
cv2.rectangle(img_copy, (x, y), (w, h), (0, 0, 255), 5)
class_index = labels[i].numpy().astype('int')
class_detected = class_names[class_index - 1]
cv2.putText(img_copy, class_detected, (x, y + 100), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 255, 0), 2, cv2.LINE_AA)
return img_copy