Skip to content

Commit

Permalink
Merge pull request #206 from roboflow/add-inference-ctas
Browse files Browse the repository at this point in the history
Add Roboflow Inference sections
  • Loading branch information
capjamesg authored Sep 28, 2023
2 parents 5d0a9bc + cb3b543 commit 8726cb2
Show file tree
Hide file tree
Showing 6 changed files with 596 additions and 59 deletions.
25 changes: 13 additions & 12 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions automation/notebooks-table-data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ Track and Count Vehicles with YOLOv8 + ByteTRACK + Supervision, how-to-track-and
Football Players Tracking with YOLOv5 + ByteTRACK, how-to-track-football-players.ipynb, https://blog.roboflow.com/track-football-players, https://youtu.be/QCG8QMhga9k, https://github.com/ifzhang/ByteTrack, 2110.06864, True, skills
Create Segmentation Masks with Roboflow, how-to-generate-segmentation-mask-with-roboflow.ipynb, https://blog.roboflow.com/how-to-create-segmentation-masks-with-roboflow, , , , False, skills
How to Use PolygonZone and Roboflow Supervision, how-to-use-polygonzone-annotate-and-supervision.ipynb, https://blog.roboflow.com/polygonzone/, , , , False, skills
Image-to-Image Search with CLIP and faiss, image-to-image-search-clip-faiss.ipynb, https://blog.roboflow.com/clip-image-search-faiss/, , , , False, skills
362 changes: 362 additions & 0 deletions notebooks/image-to-image-search-clip-faiss.ipynb

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions notebooks/train-yolov8-classification-on-custom-dataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,62 @@
" print(\"\\n\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Deploy Your Model to the Edge\n",
"\n",
"![Roboflow Inference banner](https://blog.roboflow.com/content/images/2023/08/banner.png)\n",
"\n",
"In addition to using the Roboflow hosted API for deployment, you can use [Roboflow Inference](https://inference.roboflow.com), an open source inference solution that has powered millions of API calls in production environments. Inference works with CPU and GPU, giving you immediate access to a range of devices, from the NVIDIA Jetson to TRT-compatible devices to ARM CPU devices.\n",
"\n",
"With Roboflow Inference, you can self-host and deploy your model on-device. You can deploy applications using the [Inference Docker containers](https://inference.roboflow.com/quickstart/docker/) or the pip package.\n",
"\n",
"For example, to install Inference on a device with an NVIDIA GPU, we can use:\n",
"\n",
"```\n",
"docker pull roboflow/roboflow-inference-server-gpu\n",
"```\n",
"\n",
"Then we can run inference via HTTP:\n",
"\n",
"```python\n",
"import requests\n",
"\n",
"workspace_id = \"\"\n",
"model_id = \"\"\n",
"image_url = \"\"\n",
"confidence = 0.75\n",
"api_key = \"\"\n",
"\n",
"infer_payload = {\n",
" \"image\": {\n",
" \"type\": \"url\",\n",
" \"value\": image_url,\n",
" },\n",
" \"confidence\": confidence,\n",
" \"iou_threshold\": iou_thresh,\n",
" \"api_key\": api_key,\n",
"}\n",
"res = requests.post(\n",
" f\"http://localhost:9001/{workspace_id}/{model_id}\",\n",
" json=infer_object_detection_payload,\n",
")\n",
"\n",
"predictions = res.json()\n",
"```\n",
"\n",
"Above, set your Roboflow workspace ID, model ID, and API key.\n",
"\n",
"- [Find your workspace and model ID](https://docs.roboflow.com/api-reference/workspace-and-project-ids?ref=blog.roboflow.com)\n",
"- [Find your API key](https://docs.roboflow.com/api-reference/authentication?ref=blog.roboflow.com#retrieve-an-api-key)\n",
"\n",
"Also, set the URL of an image on which you want to run inference. This can be a local file.\n",
"\n",
"_To use your YOLOv8 model commercially with Inference, you will need a Roboflow Enterprise license, through which you gain a pass-through license for using YOLOv8. An enterprise license also grants you access to features like advanced device management, multi-model containers, auto-batch inference, and more._"
]
},
{
"attachments": {},
"cell_type": "markdown",
Expand Down
150 changes: 103 additions & 47 deletions notebooks/train-yolov8-instance-segmentation-on-custom-dataset.ipynb

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions notebooks/train-yolov8-object-detection-on-custom-dataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,67 @@
"pred"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Deploy Your Model to the Edge\n",
"\n",
"In addition to using the Roboflow hosted API for deployment, you can use [Roboflow Inference](https://inference.roboflow.com), an open source inference solution that has powered millions of API calls in production environments. Inference works with CPU and GPU, giving you immediate access to a range of devices, from the NVIDIA Jetson to TRT-compatible devices to ARM CPU devices.\n",
"\n",
"With Roboflow Inference, you can self-host and deploy your model on-device. You can deploy applications using the [Inference Docker containers](https://inference.roboflow.com/quickstart/docker/) or the pip package.\n",
"\n",
"For example, to install Inference on a device with an NVIDIA GPU, we can use:\n",
"\n",
"```\n",
"docker pull roboflow/roboflow-inference-server-gpu\n",
"```\n",
"\n",
"Then we can run inference via HTTP:\n",
"\n",
"```python\n",
"import requests\n",
"\n",
"workspace_id = \"\"\n",
"model_id = \"\"\n",
"image_url = \"\"\n",
"confidence = 0.75\n",
"api_key = \"\"\n",
"\n",
"infer_payload = {\n",
" \"image\": {\n",
" \"type\": \"url\",\n",
" \"value\": image_url,\n",
" },\n",
" \"confidence\": confidence,\n",
" \"iou_threshold\": iou_thresh,\n",
" \"api_key\": api_key,\n",
"}\n",
"res = requests.post(\n",
" f\"http://localhost:9001/{workspace_id}/{model_id}\",\n",
" json=infer_object_detection_payload,\n",
")\n",
"\n",
"predictions = res.json()\n",
"```\n",
"\n",
"Above, set your Roboflow workspace ID, model ID, and API key.\n",
"\n",
"- [Find your workspace and model ID](https://docs.roboflow.com/api-reference/workspace-and-project-ids?ref=blog.roboflow.com)\n",
"- [Find your API key](https://docs.roboflow.com/api-reference/authentication?ref=blog.roboflow.com#retrieve-an-api-key)\n",
"\n",
"Also, set the URL of an image on which you want to run inference. This can be a local file.\n",
"\n",
"_To use your YOLOv5 model commercially with Inference, you will need a Roboflow Enterprise license, through which you gain a pass-through license for using YOLOv5. An enterprise license also grants you access to features like advanced device management, multi-model containers, auto-batch inference, and more._"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"attachments": {},
"cell_type": "markdown",
Expand Down

0 comments on commit 8726cb2

Please sign in to comment.