Skip to main content

python client for the Roboflow application

Project description

Roboflow Python Library


roboflow logo

WebsiteDocsBlogTwitterLinkedinUniverse

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 env
source env/bin/activate 
pip3 install -r requirements.txt

Quickstart

import roboflow

# Instantiate Roboflow object with your API key
rf = roboflow.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')

Using this package for a specifc project

If you have a specific project from your workspace you'd like to run in a notebook follow along on this tutorial Downloading Datasets from Roboflow for Training (Python)

Selecting the format you'd like your project to be exported as while choosing the show download code option will display code snippets you can use in either Jupyter or your terminal. These code snippets will include your api_key, project, and workspace names.

Alt Text

Devving locally

  1. clone repo
  2. create a virtual env: virtualenv local_dev
  3. activate virtual env: source local_dev/bin/activate
  4. install packages from repo: pip3 install -r requirements.txt
  5. create script on top level of ROBOFLOW-PYTHON and reference local roboflow directory: from roboflow import Roboflow
  6. when done, uptick the pip package minor version number in setup.py
  7. manually add any new dependencies to the requirements.txt and list of dependencies in setup.py (careful not to overwrite any packages that might screw up backwards dependencies for object detection, etc.)

Project details


Release history Release notifications | RSS feed

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.2.10.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

roboflow-0.2.10-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file roboflow-0.2.10.tar.gz.

File metadata

  • Download URL: roboflow-0.2.10.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.10

File hashes

Hashes for roboflow-0.2.10.tar.gz
Algorithm Hash digest
SHA256 143d9b3a11131643d18691ef85e5630d9071e60db25920359896ba4db11b0948
MD5 b6a915a4ca8170756c095026483f7049
BLAKE2b-256 6958114fee0222fbd08ed49652e7bbe7dd8737aa21049a8f05e0e0a59128a016

See more details on using hashes here.

File details

Details for the file roboflow-0.2.10-py3-none-any.whl.

File metadata

  • Download URL: roboflow-0.2.10-py3-none-any.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.10

File hashes

Hashes for roboflow-0.2.10-py3-none-any.whl
Algorithm Hash digest
SHA256 c13a7e773ac31c94c6d83638753938ff5921d1dd16f40a6a2cb3a1424e0a15af
MD5 99369340f30f05076e38fe5637d361c7
BLAKE2b-256 4ebec52bc3bc679fdfcb701e6928b6d79fee612acd9307630e948b6107964e32

See more details on using hashes here.

Supported by

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