Roboflow Python Library

Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless. This is the official Roboflow python package that interfaces with the Roboflow API. Key features of Roboflow:

Installation:

To install this package, please use Python 3.6 or higher. We provide three different ways to install the Roboflow
package to use within your own projects.

Install from PyPi (Recommended):

pip install roboflow

Install from Source:

git clone https://github.com/roboflow-ai/roboflow-python.git
cd roboflow-python
python3 -m venv
source venv/bin/activate 
pip3 install -r requirements.txt

Quickstart

import roboflow

# Instantiate Roboflow object with your API key
rf = Roboflow(api_key=YOUR_API_KEY_HERE)

# List all projects for your workspace
workspace = rf.workspace()

# Load a certain project, workspace url is optional
project = rf.project("PROJECT_ID")

# List all versions of a specific project
project.versions()

# Upload image to dataset
project.upload("UPLOAD_IMAGE.jpg")

# Retrieve the model of a specific project
project.version("1").model

# predict on a local image
prediction = model.predict("YOUR_IMAGE.jpg")

# Predict on a hosted image
prediction = model.predict("YOUR_IMAGE.jpg", hosted=True)

# Plot the prediction
prediction.plot()

# Convert predictions to JSON
prediction.json()

# Save the prediction as an image
prediction.save(output_path='predictions.jpg')
GitHub - roboflow-ai/roboflow-python: Interface with Roboflow in Python
Interface with Roboflow in Python. Contribute to roboflow-ai/roboflow-python development by creating an account on GitHub.