diff --git a/docs/notebooks/how-to-use-supervision-assets-for-experimentation.ipynb b/docs/notebooks/how-to-use-supervision-assets-for-experimentation.ipynb new file mode 100644 index 00000000..37a2e6f3 --- /dev/null +++ b/docs/notebooks/how-to-use-supervision-assets-for-experimentation.ipynb @@ -0,0 +1,104 @@ +{ + "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 +} diff --git a/docs/theme/cookbooks.html b/docs/theme/cookbooks.html index 0e6f9688..a96b65cc 100644 --- a/docs/theme/cookbooks.html +++ b/docs/theme/cookbooks.html @@ -13,6 +13,9 @@

+
+

+
{% endblock %}