Skip to content

Commit 5aafce5

Browse files
Merge pull request #1362 from roboflow/feat/update-installation
docs: Add installation and a quickstart code snippet in the `getting-started` page in docs
2 parents 79f9a1d + 1c8374b commit 5aafce5

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

docs/start/getting-started.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
# Installation
2+
3+
You can install `inference` in a [Python>=3.8](https://www.python.org/) environment.
4+
5+
!!! example "Installation Command"
6+
7+
=== "CPU"
8+
```bash
9+
pip install inference
10+
```
11+
12+
=== "Nvidia GPU"
13+
```bash
14+
pip install inference-gpu
15+
```
16+
17+
# Quickstart
18+
19+
With the following code snippet, we can load a model and then we used that model's `infer(...)` method to run an image through it.
20+
21+
```python
22+
# import a utility function for loading Roboflow models
23+
from inference import get_model
24+
25+
# define the image url to use for inference
26+
image = "https://media.roboflow.com/inference/people-walking.jpg"
27+
28+
# load a pre-trained yolov8n model
29+
model = get_model(model_id="yolov8n-640")
30+
31+
# run inference on our chosen image, image can be a url, a numpy array, a PIL image, etc.
32+
results = model.infer(image)
33+
```
34+
35+
!!! note
36+
37+
For a more detailed example, please refer to the tutorial on [running a model](../quickstart/run_a_model).
38+
139
# Choosing a Deployment Method
240

341
There are three primary ways to deploy Inference:

0 commit comments

Comments
 (0)