Search for an Image

You can search for one or more images in your dataset with the Python package.

The Roboflow Python package has a search_all() method that lets you search through images in a dataset. You can search using a text prompt, using an existing image in yuor dataset as a reference for semantic search, using tags, class names, and more.

import roboflow

roboflow.login()

rf = roboflow.Roboflow()

project = rf.project("PROJECT_ID")

records = []

for page in project.search_all(
    prompt="mug",
    like_image = image_id,
    offset = 0,
    limit = 100,
    tag = "tag",
    class_name = "class_name",
    in_dataset = True,
    batch = False,
    batch_id = "batch_id",
    fields = ["id", "created", "name", "labels"],
):
    records.extend(page)

print(len(records))

The code above shows all of the arguments you can pass into the search_all() function.

Last updated

Was this helpful?