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."
34
-
],
35
-
"cell_type": "markdown"
35
+
]
36
36
},
37
37
{
38
+
"attachments": {},
39
+
"cell_type": "markdown",
38
40
"metadata": {},
39
41
"source": [
40
42
"# Image Data Export"
41
-
],
42
-
"cell_type": "markdown"
43
+
]
43
44
},
44
45
{
46
+
"cell_type": "code",
47
+
"execution_count": null,
45
48
"metadata": {},
49
+
"outputs": [],
46
50
"source": [
47
51
"!pip install \"labelbox[data]\" -q"
48
-
],
49
-
"cell_type": "code",
50
-
"outputs": [],
51
-
"execution_count": null
52
+
]
52
53
},
53
54
{
55
+
"cell_type": "code",
56
+
"execution_count": null,
54
57
"metadata": {},
58
+
"outputs": [],
55
59
"source": [
56
60
"import labelbox as lb"
57
-
],
58
-
"cell_type": "code",
59
-
"outputs": [],
60
-
"execution_count": null
61
+
]
61
62
},
62
63
{
64
+
"attachments": {},
65
+
"cell_type": "markdown",
63
66
"metadata": {},
64
67
"source": [
65
68
"# API Key and Client\n",
66
69
"Provide a valid api key below in order to properly connect to the Labelbox Client."
67
-
],
68
-
"cell_type": "markdown"
70
+
]
69
71
},
70
72
{
73
+
"cell_type": "code",
74
+
"execution_count": null,
71
75
"metadata": {},
76
+
"outputs": [],
72
77
"source": [
73
78
"# Add your api key\n",
74
79
"API_KEY = \"API KEY here\"\n",
75
80
"client = lb.Client(api_key=API_KEY)"
76
-
],
77
-
"cell_type": "code",
78
-
"outputs": [],
79
-
"execution_count": null
81
+
]
80
82
},
81
83
{
84
+
"attachments": {},
85
+
"cell_type": "markdown",
82
86
"metadata": {},
83
87
"source": [
84
88
"# Export data rows from a project\n",
85
89
"\n",
86
90
"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",
87
91
"\n",
88
92
"You can view the JSON export formats for each data type here: https://docs.labelbox.com/reference/label-export#export-specifications"
89
-
],
90
-
"cell_type": "markdown"
93
+
]
91
94
},
92
95
{
96
+
"cell_type": "code",
97
+
"execution_count": null,
93
98
"metadata": {},
99
+
"outputs": [],
94
100
"source": [
95
101
"# Set the export params to include/exclude certain fields. Make sure each of these fields are correctly grabbed \n",
96
102
"export_params= {\n",
@@ -121,12 +127,11 @@
121
127
"\n",
122
128
"export_json = export_task.result\n",
123
129
"print(\"results: \", export_json)"
124
-
],
125
-
"cell_type": "code",
126
-
"outputs": [],
127
-
"execution_count": null
130
+
]
128
131
},
129
132
{
133
+
"attachments": {},
134
+
"cell_type": "markdown",
130
135
"metadata": {},
131
136
"source": [
132
137
"# Export from a dataset\n",
@@ -136,11 +141,13 @@
136
141
"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",
137
142
"\n",
138
143
"As shown below, the project_ids and model_run_ids parameters accept a list of IDs"
139
-
],
140
-
"cell_type": "markdown"
144
+
]
141
145
},
142
146
{
147
+
"cell_type": "code",
148
+
"execution_count": null,
143
149
"metadata": {},
150
+
"outputs": [],
144
151
"source": [
145
152
"# Set the export params to include/exclude certain fields. Make sure each of these fields are correctly grabbed \n",
146
153
"export_params= {\n",
@@ -169,20 +176,21 @@
169
176
" print(export_task.errors)\n",
170
177
"export_json = export_task.result\n",
171
178
"print(\"results: \", export_json)"
172
-
],
173
-
"cell_type": "code",
174
-
"outputs": [],
175
-
"execution_count": null
179
+
]
176
180
},
177
181
{
182
+
"attachments": {},
183
+
"cell_type": "markdown",
178
184
"metadata": {},
179
185
"source": [
180
186
"# Export from a slice"
181
-
],
182
-
"cell_type": "markdown"
187
+
]
183
188
},
184
189
{
190
+
"cell_type": "code",
191
+
"execution_count": null,
185
192
"metadata": {},
193
+
"outputs": [],
186
194
"source": [
187
195
"# Set the export params to include/exclude certain fields. Make sure each of these fields are correctly grabbed \n",
188
196
"export_params= {\n",
@@ -204,26 +212,28 @@
204
212
" print(export_task.errors)\n",
205
213
"export_json = export_task.result\n",
206
214
"print(\"results: \", export_json)"
207
-
],
208
-
"cell_type": "code",
209
-
"outputs": [],
210
-
"execution_count": null
215
+
]
211
216
},
212
217
{
218
+
"attachments": {},
219
+
"cell_type": "markdown",
213
220
"metadata": {},
214
221
"source": [
215
222
"# Export data rows from a model run"
216
-
],
217
-
"cell_type": "markdown"
223
+
]
218
224
},
219
225
{
226
+
"cell_type": "code",
227
+
"execution_count": null,
220
228
"metadata": {},
229
+
"outputs": [],
221
230
"source": [
222
231
"# Set the export params to include/exclude certain fields. Make sure each of these fields are correctly grabbed \n",
223
232
"export_params= {\n",
224
233
"\"attachments\": True,\n",
225
234
"\"metadata_fields\": True,\n",
226
235
"\"data_row_details\": True,\n",
236
+
"\"predictions\": True,\n",
227
237
"}\n",
228
238
"\n",
229
239
"model_run = client.get_model_run(\"Enter Model run ID\")\n",
0 commit comments