Skip to content
Permalink
Browse files

pre-commit hooks for clearing ipynb outputs

  • Loading branch information...
danlester committed Jul 29, 2019
1 parent 1251c4b commit f2007498252efef482424a757d64ec2c9ddf1b94
Showing with 62 additions and 340 deletions.
  1. +13 −133 Example/Examples-multiple.ipynb
  2. +12 −75 Example/FlatImages.ipynb
  3. +17 −132 Example/Tests-Images.ipynb
  4. +2 −0 docs/chapters/installation.rst
  5. +18 −0 githooks/pre-commit
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -25,24 +25,9 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a79f308e80bd4307a11157415373a82e",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Innotater(children=(HBox(children=(VBox(children=(ImagePad(value=b'\\xff\\xd8\\xff\\xe0\\x00\\x10JFIF\\x00\\x01\\x01\\x0…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"animalfns = sorted(os.listdir('./animals/'))\n",
"\n",
@@ -69,35 +54,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Class Indices [[0]\n",
" [1]]\n",
"Bounding Boxes [[[ 74 8 143 242]\n",
" [174 12 92 95]\n",
" [222 78 116 168]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]]\n",
"\n",
" [[ 5 55 178 241]\n",
" [215 4 185 249]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]]]\n"
]
}
],
"outputs": [],
"source": [
"print('Class Indices', targets_type[:2]) # Just display the first 2 to save space\n",
"print('Bounding Boxes', targets_bboxes[:2])"
@@ -120,26 +79,9 @@
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "307746c8e81b4c9eb7357c1079f0fce1",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Innotater(children=(HBox(children=(VBox(children=(ImagePad(value=b'\\xff\\xd8\\xff\\xe0\\x00\\x10JFIF\\x00\\x01\\x01\\x0…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"repeats = 8\n",
"\n",
@@ -173,54 +115,9 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Exclude Flag [[0]\n",
" [0]]\n",
"Main Bounding Boxes [[ 72 7 255 242]\n",
" [ 6 0 391 297]]\n",
"Animal Bounding Boxes [[[ 90 6 117 239]\n",
" [191 15 86 85]\n",
" [226 83 109 165]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]]\n",
"\n",
" [[ 12 44 171 250]\n",
" [209 4 191 279]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]\n",
" [ 0 0 0 0]]]\n",
"Animal Breeds [[[1 0 0 0 0]\n",
" [1 0 0 0 0]\n",
" [1 0 0 0 0]\n",
" [1 0 0 0 0]\n",
" [1 0 0 0 0]\n",
" [1 0 0 0 0]\n",
" [1 0 0 0 0]\n",
" [1 0 0 0 0]]\n",
"\n",
" [[0 0 0 1 0]\n",
" [0 0 0 0 1]\n",
" [1 0 0 0 0]\n",
" [1 0 0 0 0]\n",
" [1 0 0 0 0]\n",
" [1 0 0 0 0]\n",
" [1 0 0 0 0]\n",
" [1 0 0 0 0]]]\n"
]
}
],
"outputs": [],
"source": [
"print('Exclude Flag', targets_exclude[:2]) # Just display the first 2 to save space\n",
"print('Main Bounding Boxes', targets_mainbbox[:2])\n",
@@ -239,26 +136,9 @@
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7a937ecfba98417cbeb9f5155cff98bd",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Innotater(children=(HBox(children=(VBox(children=(ImagePad(value=b'\\xff\\xd8\\xff\\xe0\\x00\\x10JFIF\\x00\\x01\\x01\\x0…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"targets_singlebb = np.zeros((len(animalfns), 4), dtype='int') # (x,y,w,h) for each data row\n",
"targets_cl = np.zeros((len(animalfns), 1), dtype='int')\n",
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -20,20 +20,9 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(300, 400, 3)"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"classes = ['vegetable', 'biscuit', 'fruit']\n",
"foods = [cv2.imread('./foods/'+f) for f in foodfns]\n",
@@ -44,24 +33,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1c703c14a7ac46c1a6f2c644fb646026",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Innotater(children=(HBox(children=(VBox(children=(ImagePad(value=b'\\x89PNG\\r\\n\\x1a\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"w2 = Innotater(\n",
" ImageInnotation(foods, name='Food'), \n",
@@ -79,7 +53,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -89,64 +63,27 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(300, 400)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"foods_flat[0].shape"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"242"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"foods[0].max()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ad55b5a2b6b84f39b575f6387ca430e9",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Innotater(children=(HBox(children=(VBox(children=(ImagePad(value=b'\\x89PNG\\r\\n\\x1a\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"w2f = Innotater(\n",
" ImageInnotation(foods_flat, name='Food'), \n",

0 comments on commit f200749

Please sign in to comment.
You can’t perform that action at this time.