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
"Model Slice functions similarly to Catalog Slice, with both essentially being saved searches. However, there are key differences in their functionalities. While Catalog Slice searches within a specific data catalog, Model Slice extends its data row search across a model run in a model. You can construct a Model Slice by using one or more filters to curate a collection of data rows. Often users will combine filters to surface high-impact data and then save the results as a Model Slice.\n",
36
+
"\n",
37
+
"This notebook is used to go over some common Labelbox SDK methods to interact with Model Slices created through the Labelbox platform.\n",
38
+
"\n",
39
+
"See [Slices](https://docs.labelbox.com/docs/slices-1) for more information on modifying Model Slices."
40
+
],
41
+
"cell_type": "markdown"
42
+
},
43
+
{
44
+
"metadata": {},
45
+
"source": [
46
+
"!pip install labelbox"
47
+
],
48
+
"cell_type": "code",
49
+
"outputs": [],
50
+
"execution_count": null
51
+
},
52
+
{
53
+
"metadata": {},
54
+
"source": [
55
+
"import labelbox as lb\n",
56
+
"import uuid"
57
+
],
58
+
"cell_type": "code",
59
+
"outputs": [],
60
+
"execution_count": null
61
+
},
62
+
{
63
+
"metadata": {},
64
+
"source": [
65
+
"## API Key and Client\n",
66
+
"See the developer guide for [creating an API key](https://docs.labelbox.com/reference/create-api-key)."
67
+
],
68
+
"cell_type": "markdown"
69
+
},
70
+
{
71
+
"metadata": {},
72
+
"source": [
73
+
"# Add your API key\n",
74
+
"API_KEY = \"\"\n",
75
+
"# To get your API key go to: Workspace settings -> API -> Create API Key\n",
76
+
"client = lb.Client(api_key=API_KEY)"
77
+
],
78
+
"cell_type": "code",
79
+
"outputs": [],
80
+
"execution_count": null
81
+
},
82
+
{
83
+
"metadata": {},
84
+
"source": [
85
+
"## Create Model Slice\n",
86
+
"\n",
87
+
"In order to interact with model slices, you must create a Model Experiment with a Model Run and then create a Model Slice through the platform. The steps below go over this process. See [Model](https://docs.labelbox.com/reference/model) from our developer guides for more information."
88
+
],
89
+
"cell_type": "markdown"
90
+
},
91
+
{
92
+
"metadata": {},
93
+
"source": [
94
+
"### Creating Model Experiment\n",
95
+
"\n",
96
+
"To create a Model Experiment you will need to create an ontology. See [Ontology](https://docs.labelbox.com/reference/ontology) for more information"
"### Creating a Model Run from Model Experiment\n",
160
+
"\n",
161
+
"On this step we will need to create a dataset to attach data rows to our model run. See [Dataset](https://docs.labelbox.com/reference/dataset) for more information."
162
+
],
163
+
"cell_type": "markdown"
164
+
},
165
+
{
166
+
"metadata": {},
167
+
"source": [
168
+
"#### Dataset and Data Rows"
169
+
],
170
+
"cell_type": "markdown"
171
+
},
172
+
{
173
+
"metadata": {},
174
+
"source": [
175
+
"# send a sample image as data row for a dataset\n",
"Creating a Model Slice is currently not supported through the SDK, however, to showcase how to interact with Model Slice, we are going to generate a Model Slice through the UI.\n",
232
+
"\n",
233
+
"#### Workflow\n",
234
+
"\n",
235
+
"1. Navigate to ***Model*** section of the Labelbox Platform, select the ***Experiment*** type, and select the Model Experiment that was created.\n",
236
+
"2. You must have a filter created in order to save a slice. For this example, click ***Search your data*** dropdown and then ***Data row***.\n",
237
+
"3. Change ***is one of*** dropdown to ***is not one of*** then type \"test\" into the ***Search for an id*** search box.\n",
238
+
"4. Hit ***Enter*** and select ***Save slice***.\n",
239
+
"5. Give the slice a name and select ***Save***.\n",
240
+
"6. Above the ***Search your data*** dropdown you will see your slice's name. Select that dropdown and click ***Copy slice ID***.\n",
0 commit comments