Python Package

Navigating the pip package

Most Roboflow users will interact with the platform through their web UI, but often times, workflows require Python integrations. The gold-standard for python packages is pip provided by PyPi.

The python package, over time, will be able to handle all actions you can perform on the web UI programmatically; although, for now a select number of operations are able to be performed. Please request any functionality you might need on the roboflow-python repository.


You can either install Roboflow through the PyPi package:

pip install roboflow

or manually through the GitHub:

git clone
cd roboflow-python
python3 -m venv
source venv/bin/activate
pip3 install -r requirements.txt


The Python Package allows you to:

  1. List information about workspaces, projects, and versions.

  2. Upload images to your projects.

  3. Perform inference with specific model versions.

  4. Visualize, and save predictions that you've made on the model.

Everything in the package works through the Roboflow() object. You must pass your private API key to the object, which can be found under the settings of your workspace. Full instructions for obtaining your API Key can be found here.

from roboflow import Roboflow
rf = Roboflow(api_key="YOUR_API_KEY")

You can then list all projects for your workspace or access the information for a specific project:

my_projects = rf.projects() # or
project = rf.project("project-id")

You can upload a local image to this project by doing:


Next, if you want to access the versions of a specific project:

all_versions = project.versions() # or
version = project.version(1)

If you've trained a model on this version, you can perform inference on the model with either a local or hosted image:

model = version.model
prediction = model.predict("YOUR_IMAGE.jpg") # or
prediction_hosted = model.predict("", hosted=True)

You can plot and save a visualization of the prediction.


Or access your model's prediction as JSON.


To Be Continued

Just like the Roboflow REST API, our vision for the Roboflow Python pip package is to eventually reach feature parity with our web UI so you can automate and integrate any part of your Roboflow workflow into your own codebase.