Skip to content

Commit 53d41a2

Browse files
authored
New docs search export (#439)
* new release number * update docs with search export
1 parent 7fee9f4 commit 53d41a2

File tree

3 files changed

+89
-2
lines changed

3 files changed

+89
-2
lines changed

CLI-COMMANDS.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ $ roboflow --help
88
```
99

1010
```
11-
usage: roboflow [-h] {login,download,upload,import,infer,project,workspace} ...
11+
usage: roboflow [-h] {login,download,upload,import,infer,search-export,project,workspace} ...
1212
1313
Welcome to the roboflow CLI: computer vision at your fingertips 🪄
1414
1515
options:
1616
-h, --help show this help message and exit
1717
1818
subcommands:
19-
{login,download,upload,import,infer,project,workspace}
19+
{login,download,upload,import,infer,search-export,project,workspace}
2020
login Log in to Roboflow
2121
download Download a dataset version from your workspace or Roboflow Universe.
2222
upload Upload a single image to a dataset
2323
import Import a dataset from a local folder
2424
infer perform inference on an image
25+
search-export Export search results as a dataset
2526
project project related commands. type 'roboflow project' to see detailed command help
2627
workspace workspace related commands. type 'roboflow workspace' to see detailed command help
2728
```
@@ -245,3 +246,45 @@ roboflow infer -w roboflow-58fyf -m rock-paper-scissors-sxsw/11 ~/scissors.png
245246
"prediction_type": "ObjectDetectionModel"
246247
}
247248
```
249+
250+
## Example: search and export a dataset
251+
252+
Use Roboflow's search to query images across your workspace and export matching results as a dataset. This is useful when you want to create a dataset from specific search criteria (e.g. images with a certain class, tag, or other metadata).
253+
254+
```bash
255+
$ roboflow search-export --help
256+
```
257+
```
258+
usage: roboflow search-export [-h] [-f FORMAT] [-w WORKSPACE] [-l LOCATION] [-d DATASET] [-g ANNOTATION_GROUP] [-n NAME] [--no-extract] query
259+
260+
positional arguments:
261+
query Search query (e.g. 'tag:annotate' or '*')
262+
263+
options:
264+
-h, --help show this help message and exit
265+
-f FORMAT Annotation format (default: coco)
266+
-w WORKSPACE Workspace url or id (uses default workspace if not specified)
267+
-l LOCATION Local directory to save the export
268+
-d DATASET Limit export to a specific dataset (project slug)
269+
-g ANNOTATION_GROUP Limit export to a specific annotation group
270+
-n NAME Optional name for the export
271+
--no-extract Skip extraction, keep the zip file
272+
```
273+
274+
Export all images tagged "annotate" in COCO format:
275+
276+
```bash
277+
$ roboflow search-export "tag:annotate"
278+
```
279+
280+
Export images containing a specific class, limited to one dataset, in COCO format:
281+
282+
```bash
283+
$ roboflow search-export "class:person" -f coco -d my-dataset -l ~/exports/people
284+
```
285+
286+
```
287+
Export started (id=abc123). Polling for completion...
288+
Downloading search export to /Users/tony/exports/people: 100%|██████████| 5420/5420 [00:02<00:00, 2710.00it/s]
289+
Search export extracted to /Users/tony/exports/people
290+
```

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,28 @@ predictions = model.predict(img_url, hosted=True).json()
141141
print(predictions)
142142
```
143143

144+
### Search and Export
145+
146+
Search for images across your workspace and export matching results as a ready-to-use dataset:
147+
148+
```python
149+
workspace = rf.workspace()
150+
151+
# Export images matching a search query
152+
workspace.search_export(
153+
query="class:person", # search query (e.g. "tag:review", "class:dog", "*")
154+
format="coco", # annotation format: coco, yolov8, yolov5, voc, etc.
155+
dataset="my-project", # optional: limit to a specific project
156+
location="./my-export", # optional: output directory
157+
)
158+
```
159+
160+
Or from the CLI:
161+
162+
```bash
163+
roboflow search-export "class:person" -f coco -d my-project -l ./my-export
164+
```
165+
144166
## Library Structure
145167

146168
The Roboflow Python library is structured using the same Workspace, Project, and Version ontology that you will see in the Roboflow application.

docs/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,28 @@ predictions = model.predict(img_url, hosted=True).json()
104104
print(predictions)
105105
```
106106

107+
### Search and Export
108+
109+
Search for images across your workspace and export matching results as a ready-to-use dataset:
110+
111+
```python
112+
workspace = rf.workspace()
113+
114+
# Export images matching a search query
115+
workspace.search_export(
116+
query="class:person", # search query (e.g. "tag:review", "class:dog", "*")
117+
format="coco", # annotation format: coco, yolov8, yolov5, voc, etc.
118+
dataset="my-project", # optional: limit to a specific project
119+
location="./my-export", # optional: output directory
120+
)
121+
```
122+
123+
Or from the CLI:
124+
125+
```bash
126+
roboflow search-export "class:person" -f coco -d my-project -l ./my-export
127+
```
128+
107129
## Library Structure
108130

109131
The Roboflow Python library is structured using the same Workspace, Project, and Version ontology that you will see in the Roboflow application.

0 commit comments

Comments
 (0)