Skip to content

Commit

Permalink
Update PerroMapacheGatoCocheDeploy.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankEscobar authored Feb 21, 2021
1 parent f0d3871 commit 5909dc4
Showing 1 changed file with 19 additions and 131 deletions.
150 changes: 19 additions & 131 deletions PerroMapacheGatoCocheDeploy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,139 +2,53 @@
"cells": [
{
"cell_type": "code",
"execution_count": 61,
"id": "happy-remedy",
"execution_count": null,
"id": "mobile-mailing",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: voila in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (0.2.7)\n",
"Requirement already satisfied: nbclient<0.6,>=0.4.0 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from voila) (0.5.2)\n",
"Requirement already satisfied: jupyter-client<7,>=6.1.3 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from voila) (6.1.7)\n",
"Requirement already satisfied: jupyter-server<2.0.0,>=0.3.0 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from voila) (1.4.0)\n",
"Requirement already satisfied: nbconvert<7,>=6.0.0 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from voila) (6.0.7)\n",
"Requirement already satisfied: jupyter-core>=4.6.0 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-client<7,>=6.1.3->voila) (4.7.1)\n",
"Requirement already satisfied: python-dateutil>=2.1 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-client<7,>=6.1.3->voila) (2.8.1)\n",
"Requirement already satisfied: pyzmq>=13 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-client<7,>=6.1.3->voila) (20.0.0)\n",
"Requirement already satisfied: tornado>=4.1 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-client<7,>=6.1.3->voila) (6.1)\n",
"Requirement already satisfied: traitlets in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-client<7,>=6.1.3->voila) (5.0.5)\n",
"Requirement already satisfied: pywin32>=1.0 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-core>=4.6.0->jupyter-client<7,>=6.1.3->voila) (227)\n",
"Requirement already satisfied: nbformat in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-server<2.0.0,>=0.3.0->voila) (5.1.2)\n",
"Requirement already satisfied: Send2Trash in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-server<2.0.0,>=0.3.0->voila) (1.5.0)\n",
"Requirement already satisfied: anyio>=2.0.2 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-server<2.0.0,>=0.3.0->voila) (2.1.0)\n",
"Requirement already satisfied: prometheus-client in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-server<2.0.0,>=0.3.0->voila) (0.9.0)\n",
"Requirement already satisfied: ipython-genutils in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-server<2.0.0,>=0.3.0->voila) (0.2.0)\n",
"Requirement already satisfied: jinja2 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-server<2.0.0,>=0.3.0->voila) (2.11.3)\n",
"Requirement already satisfied: terminado>=0.8.3 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jupyter-server<2.0.0,>=0.3.0->voila) (0.9.2)\n",
"Requirement already satisfied: typing-extensions in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from anyio>=2.0.2->jupyter-server<2.0.0,>=0.3.0->voila) (3.7.4.3)\n",
"Requirement already satisfied: sniffio>=1.1 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from anyio>=2.0.2->jupyter-server<2.0.0,>=0.3.0->voila) (1.2.0)\n",
"Requirement already satisfied: idna>=2.8 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from anyio>=2.0.2->jupyter-server<2.0.0,>=0.3.0->voila) (2.10)\n",
"Requirement already satisfied: async-generator in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from nbclient<0.6,>=0.4.0->voila) (1.10)\n",
"Requirement already satisfied: nest-asyncio in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from nbclient<0.6,>=0.4.0->voila) (1.5.1)\n",
"Requirement already satisfied: testpath in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from nbconvert<7,>=6.0.0->voila) (0.4.4)\n",
"Requirement already satisfied: jupyterlab-pygments in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from nbconvert<7,>=6.0.0->voila) (0.1.2)\n",
"Requirement already satisfied: bleach in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from nbconvert<7,>=6.0.0->voila) (3.3.0)\n",
"Requirement already satisfied: entrypoints>=0.2.2 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from nbconvert<7,>=6.0.0->voila) (0.3)\n",
"Requirement already satisfied: mistune<2,>=0.8.1 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from nbconvert<7,>=6.0.0->voila) (0.8.4)\n",
"Requirement already satisfied: defusedxml in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from nbconvert<7,>=6.0.0->voila) (0.6.0)\n",
"Requirement already satisfied: pandocfilters>=1.4.1 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from nbconvert<7,>=6.0.0->voila) (1.4.3)\n",
"Requirement already satisfied: pygments>=2.4.1 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from nbconvert<7,>=6.0.0->voila) (2.7.4)\n",
"Requirement already satisfied: MarkupSafe>=0.23 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jinja2->jupyter-server<2.0.0,>=0.3.0->voila) (1.1.1)\n",
"Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from nbformat->jupyter-server<2.0.0,>=0.3.0->voila) (3.0.2)\n",
"Requirement already satisfied: pyrsistent>=0.14.0 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jsonschema!=2.5.0,>=2.4->nbformat->jupyter-server<2.0.0,>=0.3.0->voila) (0.17.3)\n",
"Requirement already satisfied: setuptools in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jsonschema!=2.5.0,>=2.4->nbformat->jupyter-server<2.0.0,>=0.3.0->voila) (52.0.0.post20210125)\n",
"Requirement already satisfied: six>=1.11.0 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jsonschema!=2.5.0,>=2.4->nbformat->jupyter-server<2.0.0,>=0.3.0->voila) (1.15.0)\n",
"Requirement already satisfied: attrs>=17.4.0 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from jsonschema!=2.5.0,>=2.4->nbformat->jupyter-server<2.0.0,>=0.3.0->voila) (20.3.0)\n",
"Requirement already satisfied: pywinpty>=0.5 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from terminado>=0.8.3->jupyter-server<2.0.0,>=0.3.0->voila) (0.5.7)\n",
"Requirement already satisfied: webencodings in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from bleach->nbconvert<7,>=6.0.0->voila) (0.5.1)\n",
"Requirement already satisfied: packaging in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from bleach->nbconvert<7,>=6.0.0->voila) (20.9)\n",
"Requirement already satisfied: pyparsing>=2.0.2 in c:\\users\\victor\\.conda\\envs\\fastai\\lib\\site-packages (from packaging->bleach->nbconvert<7,>=6.0.0->voila) (2.4.7)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Enabling: voila\n",
"- Writing config: C:\\Users\\Victor\\.conda\\envs\\FastAI\\etc\\jupyter\n",
" - Validating...\n",
" voila 0.2.7 ok\n"
]
}
],
"outputs": [],
"source": [
"#hide\n",
"!pip install -Uqq fastbook\n",
"!pip install voila\n",
"!jupyter serverextension enable --sys-prefix voila\n",
"import fastbook\n",
"fastbook.setup_book()\n",
"from fastbook import *\n",
"from fastai.vision.widgets import *\n",
"from fastai import *"
"from fastai.vision.widgets import *"
]
},
{
"cell_type": "code",
"execution_count": 42,
"id": "front-independence",
"execution_count": 4,
"id": "specific-connectivity",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<fastai.learner.Learner at 0x25304955b08>"
]
},
"execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"learn_inf = load_learner('./export.pkl')\n",
"learn_inf"
"learn_inf = load_learner('export.pkl')"
]
},
{
"cell_type": "code",
"execution_count": 58,
"id": "potential-poetry",
"execution_count": null,
"id": "initial-theater",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a46c0541b0f741ebbb725e007329717e",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"FileUpload(value={}, description='Upload')"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"from fastai import *\n",
"btn_upload = vision.widgets.FileUpload()\n",
"out_pl = vision.widgets.Output()\n",
"btn_run = vision.widgets.Button(description='Clasificar')\n",
"lbl_prediction_a = widgets.Label()\n",
"lbl_prediction_b = widgets.Label()\n",
"btn_upload"
"lbl_prediction_b = widgets.Label()"
]
},
{
"cell_type": "code",
"execution_count": 48,
"id": "infrared-treasury",
"execution_count": null,
"id": "invisible-grade",
"metadata": {},
"outputs": [],
"source": [
"\n",
"def on_click_classify(change):\n",
" img = PILImage.create(btn_upload.data[0])\n",
" out_pl.clear_output()\n",
Expand All @@ -151,36 +65,10 @@
},
{
"cell_type": "code",
"execution_count": 50,
"id": "allied-people",
"execution_count": null,
"id": "composite-sauce",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"FileUpload(value={}, description='Upload')\n",
"Button(description='Clasificar', style=ButtonStyle())\n",
"Output()\n",
"Label(value='')\n",
"Label(value='')\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "83695b40705242b6803bf11b55dc7355",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(Label(value='Selecciona tu cosa'), FileUpload(value={}, description='Upload'), Button(descripti…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"#hide_output\n",
"print(btn_upload)\n",
Expand Down

0 comments on commit 5909dc4

Please sign in to comment.