Skip to content

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

Open
@award96

Description

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions