Skip to content

Commit 375504e

Browse files
authored
Merge pull request #431 from roboflow/fix_readme_create_project
Updated readme - usage of python sdk
2 parents 9be8068 + ee0ccf3 commit 375504e

File tree

2 files changed

+24
-30
lines changed

2 files changed

+24
-30
lines changed

README.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,19 @@ Below are some common methods used with the Roboflow Python package, presented c
104104
```python
105105
import roboflow
106106

107-
roboflow.login()
107+
# Pass API key or use roboflow.login()
108+
rf = roboflow.Roboflow(api_key="MY_API_KEY")
108109

109-
rf = roboflow.Roboflow()
110+
workspace = rf.workspace()
110111

111-
# create a project
112-
rf.create_project(
113-
project_name="project name",
114-
project_type="project-type",
115-
license="project-license" # "private" for private projects
112+
# creating object detection model that will detect flowers
113+
project = workspace.create_project(
114+
project_name="Flower detector",
115+
project_type="object-detection", # Or "classification", "instance-segmentation", "semantic-segmentation"
116+
project_license="MIT", # "private" for private projects, only available for paid customers
117+
annotation="flowers" # If you plan to annotate lillys, sunflowers, etc.
116118
)
117119

118-
workspace = rf.workspace("WORKSPACE_URL")
119-
project = workspace.project("PROJECT_URL")
120-
version = project.version("VERSION_NUMBER")
121-
122120
# upload a dataset
123121
workspace.upload_dataset(
124122
dataset_path="./dataset/",
@@ -128,12 +126,9 @@ workspace.upload_dataset(
128126
project_type="object-detection"
129127
)
130128

131-
# upload model weights
132-
version.deploy(model_type="yolov8", model_path=f”{HOME}/runs/detect/train/”)
129+
version = project.version("VERSION_NUMBER")
133130

134131
# upload model weights - yolov10
135-
# Before attempting to upload YOLOv10 models install ultralytics like this:
136-
# pip install git+https://github.com/THU-MIG/yolov10.git
137132
version.deploy(model_type="yolov10", model_path=f”{HOME}/runs/detect/train/”, filename="weights.pt")
138133

139134
# run inference

docs/index.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,18 @@ Below are some common methods used with the Roboflow Python package, presented c
6868
```python
6969
import roboflow
7070

71-
roboflow.login()
72-
73-
rf = roboflow.Roboflow()
74-
75-
# create a project
76-
rf.create_project(
77-
project_name="project name",
78-
project_type="project-type",
79-
license="project-license" # "private" for private projects
71+
# Pass API key or use roboflow.login()
72+
rf = roboflow.Roboflow(api_key="MY_API_KEY")
73+
74+
workspace = rf.workspace()
75+
# creating object detection model that will detect flowers
76+
project = workspace.create_project(
77+
project_name="Flower detector",
78+
project_type="object-detection", # Or "classification", "instance-segmentation", "semantic-segmentation"
79+
project_license="MIT", # "private" for private projects, only available for paid customers
80+
annotation="flowers" # If you plan to annotate lillys, sunflowers, etc.
8081
)
8182

82-
workspace = rf.workspace("WORKSPACE_URL")
83-
project = workspace.project("PROJECT_URL")
84-
version = project.version("VERSION_NUMBER")
85-
8683
# upload a dataset
8784
workspace.upload_dataset(
8885
dataset_path="./dataset/",
@@ -92,8 +89,10 @@ workspace.upload_dataset(
9289
project_type="object-detection"
9390
)
9491

95-
# upload model weights
96-
version.deploy(model_type="yolov8", model_path=f”{HOME}/runs/detect/train/”)
92+
version = project.version("VERSION_NUMBER")
93+
94+
# upload model weights - yolov10
95+
version.deploy(model_type="yolov10", model_path=f”{HOME}/runs/detect/train/”, filename="weights.pt")
9796

9897
# run inference
9998
model = version.model

0 commit comments

Comments
 (0)