from transformers import pipeline
checkpoint = "google/owlv2-base-patch16-ensemble"
detector = pipeline(model=checkpoint, task="zero-shot-object-detection")

Next, choose an image you'd like to detect objects in. Here we'll use the image of astronaut Eileen Collins that is
a part of the NASA Great Images dataset.

import skimage
import numpy as np
from PIL import Image
image = skimage.data.astronaut()
image = Image.fromarray(np.uint8(image)).convert("RGB")
image