def plot_img(df, idx, image_dir, pred_bboxes=None):
    row = df.iloc[idx]
    video_id = row.video_id
    video_frame = row.video_frame
    annotations_str = row.annotations
    img = load_image_with_annotations(video_id, video_frame, image_dir, annotations_str)
    if (pred_bboxes and (len(pred_bboxes) > 0)):
        pred_bboxes = pred_bboxes[pred_bboxes[:, 0].argsort()[::(- 1)]]
        img = draw_predictions(img, pred_bboxes)
    plt.imshow(img[:, :, ::(- 1)])
def plot_img(df, idx, image_dir, pred_bboxes=None):
    row = df.iloc[idx]
    video_id = row.video_id
    video_frame = row.video_frame
    annotations_str = row.annotations
    img = load_image_with_annotations(video_id, video_frame, image_dir, annotations_str)
    if (pred_bboxes and (len(pred_bboxes) > 0)):
        pred_bboxes = pred_bboxes[pred_bboxes[:, 0].argsort()[::(- 1)]]
        img = draw_predictions(img, pred_bboxes)
    plt.imshow(img[:, :, ::(- 1)])