roboflow


Nameroboflow JSON
Version 1.1.33 PyPI version JSON
download
home_pagehttps://github.com/roboflow-ai/roboflow-python
SummaryOfficial Python package for working with the Roboflow API
upload_time2024-06-20 09:53:45
maintainerNone
docs_urlNone
authorRoboflow
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements certifi chardet idna cycler kiwisolver matplotlib numpy opencv-python-headless Pillow python-dateutil python-dotenv requests six urllib3 tqdm PyYAML requests_toolbelt python-magic
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <p>
    <a align="center" href="" target="_blank">
      <img
        width="100%"
        src="https://github.com/roboflow/roboflow-python/assets/37276661/528ed065-d5ac-4f9a-942e-0d211b8d97de"
      >
    </a>
  </p>

  <br>

  [notebooks](https://github.com/roboflow/notebooks) | [inference](https://github.com/roboflow/inference) | [autodistill](https://github.com/autodistill/autodistill) | [collect](https://github.com/roboflow/roboflow-collect)  | [supervision](https://github.com/roboflow/supervision)

  <br>

  [![version](https://badge.fury.io/py/roboflow.svg)](https://badge.fury.io/py/roboflow)
  [![downloads](https://img.shields.io/pypi/dm/roboflow)](https://pypistats.org/packages/roboflow)
  [![license](https://img.shields.io/pypi/l/roboflow)](https://github.com/roboflow/roboflow-python/blob/main/LICENSE.md)
  [![python-version](https://img.shields.io/pypi/pyversions/roboflow)](https://badge.fury.io/py/roboflow)

</div>

# Roboflow Python Package

[Roboflow](https://roboflow.com) provides everything you need to build and deploy computer vision models. `roboflow-python` is the official Roboflow Python package. `roboflow-python` enables you to interact with models, datasets, and projects hosted on Roboflow.

With this Python package, you can:

1. Create and manage projects;
2. Upload images, annotations, and datasets to manage in Roboflow;
3. Start training vision models on Roboflow;
4. Run inference on models hosted on Roboflow, or Roboflow models self-hosted via [Roboflow Inference](https://github.com/roboflow/inference), and more.

The Python package is documented on the [official Roboflow documentation site](https://docs.roboflow.com/api-reference/introduction). If you are developing a feature for this Python package, or need a full Python library reference, refer to the [package developer documentation](https://roboflow.github.io/roboflow-python/).

## 💻 Installation

You will need to have `Python 3.8` or higher set up to use the Roboflow Python package.

Run the following command to install the Roboflow Python package:

```bash
pip install roboflow
```

<details>
  <summary>Install from source</summary>

  You can also install the Roboflow Python package from source using the following commands:

  ```bash
  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
  ```
</details>

<details>
  <summary>Command line tool</summary>

  By installing roboflow python package you can use some of its functionality in the command line (without having to write python code).
  See [CLI-COMMANDS.md](CLI-COMMANDS.md)
</details>


## 🚀 Getting Started

To use the Roboflow Python package, you first need to authenticate with your Roboflow account. You can do this by running the following command:

```python
import roboflow
roboflow.login()
```

<details>
<summary>Authenticate with an API key</summary>

You can also authenticate with an API key by using the following code:

```python
import roboflow

rf = roboflow.Roboflow(api_key="")
```

[Learn how to retrieve your Roboflow API key](https://docs.roboflow.com/api-reference/authentication#retrieve-an-api-key).

</details>

## Quickstart

Below are some common methods used with the Roboflow Python package, presented concisely for reference. For a full library reference, refer to the [Roboflow API reference documentation](https://docs.roboflow.com/api-reference).

```python
import roboflow

roboflow.login()

rf = roboflow.Roboflow()

# create a project
rf.create_project(
    project_name="project name",
    project_type="project-type",
    license="project-license" # "private" for private projects
)

workspace = rf.workspace("WORKSPACE_URL")
project = workspace.project("PROJECT_URL")
version = project.version("VERSION_NUMBER")

# upload a dataset
workspace.upload_dataset(
    dataset_path="./dataset/",
    num_workers=10,
    dataset_format="yolov8", # supports yolov8, yolov5, and Pascal VOC
    project_license="MIT",
    project_type="object-detection"
)

# upload model weights
version.deploy(model_type="yolov8", model_path=f”{HOME}/runs/detect/train/”)

# run inference
model = version.model

img_url = "https://media.roboflow.com/quickstart/aerial_drone.jpeg"

predictions = model.predict(img_url, hosted=True).json()

print(predictions)
```

## Library Structure

The Roboflow Python library is structured using the same Workspace, Project, and Version ontology that you will see in the Roboflow application.

```python
import roboflow

roboflow.login()

rf = roboflow.Roboflow()

workspace = rf.workspace("WORKSPACE_URL")
project = workspace.project("PROJECT_URL")
version = project.version("VERSION_NUMBER")
```

The workspace, project, and version parameters are the same that you will find in the URL addresses at app.roboflow.com and universe.roboflow.com.

Within the workspace object you can perform actions like making a new project, listing your projects, or performing active learning where you are using predictions from one project's model to upload images to a new project.

Within the project object, you can retrieve metadata about the project, list versions, generate a new dataset version with preprocessing and augmentation settings, train a model in your project, and upload images and annotations to your project.

Within the version object, you can download the dataset version in any model format, train the version on Roboflow, and deploy your own external model to Roboflow.

## 🏆 Contributing

We would love your input on how we can improve the Roboflow Python package! Please see our [contributing guide](https://github.com/roboflow/roboflow-python/blob/main/CONTRIBUTING.md) to get started. Thank you 🙏 to all our contributors!

<br>

<div align="center">
    <a href="https://youtube.com/roboflow">
        <img
          src="https://media.roboflow.com/notebooks/template/icons/purple/youtube.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949634652"
          width="3%"
        />
    </a>
    <img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
    <a href="https://roboflow.com">
        <img
          src="https://media.roboflow.com/notebooks/template/icons/purple/roboflow-app.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949746649"
          width="3%"
        />
    </a>
    <img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
    <a href="https://www.linkedin.com/company/roboflow-ai/">
        <img
          src="https://media.roboflow.com/notebooks/template/icons/purple/linkedin.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633691"
          width="3%"
        />
    </a>
    <img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
    <a href="https://docs.roboflow.com">
        <img
          src="https://media.roboflow.com/notebooks/template/icons/purple/knowledge.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949634511"
          width="3%"
        />
    </a>
    <img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
    <a href="https://disuss.roboflow.com">
        <img
          src="https://media.roboflow.com/notebooks/template/icons/purple/forum.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633584"
          width="3%"
        />
    <img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
    <a href="https://blog.roboflow.com">
        <img
          src="https://media.roboflow.com/notebooks/template/icons/purple/blog.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633605"
          width="3%"
        />
    </a>
    </a>
</div>



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/roboflow-ai/roboflow-python",
    "name": "roboflow",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Roboflow",
    "author_email": "support@roboflow.com",
    "download_url": "https://files.pythonhosted.org/packages/e4/8b/41aed1cac9e4debd5554cb403e7464e8366f6164f0ad291417c5cbd50503/roboflow-1.1.33.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <p>\n    <a align=\"center\" href=\"\" target=\"_blank\">\n      <img\n        width=\"100%\"\n        src=\"https://github.com/roboflow/roboflow-python/assets/37276661/528ed065-d5ac-4f9a-942e-0d211b8d97de\"\n      >\n    </a>\n  </p>\n\n  <br>\n\n  [notebooks](https://github.com/roboflow/notebooks) | [inference](https://github.com/roboflow/inference) | [autodistill](https://github.com/autodistill/autodistill) | [collect](https://github.com/roboflow/roboflow-collect)  | [supervision](https://github.com/roboflow/supervision)\n\n  <br>\n\n  [![version](https://badge.fury.io/py/roboflow.svg)](https://badge.fury.io/py/roboflow)\n  [![downloads](https://img.shields.io/pypi/dm/roboflow)](https://pypistats.org/packages/roboflow)\n  [![license](https://img.shields.io/pypi/l/roboflow)](https://github.com/roboflow/roboflow-python/blob/main/LICENSE.md)\n  [![python-version](https://img.shields.io/pypi/pyversions/roboflow)](https://badge.fury.io/py/roboflow)\n\n</div>\n\n# Roboflow Python Package\n\n[Roboflow](https://roboflow.com) provides everything you need to build and deploy computer vision models. `roboflow-python` is the official Roboflow Python package. `roboflow-python` enables you to interact with models, datasets, and projects hosted on Roboflow.\n\nWith this Python package, you can:\n\n1. Create and manage projects;\n2. Upload images, annotations, and datasets to manage in Roboflow;\n3. Start training vision models on Roboflow;\n4. Run inference on models hosted on Roboflow, or Roboflow models self-hosted via [Roboflow Inference](https://github.com/roboflow/inference), and more.\n\nThe Python package is documented on the [official Roboflow documentation site](https://docs.roboflow.com/api-reference/introduction). If you are developing a feature for this Python package, or need a full Python library reference, refer to the [package developer documentation](https://roboflow.github.io/roboflow-python/).\n\n## \ud83d\udcbb Installation\n\nYou will need to have `Python 3.8` or higher set up to use the Roboflow Python package.\n\nRun the following command to install the Roboflow Python package:\n\n```bash\npip install roboflow\n```\n\n<details>\n  <summary>Install from source</summary>\n\n  You can also install the Roboflow Python package from source using the following commands:\n\n  ```bash\n  git clone https://github.com/roboflow-ai/roboflow-python.git\n  cd roboflow-python\n  python3 -m venv env\n  source env/bin/activate\n  pip3 install -r requirements.txt\n  ```\n</details>\n\n<details>\n  <summary>Command line tool</summary>\n\n  By installing roboflow python package you can use some of its functionality in the command line (without having to write python code).\n  See [CLI-COMMANDS.md](CLI-COMMANDS.md)\n</details>\n\n\n## \ud83d\ude80 Getting Started\n\nTo use the Roboflow Python package, you first need to authenticate with your Roboflow account. You can do this by running the following command:\n\n```python\nimport roboflow\nroboflow.login()\n```\n\n<details>\n<summary>Authenticate with an API key</summary>\n\nYou can also authenticate with an API key by using the following code:\n\n```python\nimport roboflow\n\nrf = roboflow.Roboflow(api_key=\"\")\n```\n\n[Learn how to retrieve your Roboflow API key](https://docs.roboflow.com/api-reference/authentication#retrieve-an-api-key).\n\n</details>\n\n## Quickstart\n\nBelow are some common methods used with the Roboflow Python package, presented concisely for reference. For a full library reference, refer to the [Roboflow API reference documentation](https://docs.roboflow.com/api-reference).\n\n```python\nimport roboflow\n\nroboflow.login()\n\nrf = roboflow.Roboflow()\n\n# create a project\nrf.create_project(\n    project_name=\"project name\",\n    project_type=\"project-type\",\n    license=\"project-license\" # \"private\" for private projects\n)\n\nworkspace = rf.workspace(\"WORKSPACE_URL\")\nproject = workspace.project(\"PROJECT_URL\")\nversion = project.version(\"VERSION_NUMBER\")\n\n# upload a dataset\nworkspace.upload_dataset(\n    dataset_path=\"./dataset/\",\n    num_workers=10,\n    dataset_format=\"yolov8\", # supports yolov8, yolov5, and Pascal VOC\n    project_license=\"MIT\",\n    project_type=\"object-detection\"\n)\n\n# upload model weights\nversion.deploy(model_type=\"yolov8\", model_path=f\u201d{HOME}/runs/detect/train/\u201d)\n\n# run inference\nmodel = version.model\n\nimg_url = \"https://media.roboflow.com/quickstart/aerial_drone.jpeg\"\n\npredictions = model.predict(img_url, hosted=True).json()\n\nprint(predictions)\n```\n\n## Library Structure\n\nThe Roboflow Python library is structured using the same Workspace, Project, and Version ontology that you will see in the Roboflow application.\n\n```python\nimport roboflow\n\nroboflow.login()\n\nrf = roboflow.Roboflow()\n\nworkspace = rf.workspace(\"WORKSPACE_URL\")\nproject = workspace.project(\"PROJECT_URL\")\nversion = project.version(\"VERSION_NUMBER\")\n```\n\nThe workspace, project, and version parameters are the same that you will find in the URL addresses at app.roboflow.com and universe.roboflow.com.\n\nWithin the workspace object you can perform actions like making a new project, listing your projects, or performing active learning where you are using predictions from one project's model to upload images to a new project.\n\nWithin the project object, you can retrieve metadata about the project, list versions, generate a new dataset version with preprocessing and augmentation settings, train a model in your project, and upload images and annotations to your project.\n\nWithin the version object, you can download the dataset version in any model format, train the version on Roboflow, and deploy your own external model to Roboflow.\n\n## \ud83c\udfc6 Contributing\n\nWe would love your input on how we can improve the Roboflow Python package! Please see our [contributing guide](https://github.com/roboflow/roboflow-python/blob/main/CONTRIBUTING.md) to get started. Thank you \ud83d\ude4f to all our contributors!\n\n<br>\n\n<div align=\"center\">\n    <a href=\"https://youtube.com/roboflow\">\n        <img\n          src=\"https://media.roboflow.com/notebooks/template/icons/purple/youtube.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949634652\"\n          width=\"3%\"\n        />\n    </a>\n    <img src=\"https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png\" width=\"3%\"/>\n    <a href=\"https://roboflow.com\">\n        <img\n          src=\"https://media.roboflow.com/notebooks/template/icons/purple/roboflow-app.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949746649\"\n          width=\"3%\"\n        />\n    </a>\n    <img src=\"https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png\" width=\"3%\"/>\n    <a href=\"https://www.linkedin.com/company/roboflow-ai/\">\n        <img\n          src=\"https://media.roboflow.com/notebooks/template/icons/purple/linkedin.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633691\"\n          width=\"3%\"\n        />\n    </a>\n    <img src=\"https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png\" width=\"3%\"/>\n    <a href=\"https://docs.roboflow.com\">\n        <img\n          src=\"https://media.roboflow.com/notebooks/template/icons/purple/knowledge.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949634511\"\n          width=\"3%\"\n        />\n    </a>\n    <img src=\"https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png\" width=\"3%\"/>\n    <a href=\"https://disuss.roboflow.com\">\n        <img\n          src=\"https://media.roboflow.com/notebooks/template/icons/purple/forum.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633584\"\n          width=\"3%\"\n        />\n    <img src=\"https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png\" width=\"3%\"/>\n    <a href=\"https://blog.roboflow.com\">\n        <img\n          src=\"https://media.roboflow.com/notebooks/template/icons/purple/blog.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633605\"\n          width=\"3%\"\n        />\n    </a>\n    </a>\n</div>\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Official Python package for working with the Roboflow API",
    "version": "1.1.33",
    "project_urls": {
        "Homepage": "https://github.com/roboflow-ai/roboflow-python"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "78adc59a582a4b97f948b28afc67b3e1e69e6818b2260a3f724185ecf2ce903e",
                "md5": "729b8f88dd72a674b673dcf148c705be",
                "sha256": "ee0c64d4a78c83db9caa1fad06235ec4c90da2440311737755a0b77a916aebe7"
            },
            "downloads": -1,
            "filename": "roboflow-1.1.33-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "729b8f88dd72a674b673dcf148c705be",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 75584,
            "upload_time": "2024-06-20T09:53:43",
            "upload_time_iso_8601": "2024-06-20T09:53:43.242785Z",
            "url": "https://files.pythonhosted.org/packages/78/ad/c59a582a4b97f948b28afc67b3e1e69e6818b2260a3f724185ecf2ce903e/roboflow-1.1.33-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e48b41aed1cac9e4debd5554cb403e7464e8366f6164f0ad291417c5cbd50503",
                "md5": "bc06e0e650b356519225ae949fd913c6",
                "sha256": "8b4c192d20e53eea537be9bfe0dd6b826fe10b984aea9a4cdb0a2d4ef4cf6f81"
            },
            "downloads": -1,
            "filename": "roboflow-1.1.33.tar.gz",
            "has_sig": false,
            "md5_digest": "bc06e0e650b356519225ae949fd913c6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 63912,
            "upload_time": "2024-06-20T09:53:45",
            "upload_time_iso_8601": "2024-06-20T09:53:45.970298Z",
            "url": "https://files.pythonhosted.org/packages/e4/8b/41aed1cac9e4debd5554cb403e7464e8366f6164f0ad291417c5cbd50503/roboflow-1.1.33.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-20 09:53:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "roboflow-ai",
    "github_project": "roboflow-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "certifi",
            "specs": []
        },
        {
            "name": "chardet",
            "specs": [
                [
                    "==",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.7"
                ]
            ]
        },
        {
            "name": "cycler",
            "specs": []
        },
        {
            "name": "kiwisolver",
            "specs": [
                [
                    ">=",
                    "1.3.1"
                ]
            ]
        },
        {
            "name": "matplotlib",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.18.5"
                ]
            ]
        },
        {
            "name": "opencv-python-headless",
            "specs": [
                [
                    "==",
                    "4.10.0.84"
                ]
            ]
        },
        {
            "name": "Pillow",
            "specs": [
                [
                    ">=",
                    "7.1.2"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": []
        },
        {
            "name": "python-dotenv",
            "specs": []
        },
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "six",
            "specs": []
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    ">=",
                    "1.26.6"
                ]
            ]
        },
        {
            "name": "tqdm",
            "specs": [
                [
                    ">=",
                    "4.41.0"
                ]
            ]
        },
        {
            "name": "PyYAML",
            "specs": [
                [
                    ">=",
                    "5.3.1"
                ]
            ]
        },
        {
            "name": "requests_toolbelt",
            "specs": []
        },
        {
            "name": "python-magic",
            "specs": []
        }
    ],
    "lcname": "roboflow"
}
        
Elapsed time: 0.37520s