Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing roboflow and running the quick start code doesn't work #358

Open
award96 opened this issue Feb 7, 2025 · 0 comments
Open

Installing roboflow and running the quick start code doesn't work #358

award96 opened this issue Feb 7, 2025 · 0 comments

Comments

@award96
Copy link

award96 commented Feb 7, 2025

import roboflow

roboflow.login()

rf = roboflow.Roboflow()

create a project

copypastecode.py", line 8, in
rf.create_project(
^^^^^^^^^^^^^^^^^
AttributeError: 'Roboflow' object has no attribute 'create_project'

I am using version 1.1.53 on Mac osx

rf.create_project(
project_name="project name",
project_type="project-type",
license="project-license" # "private" for private projects
)

workspace = rf.workspace("WORKSPACE_URL")
project = workspace.project("PROJECT_URL")
version = project.version("VERSION_NUMBER")

upload a dataset

workspace.upload_dataset(
dataset_path="./dataset/",
num_workers=10,
dataset_format="yolov8", # supports yolov8, yolov5, and Pascal VOC
project_license="MIT",
project_type="object-detection"
)

upload model weights

version.deploy(model_type="yolov8", model_path=f"{HOME}/runs/detect/train/")

upload model weights - yolov10

Before attempting to upload YOLOv10 models install ultralytics like this:

pip install git+https://github.com/THU-MIG/yolov10.git

version.deploy(model_type="yolov10", model_path=f"{HOME}/runs/detect/train/", filename="weights.pt")

run inference

model = version.model

img_url = "https://media.roboflow.com/quickstart/aerial_drone.jpeg"

predictions = model.predict(img_url, hosted=True).json()

print(predictions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant