Skip to main content

Machine learning models optimized for robotics experimentation and deployment

Project description

RoboML 🤖

RoboML is an aggregator package written for quickly deploying open source ML models for robots. It is designed to cover two basic use cases.

  • Readily deploy various useful models: The package provides a wrapper around the 🤗 Transformers and SentenceTransformers libraries. Pretty much all relevant open source models from these libraries can be quickly deployed behind a highly scalable server endpoint.
  • Deploy Detection Models with Tracking: With RoboML one can deploy all detection models available in MMDetection. An open source vision model aggregation library. These detection models can also be seemlesly used for tracking.
  • Use Open Source Vector DBs: RoboML provides a unified interface for deploying Vector DBs along with ML models. Currently it is packaged with ChromaDB an open source multimodal vector database.
  • Aggregate robot specific ML models from the Robotics community: RoboML aims to be an aggregator package of models trained by the robotics community. These models can range from Multimodal LLMs, vision models, or robot action models, and can be used with ROS based functional components. See the usage in ROS Agents

Installation

RoboML has been tested on Ubuntu 20.04 and later. It should ideally be installed on a system with a GPU and CUDA 12.1. However, it should work without a GPU. If you encounter any installation problems, please open an issue.

pip install roboml

From Source

git clone https://github.com/automatika-robotics/roboml.git && cd roboml
virtualenv venv && source venv/bin/activate
pip install pip-tools
pip install .

For vision models support

If you want to utilize detection and tracking using Vision models from the MMDetection library, you will need to install a couple of dependancies as follows:

  • Install roboml using the vision flag:

    pip install roboml[vision]

  • Install mmcv using the installation instructions provided here. For installation with pip, simply pick PyTorch and CUDA version that you have installed and copy the pip installation command generated. For example for PyTorch 2.1:

    pip install mmcv==2.1.0 -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.1/index.html

  • Install mmdetection as follows:

git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -v -e .
  • Install ffmpeg and libGL are missing then run the following:

sudo apt-get update && apt-get install ffmpeg libsm6 libxext6

Model quantization support

Roboml uses bitsandbytes for model quantization. However it is only installed as a dependency automatically on x86_64 architectures as bitsandbytes pre-built wheels are not available for other architectures. For other architures, such as aarch64 on NVIDIA Jetson boards, it is recommended to build bitsandbytes from source using the following instructions:

git clone https://github.com/bitsandbytes-foundation/bitsandbytes.git && cd bitsandbytes/
pip install -r requirements-dev.txt
cmake -DCOMPUTE_BACKEND=cuda -S .
make
pip install .

More details are available on the bitsandbytes installation page.

Build in a Docker container (Recommended)

git clone https://github.com/automatika-robotics/roboml.git && cd roboml
# build the container image
docker build --tag=automatika:roboml .
# for NVIDIA Jetson boards replace the above command with
docker build --tag=automatika:roboml -f Dockerfile.Jetson .
# run the container with gpu support
docker run --runtime=nvidia --gpus all --rm -p 8000:8000 automatika:roboml

Servers

By default roboml starts models as ray serve apps. Making the models scalable accross multiple infrastructure configurations. See ray serve for details.

An Experimental Server based on RESP

When using ML models on robots, latency is a major consideration. When models are deployed on distributed infrastructure (and not on the edge, due to compute limitations), latency depends on both the model inference time and server communication time. Therefore, RoboML also implements an experimental server built using RESP which can be accessed using any redis client. RESP is a human readable binary safe protocol, which is very simple to parse and thus can be used to implement servers significatly faster than HTTP, specially when the payloads are also packaged binary data (for example images, audio or video data). The RESP server uses msgpack a cross-platform library available in over 50 languages, to package data instead of JSON. Work on the server was inspired by earlier work of @hansonkd and his Tino project.

Usage

To run an HTTP server simply run the following in the terminal

roboml

To run an RESP based server, run

roboml-resp

In order to see how these servers are called from a ROS package that implements its clients, please refer to ROS Agents documentation.

Running Tests

To run tests, install with:

pip install ".[dev]"

And run the following in the root directory

python -m pytest

Copyright

The code in this distribution is Copyright (c) 2024 Automatika Robotics unless explicitly indicated otherwise.

ROS Agents is made available under the MIT license. Details can be found in the LICENSE file.

Contributions

ROS Agents has been developed in collaboration betweeen Automatika Robotics and Inria. Contributions from the community are most welcome.

Project details


Download files

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

Source Distribution

roboml-0.2.2.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

roboml-0.2.2-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file roboml-0.2.2.tar.gz.

File metadata

  • Download URL: roboml-0.2.2.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for roboml-0.2.2.tar.gz
Algorithm Hash digest
SHA256 a87f40f89ce254126ffa553db4274648d9925b84d43ff0b4e205e706a062c045
MD5 cc2d8c39a0ee5e0c21d82d924a9c2118
BLAKE2b-256 e31b176a0f8d8613cae64bb566526ef9f4e5a24b28e8f0f039adfc4b4fdb1b67

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboml-0.2.2.tar.gz:

Publisher: build_and_publish.yml on automatika-robotics/roboml

Attestations:

File details

Details for the file roboml-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: roboml-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for roboml-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a50a3b8356e153970b7912d7b732f8ee0c3c6ccd5e6bc33fff7de2ce46e6583c
MD5 d56d1b7946908eb12b39d01049a4b1a8
BLAKE2b-256 7a7720564df60ea64ec79c4cb9e8f25083490b1befadd7d79a6a766aecb8b6a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboml-0.2.2-py3-none-any.whl:

Publisher: build_and_publish.yml on automatika-robotics/roboml

Attestations:

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