roboflow/roboflow-python

The official Roboflow Python package. Manage your datasets, models, and deployments. Roboflow has everything you need to build a computer vision application.

📦 What is roboflow‑python?

Roboflow‑python is the official Python client for Roboflow, a platform that helps you build, train, and deploy computer‑vision models. The library lets you talk to the Roboflow service from your own code – creating projects, uploading images and annotations, kicking off training jobs, and running inference on models that live in the cloud (or on a self‑hosted inference server).


🔧 Key capabilities (as described in the README)

Area What you can do with the package
Workspace & project management Create new projects, list existing ones, search for images, and export datasets in common formats (COCO, YOLO, VOC, etc.).
Dataset handling Upload local image folders with annotations, choose the annotation format, and let Roboflow store and version the data.
Model training Trigger training of vision models (object‑detection, classification, segmentation, …) directly on the Roboflow platform.
Model deployment & inference Deploy trained weights to a Roboflow version, then call model.predict(...) to get predictions from a hosted model or from a self‑hosted Roboflow‑Inference server.
CLI A subset of the library is exposed as a command‑line tool for quick actions like authentication, searching, and exporting datasets.
Lightweight install roboflow-slim strips heavy dependencies (OpenCV, NumPy, Pillow) for embedded or CI environments.

🚀 Typical workflow (quick‑start example)

import roboflow

# Authenticate – either via login() or by passing an API key
rf = roboflow.Roboflow(api_key="YOUR_KEY")
workspace = rf.workspace()

# Create a new object‑detection project
project = workspace.create_project(
    project_name="Flower detector",
    project_type="object-detection",
    project_license="MIT",
    annotation="flowers",
)

# Upload a prepared dataset folder (YOLOv8 format in the example)
workspace.upload_dataset(
    dataset_path="./dataset/",
    dataset_format="yolov8",
    project_type="object-detection",
)

# Pick a version, deploy custom weights, and run inference
version = project.version("1")
version.deploy(model_type="yolov10", model_path="/runs/detect/train/", filename="weights.pt")
model = version.models()[0]
pred = model.predict("https://example.com/image.jpg", hosted=True).json()
print(pred)

The same steps can be performed from the terminal using the provided CLI commands.


📦 Installation notes

  • Standard install – pip install roboflow (includes image‑processing libs like OpenCV, Pillow, NumPy).
  • Optional extras – roboflow[desktop] for desktop‑specific features, roboflow[heic] to add HEIC/HEIF decoding via pillow‑heif.
  • Slim version – pip install roboflow-slim drops the heavy dependencies, shrinking the package from ~400 MB to ~50 MB – useful for edge devices or serverless functions.
  • From source – clone the repo and run pip install . inside a virtual environment.

🌍 Where it fits in the AI ecosystem

Roboflow‑python is not a training framework itself (it doesn’t implement YOLO, Faster‑RCNN, etc.). Instead, it is a service client that orchestrates data and model lifecycle on the Roboflow platform. It sits alongside other AI‑ops tools that manage datasets, experiments, and deployments, making it easier for developers to integrate computer‑vision pipelines into Python applications without handling the low‑level infrastructure.


🙋‍♀️ Who should use this?

  • Developers building apps that need vision capabilities and want to offload training/inference to a managed service.
  • Data scientists who prefer a programmatic way to version datasets, run augmentations, and launch training jobs.
  • Edge/CI engineers who need a tiny client (roboflow-slim) to interact with the platform from constrained environments.

📚 Further reading

Related

  • Project
  • Project
  • Project
  • Project
  • Project