Skip to content

Add search and search_all attributes - #151

Merged
Jacobsolawetz merged 4 commits into
mainfrom
add-search
Jul 11, 2023
Merged

Jacobsolawetz merged 4 commits into
mainfrom
add-search

Conversation

@capjamesg

@capjamesg capjamesg commented May 27, 2023

Copy link
Copy Markdown
Contributor

Description

This PR introduces two new methods:

  • search: Returns the search results for a dataset search query.
  • search_all: Returns a generator that yields pages of search results.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

You can test this feature using the following code:

import roboflow

roboflow.login()

rf = roboflow.Roboflow()

# List all projects for your workspace
workspace = rf.workspace()

project = rf.project("mug-detector-23eqf")

# List all versions of a specific project
print(project.search(
    prompt="mug"
))

records = []

for page in project.search_all(
    prompt="mug"
):
    records.extend(page)

print(len(records))

You will need to specify your own dataset ID.

Any specific deployment considerations

N/A

Docs

I will update our quickstart docs on Gitbook once we release this feature.

@capjamesg
capjamesg requested a review from Jacobsolawetz May 27, 2023 12:03
@capjamesg capjamesg self-assigned this May 27, 2023

@Jacobsolawetz Jacobsolawetz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Jacobsolawetz

Copy link
Copy Markdown
Contributor

Be sure to make style

@capjamesg

Copy link
Copy Markdown
Contributor Author

Done!

@capjamesg

Copy link
Copy Markdown
Contributor Author

Let me know when you get the chance to release this in the pip package!

@Jacobsolawetz
Jacobsolawetz merged commit 781c553 into main Jul 11, 2023
@Jacobsolawetz
Jacobsolawetz deleted the add-search branch July 11, 2023 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants