Skip to content

Commit 3abc9a6

Browse files
authored
Merge pull request #153 from fastlabel/feature/dataset-create
feat: dataset create
2 parents f5314c1 + 7f58170 commit 3abc9a6

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,8 @@ Create a new dataset.
21252125
dataset = client.create_dataset(
21262126
name="Japanese Dogs",
21272127
slug="japanese-dogs",
2128-
type="image"
2128+
type="image",
2129+
annotation_type="image_bbox"
21292130
)
21302131
```
21312132

@@ -2681,10 +2682,11 @@ if __name__ == '__main__':
26812682
```
26822683

26832684
## Model Monitoring
2685+
26842686
### Create Request Results
2685-
You can integrate the results of model endpoint calls,
2686-
which are targeted for aggregation in model monitoring, from an external source.
26872687

2688+
You can integrate the results of model endpoint calls,
2689+
which are targeted for aggregation in model monitoring, from an external source.
26882690

26892691
```python
26902692
from datetime import datetime

examples/create_dataset.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from pprint import pprint
2+
3+
import fastlabel
4+
5+
client = fastlabel.Client()
6+
7+
dataset = client.create_dataset(
8+
name="Japanese Dogs",
9+
slug="japanese-dogs",
10+
type="video",
11+
annotation_type="image_bbox",
12+
)
13+
pprint(dataset)

fastlabel/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434

3535
class Client:
36-
3736
api = None
3837

3938
def __init__(self):
@@ -3315,19 +3314,22 @@ def create_dataset(
33153314
type: str,
33163315
name: str,
33173316
slug: str,
3317+
annotation_type: str,
33183318
) -> dict:
33193319
"""
33203320
Create a dataset.
33213321
33223322
type can be 'image', 'video', 'audio' (Required).
33233323
name is name of your dataset (Required).
33243324
slug is slug of your dataset (Required).
3325+
annotation_type can be 'none', 'image_bbox' (Required).
33253326
"""
33263327
endpoint = "datasets"
33273328
payload = {
33283329
"type": type,
33293330
"name": name,
33303331
"slug": slug,
3332+
"annotationType": annotation_type,
33313333
}
33323334
return self.api.post_request(endpoint, payload=payload)
33333335

0 commit comments

Comments
 (0)