Move cookbooks to new webpage and configure html file

This commit is contained in:
Nick Herrig 2024-02-08 15:30:32 -05:00
parent 48af41377f
commit e3adcbeec1
5 changed files with 2 additions and 105 deletions

View File

@ -1,104 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# How To Use Supervision Assets for Experimentation\n",
"\n",
"When experimenting with interesting and useful features of the Supervision package, its important to have some sort of image or video data to experiment with. Luckily for us, Supervision ships with [Assets](https://supervision.roboflow.com/latest/assets/)! Assets is a collection of videos that you can utilize to start experimenting with the various features Supervision has to offer. Let's take a look at how to use this resource.\n",
"\n",
"## Installation Methods\n",
"\n",
"To start utilizing assets let's install them with pip.\n",
"\n",
"### Install with pip\n",
"\n",
"To install the assets with pip, let's first create a virtual enviornment. It's generally a best practice to create a virtual environment so that your projects deppendencies are isolated. Let's create one below and source it. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"#!/bin/bash\n",
"!python -m venv venv\n",
"!source venv/bin/activate"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now that we've got a virtual enviornment installed and sourced, let's install the pip package with the assets \"extra\" package."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!pip install \"supervision[assets]\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"From here we can download and utilize a video asset directly from a python script! Note below that we're utilizing the method `download_assets` to download the `VideoAssets.SUBWAY` video to our local directory. This method returns the file path, so we can then utilize this path for additional experimentation. Let's use the `Video` method from `Ipython.display` to show the video in our notebook."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from supervision.assets import download_assets, VideoAssets\n",
"from IPython.display import Video\n",
"\n",
"path_to_video = download_assets(VideoAssets.SUBWAY)\n",
"Video(path_to_video)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We're now equipted with a video asset from Supervision to run some experiements! For more information on availble video assets, visit the [Supervision API Reference](https://supervision.roboflow.com/latest/assets/#videoassets). Happy building!"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

View File

@ -12,7 +12,8 @@
</div>
<div class="grid">
<p class="card repo-card" data-url="/develop/notebooks/quickstart" data-name="Supervision Quickstart" data-desc="Quickstart to Supervision" data-labels="annotator,detection,sam" data-version="v0.18.0" data-author="SkalskiP,onuralpszr"></p>
<p class="card repo-card" data-url="/develop/notebooks/how-to-use-supervision-assets-for-experimentation" data-name="Supervision Quickstart" data-desc="Quickstart to Supervision" data-labels="annotator,detection,sam" data-version="v0.18.0" data-author="SkalskiP,onuralpszr"></p>
<p class="card repo-card" data-url="/develop/notebooks/how-to-use-supervision-assets-for-experimentation" data-name="Experimenting with Supervision Assets" data-desc="Using Supervision assets to hit the ground running fast." data-labels="utilities,supervision" data-version="v0.18.0" data-author="nickherrig"></p>
<p class="card repo-card" data-url="/develop/notebooks/how-to-display-bounding-boxes-on-a-video" data-name="How to Display Bounding Boxes on a Video" data-desc="Using Inference and Supervision to detect people and display bounding boxes." data-labels="supervision,inference,yolov8" data-version="v0.18.0" data-author="nickherrig"></p>
</div>
</div>
</section>