Hello,
it seems like the code
            cv2.rectangle(
                img=image,
                pt1=(box_x-box_w//2, box_y-box_h//2),
                pt2=(box_x+box_w//2, box_y+box_h//2),
                color=(255, 0, 0),
                thickness=3
            )

is considering box_x and box_y as the center of the rectangle but in the COCO dataset, it represents the top left corner of the rectangle. So, the rectangle drawing should be something like this?
            cv2.rectangle(
                img=image,
                pt1=(box_x, box_y), # top left corner
                pt2=(box_x+box_w, box_y+box_h), # bottom right corner
                color=(255, 0, 0),
                thickness=3
            )