Skip to content

Commit

Permalink
Update open in colab badge
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjingforever authored May 9, 2024
1 parent 8078362 commit 6923192
Showing 1 changed file with 62 additions and 60 deletions.
122 changes: 62 additions & 60 deletions example_colabs/quick_start.ipynb
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"collapsed_sections": [
"vCM_sxQsg2nj",
"nSHa2LHCg7Gz",
"tNzvaoFHhBJR",
"Q3aMYkE6HMPM"
],
"private_outputs": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "Earrbj1HNaVk"
},
"source": [
"# Google AI Edge Model Explorer [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-ai-edge/model-explorer/blob/main/example_colabs/quick_start.ipynb)\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-ai-edge/model-explorer/blob/main/example_colabs/quick_start.ipynb)\n",
"\n",
"# Google AI Edge Model Explorer\n",
"A visualization tool that lets you analyze ML models and graphs, accelerating deployment to on-device targets. [Learn more](https://ai.google.dev/edge/model-explorer).\n",
"\n",
"**Key Features**\n",
Expand All @@ -37,19 +21,16 @@
"Follow the [installation instructions](https://github.com/google-ai-edge/model-explorer/wiki/5.-Run-in-Colab-Notebook) to add it to your own Colab.\n",
"\n",
"Want to run Model Explorer locally? [Get Started here](https://github.com/google-ai-edge/model-explorer/wiki/1.-Installation)"
],
"metadata": {
"id": "Earrbj1HNaVk"
}
]
},
{
"cell_type": "markdown",
"source": [
"# Download a copy of the EfficientDet TFLite model"
],
"metadata": {
"id": "vCM_sxQsg2nj"
}
},
"source": [
"# Download a copy of the EfficientDet TFLite model"
]
},
{
"cell_type": "code",
Expand All @@ -72,71 +53,92 @@
},
{
"cell_type": "markdown",
"source": [
"# Install Model Explorer using pip"
],
"metadata": {
"id": "nSHa2LHCg7Gz"
}
},
"source": [
"# Install Model Explorer using pip"
]
},
{
"cell_type": "code",
"source": [
"!pip install --no-deps model-explorer-adapter ai-edge-model-explorer"
],
"execution_count": null,
"metadata": {
"id": "XqnjhEVqkSvU"
},
"execution_count": null,
"outputs": []
"outputs": [],
"source": [
"!pip install --no-deps model-explorer-adapter ai-edge-model-explorer"
]
},
{
"cell_type": "markdown",
"source": [
"# Visualize the downloaded EfficientDet model"
],
"metadata": {
"id": "tNzvaoFHhBJR"
}
},
"source": [
"# Visualize the downloaded EfficientDet model"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "_qycf3tbmP_S"
},
"outputs": [],
"source": [
"import model_explorer\n",
"\n",
"model_explorer.visualize(model_path)"
],
"metadata": {
"id": "_qycf3tbmP_S"
},
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Q3aMYkE6HMPM"
},
"source": [
"# Visualize a PyTorch model\n",
"\n"
],
"metadata": {
"id": "Q3aMYkE6HMPM"
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "sZJkEgdsHSH9"
},
"outputs": [],
"source": [
"# Get mobilnet v2 pytorch model as an example.\n",
"model = torchvision.models.mobilenet_v2().eval()\n",
"inputs = (torch.rand([1, 3, 224, 224]),)\n",
"\n",
"# Visualize\n",
"model_explorer.visualize_pytorch('mobilenet', model, inputs)"
]
}
],
"metadata": {
"colab": {
"collapsed_sections": [
"vCM_sxQsg2nj",
"nSHa2LHCg7Gz",
"tNzvaoFHhBJR",
"Q3aMYkE6HMPM"
],
"metadata": {
"id": "sZJkEgdsHSH9"
},
"execution_count": null,
"outputs": []
"private_outputs": true,
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
]
}
},
"nbformat": 4,
"nbformat_minor": 0
}

0 comments on commit 6923192

Please sign in to comment.