From efd06ac77dcfd796f329a31f2bb4bd0da6fe0786 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 17:22:00 +0000 Subject: [PATCH] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto=20form?= =?UTF-8?q?at=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to-display-bounding-boxes-on-a-video.ipynb | 2 +- ...pervision-assets-for-experimentation.ipynb | 204 +++++++++--------- 2 files changed, 103 insertions(+), 103 deletions(-) diff --git a/cookbooks/how-to-display-bounding-boxes-on-a-video.ipynb b/cookbooks/how-to-display-bounding-boxes-on-a-video.ipynb index c5898d23..f24f248a 100644 --- a/cookbooks/how-to-display-bounding-boxes-on-a-video.ipynb +++ b/cookbooks/how-to-display-bounding-boxes-on-a-video.ipynb @@ -86,7 +86,7 @@ "\n", " # Yield a single frame from the generator.\n", " frame = next(frame_generator)\n", - " \n", + "\n", " # Run inference on our frame.\n", " result = model.infer(frame)[0]\n", "\n", diff --git a/cookbooks/how-to-use-supervision-assets-for-experimentation.ipynb b/cookbooks/how-to-use-supervision-assets-for-experimentation.ipynb index aa395984..37a2e6f3 100644 --- a/cookbooks/how-to-use-supervision-assets-for-experimentation.ipynb +++ b/cookbooks/how-to-use-supervision-assets-for-experimentation.ipynb @@ -1,104 +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 + "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 }