Skip to content

Commit 408f470

Browse files
committed
removed key
1 parent d11f5e1 commit 408f470

File tree

1 file changed

+69
-35
lines changed

1 file changed

+69
-35
lines changed
Lines changed: 69 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
{
2-
"nbformat": 4,
3-
"nbformat_minor": 2,
4-
"metadata": {},
52
"cells": [
63
{
4+
"cell_type": "markdown",
75
"metadata": {},
86
"source": [
9-
"<td>",
10-
" <a target=\"_blank\" href=\"https://labelbox.com\" ><img src=\"https://labelbox.com/blog/content/images/2021/02/logo-v4.svg\" width=256/></a>",
7+
"<td>\n",
8+
" <a target=\"_blank\" href=\"https://labelbox.com\" ><img src=\"https://labelbox.com/blog/content/images/2021/02/logo-v4.svg\" width=256/></a>\n",
119
"</td>\n"
12-
],
13-
"cell_type": "markdown"
10+
]
1411
},
1512
{
13+
"cell_type": "markdown",
1614
"metadata": {},
1715
"source": [
1816
"<td>\n",
@@ -24,10 +22,10 @@
2422
"<a href=\"https://github.com/Labelbox/labelbox-python/tree/develop/examples/integrations/yolo/import_yolo_annotations.ipynb\" target=\"_blank\"><img\n",
2523
"src=\"https://img.shields.io/badge/GitHub-100000?logo=github&logoColor=white\" alt=\"GitHub\"></a>\n",
2624
"</td>"
27-
],
28-
"cell_type": "markdown"
25+
]
2926
},
3027
{
28+
"cell_type": "markdown",
3129
"metadata": {},
3230
"source": [
3331
"# Import YOLOv8 annotations\n",
@@ -36,76 +34,112 @@
3634
"* Setting up our ontology that matches our YOLOv8 annotations\n",
3735
"* Importing our data rows and attaching our ontology to a project\n",
3836
"* Running our images through Ultralytics then importing the annotations generated\n"
39-
],
40-
"cell_type": "markdown"
37+
]
4138
},
4239
{
40+
"cell_type": "markdown",
4341
"metadata": {},
4442
"source": [
4543
"## Set up"
46-
],
47-
"cell_type": "markdown"
44+
]
4845
},
4946
{
50-
"metadata": {},
51-
"source": "%pip install -q --upgrade \"labelbox[data]\"\n%pip install -q --upgrade ultralytics",
5247
"cell_type": "code",
48+
"execution_count": null,
49+
"metadata": {},
5350
"outputs": [],
54-
"execution_count": null
51+
"source": [
52+
"%pip install -q --upgrade \"labelbox[data]\"\n",
53+
"%pip install -q --upgrade ultralytics"
54+
]
5555
},
5656
{
57-
"metadata": {},
58-
"source": "import labelbox as lb\nimport labelbox.types as lb_types\nimport uuid\nimport ultralytics\nfrom ultralytics.engine.model import Model\nfrom ultralytics.engine.results import Results",
5957
"cell_type": "code",
58+
"execution_count": null,
59+
"metadata": {},
6060
"outputs": [],
61-
"execution_count": null
61+
"source": [
62+
"import labelbox as lb\n",
63+
"import labelbox.types as lb_types\n",
64+
"import uuid\n",
65+
"import ultralytics\n",
66+
"from ultralytics.engine.model import Model\n",
67+
"from ultralytics.engine.results import Results"
68+
]
6269
},
6370
{
71+
"cell_type": "markdown",
6472
"metadata": {},
6573
"source": [
6674
"## API key and client\n",
6775
"Provide a valid API key below in order to properly connect to the Labelbox client. Please review [Create API key guide](https://docs.labelbox.com/reference/create-api-key) for more information."
68-
],
69-
"cell_type": "markdown"
76+
]
7077
},
7178
{
72-
"metadata": {},
73-
"source": "API_KEY = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjbG9vcmRpaGUwMDkyMDcza2Nvcm5jajdnIiwib3JnYW5pemF0aW9uSWQiOiJjbG9vcmRpZ3cwMDkxMDcza2M2cG9oeWFiIiwiYXBpS2V5SWQiOiJjbHhhZnpkcWgwMmZqMDd5MTdramllZW8xIiwic2VjcmV0IjoiZjkxMmZhMzMwOTRmOGMxYzFkN2QzNTY2NTMxMzEyNDMiLCJpYXQiOjE3MTgxMTI3NjksImV4cCI6MjM0OTI2NDc2OX0.4wY66g9LaP5xFHoSeleAgTK75CX7wxKMsaIbX0nI_qc\"\nclient = lb.Client(api_key=API_KEY)",
7479
"cell_type": "code",
80+
"execution_count": null,
81+
"metadata": {},
7582
"outputs": [],
76-
"execution_count": null
83+
"source": [
84+
"API_KEY = None\n",
85+
"client = lb.Client(api_key=API_KEY)"
86+
]
7787
},
7888
{
89+
"cell_type": "markdown",
7990
"metadata": {},
8091
"source": [
8192
"## Example: Import YOLOv8 Annotations\n",
8293
"\n",
8394
"The first few steps of this guide will demonstrating a basic workflow of creating data rows and setting up a project. For a quick complete overview of this process visit our [Quick start](https://docs.labelbox.com/reference/quick-start) guide."
84-
],
85-
"cell_type": "markdown"
95+
]
8696
},
8797
{
98+
"cell_type": "markdown",
8899
"metadata": {},
89100
"source": [
90101
"### Importing an image data row\n",
91102
"\n",
92103
"We will be using this [image](https://storage.googleapis.com/labelbox-datasets/image_sample_data/2560px-Kitano_Street_Kobe01s5s4110.jpeg) to be annotated with YOLOv8. Which has a lot of objects that can be picked up by YOLOv8. Later in this guide we will go into more detail on the exact annotations."
93-
],
94-
"cell_type": "markdown"
104+
]
95105
},
96106
{
97-
"metadata": {},
98-
"source": "# create data row\ndata_row = {\n \"row_data\":\n \"https://storage.googleapis.com/labelbox-datasets/image_sample_data/2560px-Kitano_Street_Kobe01s5s4110.jpeg\",\n \"global_key\":\n str(uuid.uuid4()),\n \"media_type\":\n \"IMAGE\",\n}\n\n# create dataset and import data row\ndataset = client.create_dataset(name=\"YOLOv8 Demo Dataset\")\ntask = dataset.create_data_rows([data_row])\ntask.wait_till_done()\n\nprint(f\"Errors: {task.errors}\")",
99107
"cell_type": "code",
108+
"execution_count": null,
109+
"metadata": {},
100110
"outputs": [],
101-
"execution_count": null
111+
"source": [
112+
"# create data row\n",
113+
"data_row = {\n",
114+
" \"row_data\":\n",
115+
" \"https://storage.googleapis.com/labelbox-datasets/image_sample_data/2560px-Kitano_Street_Kobe01s5s4110.jpeg\",\n",
116+
" \"global_key\":\n",
117+
" str(uuid.uuid4()),\n",
118+
" \"media_type\":\n",
119+
" \"IMAGE\",\n",
120+
"}\n",
121+
"\n",
122+
"# create dataset and import data row\n",
123+
"dataset = client.create_dataset(name=\"YOLOv8 Demo Dataset\")\n",
124+
"task = dataset.create_data_rows([data_row])\n",
125+
"task.wait_till_done()\n",
126+
"\n",
127+
"print(f\"Errors: {task.errors}\")"
128+
]
102129
},
103130
{
131+
"cell_type": "markdown",
104132
"metadata": {},
105133
"source": [
106134
"### Setting up an ontology and a project\n"
107-
],
108-
"cell_type": "markdown"
135+
]
109136
}
110-
]
111-
}
137+
],
138+
"metadata": {
139+
"language_info": {
140+
"name": "python"
141+
}
142+
},
143+
"nbformat": 4,
144+
"nbformat_minor": 2
145+
}

0 commit comments

Comments
 (0)