-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add notebook with DP specific configurations
- Loading branch information
Mario Ruiz
committed
Nov 17, 2021
1 parent
b60f37b
commit 4ecc802
Showing
7 changed files
with
776 additions
and
6 deletions.
There are no files selected for viewing
189 changes: 189 additions & 0 deletions
189
boards/KV260/notebooks/applications/01_difference_gaussians_app.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Difference of Gaussians Application\n", | ||
"----\n", | ||
"\n", | ||
"<div class=\"alert alert-box alert-info\">\n", | ||
"Please use Jupyter labs http://<board_ip_address>/lab for this notebook.\n", | ||
"</div>\n", | ||
"\n", | ||
"This notebook shows how to download and play with the Difference of Gaussians Application\n", | ||
"\n", | ||
"## Aims\n", | ||
"* Instantiate the application\n", | ||
"* Start the application\n", | ||
"* Play with the runtime parameters\n", | ||
"* Stop the application\n", | ||
"\n", | ||
"## Table of Contents\n", | ||
"* [Download Composable Overlay](#download)\n", | ||
"* [Start Application](#start)\n", | ||
"* [Play with the Application](#play)\n", | ||
"* [Stop Application](#stop)\n", | ||
"* [Conclusion](#conclusion)\n", | ||
"\n", | ||
"----\n", | ||
"\n", | ||
"## Revision History\n", | ||
"\n", | ||
"* v1.0 | 17 November 2021 | First notebook revision.\n", | ||
"\n", | ||
"----" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Download Composable Overlay <a class=\"anchor\" id=\"download\"></a>\n", | ||
"\n", | ||
"Download the Composable Overlay using the `DifferenceGaussians` class which wraps all the functionality needed to run this application" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pynq_composable import DifferenceGaussians, VSource, VSink\n", | ||
"\n", | ||
"app = DifferenceGaussians(\"../overlay/cv_dfx_4_pr.bit\", VSource.MIPI, VSink.DP)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Start Application <a class=\"anchor\" id=\"start\"></a>\n", | ||
"\n", | ||
"Start the application by calling the `.start()` method, this will:\n", | ||
"\n", | ||
"1. Initialize the pipeline\n", | ||
"1. Setup initial parameters\n", | ||
"1. Display the implemented pipelined\n", | ||
"1. Configure MIPI camera and DisplayPort\n", | ||
"\n", | ||
"The output image should be visible on the external screen at this point\n", | ||
"\n", | ||
"<div class=\"alert alert-heading alert-danger\">\n", | ||
" <h4 class=\"alert-heading\">Warning:</h4>\n", | ||
"\n", | ||
"Failure to connect MIPI camera and DisplayPort cable may cause the notebook to hang\n", | ||
"</div>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"app.start()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Play with the Application <a class=\"anchor\" id=\"play\"></a>\n", | ||
"\n", | ||
"The `.play()` method exposes the $\\sigma$ parameters of the Difference of Gaussians application to play with.\n", | ||
"\n", | ||
"Move the sliders and notice how the output video changes." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"app.play()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Stop Application <a class=\"anchor\" id=\"stop\"></a>\n", | ||
"\n", | ||
"Finally stop the application to release the resources\n", | ||
"\n", | ||
"<div class=\"alert alert-heading alert-danger\">\n", | ||
" <h4 class=\"alert-heading\">Warning:</h4>\n", | ||
"\n", | ||
"Failure to stop the app may hang the board \n", | ||
"when trying to download another bitstream onto the FPGA\n", | ||
"</div>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"app.stop()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"----\n", | ||
"\n", | ||
"## Conclusion <a class=\"anchor\" id=\"conclusion\"></a>\n", | ||
"\n", | ||
"This notebook has presented the Difference of Gaussian application that leverages the Composable Overlay. \n", | ||
"\n", | ||
"The runtime parameters of such application can be modified using sliders from `ipywidgets`\n", | ||
"\n", | ||
"| | [Corner Detect Application MIPI ➡️](02_corner_detect_app.ipynb)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Copyright © 2021 Xilinx, Inc\n", | ||
"\n", | ||
"SPDX-License-Identifier: BSD-3-Clause\n", | ||
"\n", | ||
"----" | ||
] | ||
} | ||
], | ||
"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.8.2" | ||
}, | ||
"widgets": { | ||
"application/vnd.jupyter.widget-state+json": { | ||
"state": {}, | ||
"version_major": 2, | ||
"version_minor": 0 | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
189 changes: 189 additions & 0 deletions
189
boards/KV260/notebooks/applications/02_corner_detect_app.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Corner Detect Application\n", | ||
"----\n", | ||
"\n", | ||
"<div class=\"alert alert-box alert-info\">\n", | ||
"Please use Jupyter labs http://<board_ip_address>/lab for this notebook.\n", | ||
"</div>\n", | ||
"\n", | ||
"This notebook shows how to download and play with the Corner Detect Application\n", | ||
"\n", | ||
"## Aims\n", | ||
"* Instantiate the application\n", | ||
"* Start the application\n", | ||
"* Play with the runtime parameters\n", | ||
"* Stop the application\n", | ||
"\n", | ||
"## Table of Contents\n", | ||
"* [Download Composable Overlay](#download)\n", | ||
"* [Start Application](#start)\n", | ||
"* [Play with the Application](#play)\n", | ||
"* [Stop Application](#stop)\n", | ||
"* [Conclusion](#conclusion)\n", | ||
"\n", | ||
"----\n", | ||
"\n", | ||
"## Revision History\n", | ||
"\n", | ||
"* v1.0 | 17 November 2021 | First notebook revision.\n", | ||
"\n", | ||
"----" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Download Composable Overlay <a class=\"anchor\" id=\"download\"></a>\n", | ||
"\n", | ||
"Download the Composable Overlay using the `CornerDetect` class which wraps all the functionality needed to run this application" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pynq_composable import CornerDetect, VSource, VSink\n", | ||
"\n", | ||
"app = CornerDetect(\"../overlay/cv_dfx_4_pr.bit\", VSource.MIPI, sink=VSink.DP)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Start Application <a class=\"anchor\" id=\"start\"></a>\n", | ||
"\n", | ||
"Start the application by calling the `.start()` method, this will:\n", | ||
"\n", | ||
"1. Initialize the pipeline\n", | ||
"1. Setup initial parameters\n", | ||
"1. Display the implemented pipelined\n", | ||
"1. Configure MIPI camera and DisplayPort\n", | ||
"\n", | ||
"The output image should be visible on the external screen at this point\n", | ||
"\n", | ||
"<div class=\"alert alert-heading alert-danger\">\n", | ||
" <h4 class=\"alert-heading\">Warning:</h4>\n", | ||
"\n", | ||
"Failure to connect MIPI camera and DisplayPort cable may cause the notebook to hang\n", | ||
"</div>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"app.start()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Play with the Application <a class=\"anchor\" id=\"play\"></a>\n", | ||
"\n", | ||
"The `.play()` method exposes two algorithms to detect corners `Fast` and `Corner Harris`. Threshold and K (only for Corner Harris) can be updated to select when something is detected as a corner.\n", | ||
"\n", | ||
"Change algorithm and move the sliders and notice how the output video changes." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"app.play()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Stop Application <a class=\"anchor\" id=\"stop\"></a>\n", | ||
"\n", | ||
"Finally stop the application to release the resources\n", | ||
"\n", | ||
"<div class=\"alert alert-heading alert-danger\">\n", | ||
" <h4 class=\"alert-heading\">Warning:</h4>\n", | ||
"\n", | ||
"Failure to stop the app may hang the board \n", | ||
"when trying to download another bitstream onto the FPGA\n", | ||
"</div>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"app.stop()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"----\n", | ||
"\n", | ||
"## Conclusion <a class=\"anchor\" id=\"conclusion\"></a>\n", | ||
"\n", | ||
"This notebook has presented the Corner Detect application that leverages the Composable Overlay. \n", | ||
"\n", | ||
"The runtime parameters of such application can be modified using drop-down and sliders from `ipywidgets`\n", | ||
"\n", | ||
"[⬅️ Difference of Gaussians Application MIPI](01_difference_gaussians_app.ipynb) | | [Color Detect Application MIPI ➡️](03_color_detect_app.ipynb)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Copyright © 2021 Xilinx, Inc\n", | ||
"\n", | ||
"SPDX-License-Identifier: BSD-3-Clause\n", | ||
"\n", | ||
"----" | ||
] | ||
} | ||
], | ||
"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.8.2" | ||
}, | ||
"widgets": { | ||
"application/vnd.jupyter.widget-state+json": { | ||
"state": {}, | ||
"version_major": 2, | ||
"version_minor": 0 | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
Oops, something went wrong.