fix(pre_commit): 🎨 auto format pre-commit hooks

This commit is contained in:
pre-commit-ci[bot] 2024-02-08 17:22:00 +00:00
parent 1ac497a3e2
commit efd06ac77d
2 changed files with 103 additions and 103 deletions

View File

@ -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",

View File

@ -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
}