You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"How to export data, with examples for each type of export along with details on optional parameters and filters."
35
-
]
34
+
],
35
+
"cell_type": "markdown"
36
36
},
37
37
{
38
-
"attachments": {},
39
-
"cell_type": "markdown",
40
38
"metadata": {},
41
39
"source": [
42
40
"# Image Data Export"
43
-
]
41
+
],
42
+
"cell_type": "markdown"
44
43
},
45
44
{
46
-
"cell_type": "code",
47
-
"execution_count": null,
48
45
"metadata": {},
49
-
"outputs": [],
50
46
"source": [
51
47
"!pip install \"labelbox[data]\" -q"
52
-
]
48
+
],
49
+
"cell_type": "code",
50
+
"outputs": [],
51
+
"execution_count": null
53
52
},
54
53
{
55
-
"cell_type": "code",
56
-
"execution_count": null,
57
54
"metadata": {},
58
-
"outputs": [],
59
55
"source": [
60
56
"import labelbox as lb"
61
-
]
57
+
],
58
+
"cell_type": "code",
59
+
"outputs": [],
60
+
"execution_count": null
62
61
},
63
62
{
64
-
"attachments": {},
65
-
"cell_type": "markdown",
66
63
"metadata": {},
67
64
"source": [
68
65
"# API Key and Client\n",
69
66
"Provide a valid api key below in order to properly connect to the Labelbox Client."
70
-
]
67
+
],
68
+
"cell_type": "markdown"
71
69
},
72
70
{
73
-
"cell_type": "code",
74
-
"execution_count": null,
75
71
"metadata": {},
76
-
"outputs": [],
77
72
"source": [
78
73
"# Add your api key\n",
79
74
"API_KEY = \"API KEY here\"\n",
80
75
"client = lb.Client(api_key=API_KEY)"
81
-
]
76
+
],
77
+
"cell_type": "code",
78
+
"outputs": [],
79
+
"execution_count": null
82
80
},
83
81
{
84
-
"attachments": {},
85
-
"cell_type": "markdown",
86
82
"metadata": {},
87
83
"source": [
88
84
"# Export data rows from a project\n",
89
85
"\n",
90
86
"When you export data rows from a project, you can narrow down your data rows by last_activity_at, label_created_at, and data_row_ids. Then, when you export from a project, you may choose to include or exclude certain attributes in your export.\n",
91
87
"\n",
92
88
"You can view the JSON export formats for each data type here: https://docs.labelbox.com/reference/label-export#export-specifications"
93
-
]
89
+
],
90
+
"cell_type": "markdown"
94
91
},
95
92
{
96
-
"cell_type": "code",
97
-
"execution_count": null,
98
93
"metadata": {},
99
-
"outputs": [],
100
94
"source": [
101
95
"# Set the export params to include/exclude certain fields. Make sure each of these fields are correctly grabbed \n",
102
96
"export_params= {\n",
@@ -107,8 +101,10 @@
107
101
"\"performance_details\": True\n",
108
102
"}\n",
109
103
"\n",
110
-
"# You can set the range for last_activity_at and label_created_at. You can also set a list of data \n",
111
-
"# row ids to export. \n",
104
+
"# You can set the range for last_activity_at and label_created_at in one these formats: \n",
105
+
"# YYYY-MM-DD or YYYY-MM-DD hh:mm:ss or ISO 8601 format which is YYYY-MM-DDThh:mm:ss\u00b1hhmm\n",
106
+
"# The ISO 8061 allows you to specify the timezone, but the other two formats assume timezone from the user's workspace settings.\n",
107
+
"# You can also set a list of data row ids to export. \n",
112
108
"# For context, last_activity_at captures the creation and modification of labels, metadata, status, comments and reviews.\n",
113
109
"\n",
114
110
"# Note: This is an AND logic between the filters, so usually using one filter is sufficient.\n",
@@ -127,11 +123,12 @@
127
123
"\n",
128
124
"export_json = export_task.result\n",
129
125
"print(\"results: \", export_json)"
130
-
]
126
+
],
127
+
"cell_type": "code",
128
+
"outputs": [],
129
+
"execution_count": null
131
130
},
132
131
{
133
-
"attachments": {},
134
-
"cell_type": "markdown",
135
132
"metadata": {},
136
133
"source": [
137
134
"# Export from a dataset\n",
@@ -141,13 +138,11 @@
141
138
"When exporting from Catalog, you can include information about a data row from all projects and model runs to which it belongs. Specifically, for the selected data rows, you can export the labels from multiple projects and/or the predictions from multiple model runs.\n",
142
139
"\n",
143
140
"As shown below, the project_ids and model_run_ids parameters accept a list of IDs"
144
-
]
141
+
],
142
+
"cell_type": "markdown"
145
143
},
146
144
{
147
-
"cell_type": "code",
148
-
"execution_count": null,
149
145
"metadata": {},
150
-
"outputs": [],
151
146
"source": [
152
147
"# Set the export params to include/exclude certain fields. Make sure each of these fields are correctly grabbed \n",
153
148
"export_params= {\n",
@@ -176,21 +171,20 @@
176
171
" print(export_task.errors)\n",
177
172
"export_json = export_task.result\n",
178
173
"print(\"results: \", export_json)"
179
-
]
174
+
],
175
+
"cell_type": "code",
176
+
"outputs": [],
177
+
"execution_count": null
180
178
},
181
179
{
182
-
"attachments": {},
183
-
"cell_type": "markdown",
184
180
"metadata": {},
185
181
"source": [
186
182
"# Export from a slice"
187
-
]
183
+
],
184
+
"cell_type": "markdown"
188
185
},
189
186
{
190
-
"cell_type": "code",
191
-
"execution_count": null,
192
187
"metadata": {},
193
-
"outputs": [],
194
188
"source": [
195
189
"# Set the export params to include/exclude certain fields. Make sure each of these fields are correctly grabbed \n",
196
190
"export_params= {\n",
@@ -212,21 +206,20 @@
212
206
" print(export_task.errors)\n",
213
207
"export_json = export_task.result\n",
214
208
"print(\"results: \", export_json)"
215
-
]
209
+
],
210
+
"cell_type": "code",
211
+
"outputs": [],
212
+
"execution_count": null
216
213
},
217
214
{
218
-
"attachments": {},
219
-
"cell_type": "markdown",
220
215
"metadata": {},
221
216
"source": [
222
217
"# Export data rows from a model run"
223
-
]
218
+
],
219
+
"cell_type": "markdown"
224
220
},
225
221
{
226
-
"cell_type": "code",
227
-
"execution_count": null,
228
222
"metadata": {},
229
-
"outputs": [],
230
223
"source": [
231
224
"# Set the export params to include/exclude certain fields. Make sure each of these fields are correctly grabbed \n",
0 commit comments