Skip to content
Permalink
Browse files

Readme simplified in favour of ReadTheDocs

  • Loading branch information...
danlester committed Jun 4, 2019
1 parent f0d2794 commit 8ddec9f406db176e688a85926d8d1e05d2b535d5
Showing with 190 additions and 370 deletions.
  1. +42 −41 Example/Examples-multiple.ipynb
  2. +83 −118 Example/Examples.ipynb
  3. +64 −210 README.md
  4. +1 −1 docs/chapters/examples/multiple.rst
@@ -25,13 +25,13 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6f6bb175a4e14bf28a3c428aa8374cb7",
"model_id": "a79f308e80bd4307a11157415373a82e",
"version_major": 2,
"version_minor": 0
},
@@ -50,7 +50,7 @@
"\n",
"# Per-photo data\n",
"classes = ['cat', 'dog']\n",
"targets_type = np.zeros((len(animalfns), len(classes)), dtype='int') # One-hot encoding\n",
"targets_type = np.zeros((len(animalfns), 1), dtype='int') # Column vector containing class index\n",
"\n",
"# Repeats within each photo\n",
"targets_bboxes = np.zeros((len(animalfns), repeats, 4), dtype='int') # (x,y,w,h) for each animal\n",
@@ -69,26 +69,26 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"One-hot classes [[1 0]\n",
" [0 1]]\n",
"Bounding Boxes [[[ 79 5 143 242]\n",
" [182 15 84 95]\n",
" [225 83 97 163]\n",
"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",
" [[ 8 54 171 246]\n",
" [204 8 196 282]\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",
@@ -99,7 +99,7 @@
}
],
"source": [
"print('One-hot classes', targets_type[:2]) # Just display the first 2 to save space\n",
"print('Class Indices', targets_type[:2]) # Just display the first 2 to save space\n",
"print('Bounding Boxes', targets_bboxes[:2])"
]
},
@@ -120,15 +120,15 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 4,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "96ec4134943346069949c02791fa3035",
"model_id": "307746c8e81b4c9eb7357c1079f0fce1",
"version_major": 2,
"version_minor": 0
},
@@ -150,6 +150,7 @@
"# Repeats within each photo\n",
"breeds = ['Cat - Shorthair tabby', 'Cat - Shorthair ginger', 'Dog - Labrador', 'Dog - Beagle', 'Dog - Terrier']\n",
"targets_breed = np.zeros((len(animalfns), repeats, len(breeds)), dtype='int')\n",
"targets_breed[:,:,0] = 1 # Set up one-hot default to first class\n",
"targets_bboxes = np.zeros((len(animalfns), repeats, 4), dtype='int') # (x,y,w,h) for each animal\n",
"\n",
"Innotater(\n",
@@ -158,7 +159,7 @@
" TextInnotation(animalfns, multiline=False) # Display the image filename\n",
" ],\n",
" [\n",
" BinaryClassInnotation(targets_type, name='Exclude'), # Checkbox\n",
" BinaryClassInnotation(targets_exclude, name='Exclude'), # Checkbox\n",
" BoundingBoxInnotation(targets_mainbbox, name='Main Bounding Box'), # BBox for main image\n",
" RepeatInnotation(\n",
" (BoundingBoxInnotation, targets_bboxes), # Individual animal bounding box\n",
@@ -172,56 +173,56 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"One-hot Exclude [[0]\n",
"Exclude Flag [[0]\n",
" [0]]\n",
"Main Bounding Boxes [[0 0 0 0]\n",
" [0 0 0 0]]\n",
"Animal Bounding Boxes [[[ 77 10 136 235]\n",
" [186 11 86 99]\n",
" [230 80 97 169]\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",
" [[ 0 55 175 245]\n",
" [213 2 187 295]\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 [[[0 0 0 0 0]\n",
" [0 0 0 0 0]\n",
" [0 0 0 0 0]\n",
" [0 0 0 0 0]\n",
" [0 0 0 0 0]\n",
" [0 0 0 0 0]\n",
" [0 0 0 0 0]\n",
" [0 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",
" [0 0 0 0 0]\n",
" [0 0 0 0 0]\n",
" [0 0 0 0 0]\n",
" [0 0 0 0 0]\n",
" [0 0 0 0 0]\n",
" [0 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"
]
}
],
"source": [
"print('One-hot Exclude', targets_exclude[:2]) # Just display the first 2 to save space\n",
"print('Exclude Flag', targets_exclude[:2]) # Just display the first 2 to save space\n",
"print('Main Bounding Boxes', targets_mainbbox[:2])\n",
"print('Animal Bounding Boxes', targets_bboxes[:2])\n",
"print('Animal Breeds', targets_breed[:2])"
@@ -238,15 +239,15 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 6,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c5d36e838bea4da9a73de1a5feca6e4c",
"model_id": "7a937ecfba98417cbeb9f5155cff98bd",
"version_major": 2,
"version_minor": 0
},

0 comments on commit 8ddec9f

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