22 "cells" : [
33 {
44 "cell_type" : " markdown" ,
5+ "metadata" : {},
56 "source" : [
67 " <td>\n " ,
78 " <a target=\" _blank\" href=\" https://labelbox.com\" ><img src=\" https://labelbox.com/blog/content/images/2021/02/logo-v4.svg\" width=256/></a>\n " ,
89 " </td>"
9- ],
10- "metadata" : {}
10+ ]
1111 },
1212 {
1313 "cell_type" : " markdown" ,
14+ "metadata" : {},
1415 "source" : [
1516 " <td>\n " ,
1617 " <a href=\" https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/basics/projects.ipynb\" target=\" _blank\" ><img\n " ,
2122 " <a href=\" https://github.com/Labelbox/labelbox-python/tree/develop/examples/basics/projects.ipynb\" target=\" _blank\" ><img\n " ,
2223 " src=\" https://img.shields.io/badge/GitHub-100000?logo=github&logoColor=white\" alt=\" GitHub\" ></a>\n " ,
2324 " </td>"
24- ],
25- "metadata" : {}
25+ ]
2626 },
2727 {
2828 "cell_type" : " markdown" ,
29+ "metadata" : {},
2930 "source" : [
3031 " # Projects"
31- ],
32- "metadata" : {}
32+ ]
3333 },
3434 {
3535 "cell_type" : " markdown" ,
36+ "metadata" : {},
3637 "source" : [
3738 " * A project can be thought of as a specific labeling task on a set of labels\n " ,
3839 " * That set of labels is defined by the datasets attached to the project\n " ,
4142 " \n " ,
4243 " ** Note that there is a lot of advanced usage that is not covered in this notebook. See project_setup for those functions.\n " ,
4344 " * Also note that deprecated functions are not explained here."
44- ],
45- "metadata" : {}
45+ ]
4646 },
4747 {
4848 "cell_type" : " code" ,
4949 "execution_count" : 1 ,
50+ "metadata" : {},
51+ "outputs" : [],
5052 "source" : [
5153 " !pip install labelbox"
52- ],
53- "outputs" : [],
54- "metadata" : {}
54+ ]
5555 },
5656 {
5757 "cell_type" : " code" ,
5858 "execution_count" : 2 ,
59+ "metadata" : {},
60+ "outputs" : [],
5961 "source" : [
6062 " from labelbox import Client\n " ,
63+ " from labelbox.schema.media_type import MediaType\n " ,
6164 " import os"
62- ],
63- "outputs" : [],
64- "metadata" : {}
65+ ]
6566 },
6667 {
6768 "cell_type" : " markdown" ,
69+ "metadata" : {},
6870 "source" : [
6971 " # API Key and Client\n " ,
7072 " Provide a valid api key below in order to properly connect to the Labelbox Client."
71- ],
72- "metadata" : {}
73+ ]
7374 },
7475 {
7576 "cell_type" : " code" ,
7677 "execution_count" : 5 ,
78+ "metadata" : {},
79+ "outputs" : [],
7780 "source" : [
7881 " # Add your api key\n " ,
7982 " API_KEY = None\n " ,
8083 " client = Client(api_key=API_KEY)"
81- ],
82- "outputs" : [],
83- "metadata" : {}
84+ ]
8485 },
8586 {
8687 "cell_type" : " markdown" ,
88+ "metadata" : {},
8789 "source" : [
8890 " ### Create\n "
89- ],
90- "metadata" : {}
91+ ]
9192 },
9293 {
9394 "cell_type" : " code" ,
9495 "execution_count" : 6 ,
96+ "metadata" : {},
97+ "outputs" : [],
9598 "source" : [
96- " # Creates an empty project\n " ,
99+ " # Creates an empty project without a media type \n " ,
97100 " project = client.create_project(name=\" my-test-project\" ,\n " ,
98- " description=\" a description\" )"
99- ],
100- "outputs" : [],
101- "metadata" : {}
101+ " description=\" a description\" )\n " ,
102+ " \n " ,
103+ " # Creates an empty project a media type\n " ,
104+ " project = client.create_project(name=\" my-test-project\" ,\n " ,
105+ " description=\" a description\" ,\n " ,
106+ " media_type=MediaType.Image)"
107+ ]
102108 },
103109 {
104110 "cell_type" : " markdown" ,
111+ "metadata" : {},
105112 "source" : [
106113 " ### Read"
107- ],
108- "metadata" : {}
114+ ]
109115 },
110116 {
111117 "cell_type" : " code" ,
112118 "execution_count" : null ,
119+ "metadata" : {},
120+ "outputs" : [],
113121 "source" : [
114122 " # Note the project is not setup (so a lot of these fiels are empty). Follow the project setup workflow\n " ,
115123 " print(\" Project is not setup yet:\" , project.setup_complete is None)\n " ,
116124 " print(\" Project name:\" , project.name)\n " ,
117125 " print(\" Project description:\" , project.description)\n " ,
126+ " print(\" Media Type:\" , project.media_type)\n " ,
118127 " print(\" Dataset:\" , list(project.datasets()))\n " ,
119128 " print(\" Ontology:\" , project.ontology().normalized)\n " ,
120129 " print(\" Benchmarks:\" , project.benchmarks())"
121- ],
122- "outputs" : [],
123- "metadata" : {}
130+ ]
124131 },
125132 {
126133 "cell_type" : " markdown" ,
134+ "metadata" : {},
127135 "source" : [
128136 " ### Update\n " ,
129137 " \n "
130- ],
131- "metadata" : {}
138+ ]
132139 },
133140 {
134141 "cell_type" : " code" ,
135142 "execution_count" : null ,
143+ "metadata" : {},
144+ "outputs" : [],
136145 "source" : [
137146 " # Attach dataset\n " ,
138147 " ds = client.create_dataset(name=\" test-ds\" )\n " ,
139148 " project.datasets.connect(ds)\n " ,
140149 " print([ds.name for ds in project.datasets()])\n " ,
141150 " ds.delete()"
142- ],
143- "outputs" : [],
144- "metadata" : {}
151+ ]
145152 },
146153 {
147154 "cell_type" : " markdown" ,
155+ "metadata" : {},
148156 "source" : [
149157 " ### Delete"
150- ],
151- "metadata" : {}
158+ ]
152159 },
153160 {
154161 "cell_type" : " code" ,
155162 "execution_count" : 9 ,
163+ "metadata" : {},
164+ "outputs" : [],
156165 "source" : [
157166 " project.delete()"
158- ],
159- "outputs" : [],
160- "metadata" : {}
167+ ]
161168 }
162169 ],
163170 "metadata" : {
181188 },
182189 "nbformat" : 4 ,
183190 "nbformat_minor" : 5
184- }
191+ }
0 commit comments