Skip to main content

Loader for Roboflow datasets.

Project description

Roboflow Python Library

This is a helper library to load your Roboflow datasets into your python scripts and Jupyter notebooks.


This package requires python >=3.6 and a (free) Roboflow account.


With PIP

pip install roboflow

With Anaconda

conda install roboflow


The roboflow package works in conjunction with your Roboflow account.

From your Account page, click Roboflow Keys to get your API key. You can then use the roboflow python package to manage downloading your datasets in various formats.

import roboflow
roboflow.auth("<<YOUR API KEY>>")
info = roboflow.load("chess-sample", 1, "tfrecord")

# dataset is now downloaded and unzipped in your current directory
# and info contains the paths you need to load it into your favorite
# machine learning libraries

By default the folder is named


(For example, Chess Sample.v1-small-gray.coco).

The file hierarchy is three folders containing the train, valid, and test data you selected in the Roboflow upload flow (and the format you specified in roboflow.load above). There is also a README.roboflow.txt describing the preprocessing and augmentation steps and, optionally, a README.dataset.txt provided by the person who shared the dataset.

Example file layout

Doing Inference

It's important to pre-process your images for inference the same way you pre-processed your training images. For this, get a pre-processor via the roboflow.infer method which will return a function you can use to pre-process your images.

import roboflow
roboflow.auth("<<YOUR API KEY>>")
process = roboflow.preprocessor("chess-sample", 1)
images = process.fromFile("example.jpg") # returns a numpy array (of 1 image, unless you used tiling)


This package currently provides two main benefits over downloading and loading your datasets manually.

  1. If you have previously loaded your dataset, it will automatically use the local copy rather than re-downloading.
  2. You can dynamically choose the export format at runtime rather than export-time.


We plan to include more features in the future to allow you (for example, to let you easily do inference on your trained models).

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roboflow-0.0.2.tar.gz (3.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page