Roboflow Inference provides a robust framework for deploying computer vision models across various devices and environments without requiring deep machine learning expertise. This GPU-specific variant leverages CUDA for accelerated inference. Currently at version 1.2.2, the library maintains an active release cadence with frequent patches and minor updates.
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install inference-gpuVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to load a Roboflow model using `get_roboflow_model` and perform inference on an image. It highlights the use of environment variables for API keys and model identification, which is recommended for security and flexibility. Replace 'YOUR_API_KEY' and 'YOUR_PROJECT/YOUR_VERSION' with your actual credentials and model details.
Review model loading and inference logic. If you encounter issues, consult the official documentation for the `inference-models` engine or explicitly configure the legacy backend if necessary (though migrating to the new backend is recommended).
Always follow the recommended installation command: `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cuXXX` before `pip install inference-gpu`, replacing `XXX` with your CUDA version.
Upgrade your Python environment to 3.10, 3.11, or 3.12 (as specified by `requires_python`).
Ensure `ROBOFLOW_API_KEY` and `ROBOFLOW_MODEL_ID` (project/version) are correctly set, preferably via environment variables, or passed directly to the model loading function.