Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"source": [
"%matplotlib inline\n",
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"import pdb\n",
"\n",
"import keras\n",
"import keras.preprocessing.image\n",
"from keras.applications.imagenet_utils import get_file\n",
"\n",
"import keras_resnet.models\n",
"import keras_retinanet.layers\n",
"import keras_retinanet.models\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import cv2\n",
"import numpy as np\n",
"import sys\n",
"import math\n",
"\n",
"import tensorflow as tf\n",
"\n",
"def get_session():\n",
" config = tf.ConfigProto()\n",
" config.gpu_options.allow_growth = True\n",
" return tf.Session(config=config)\n",
"\n",
"keras.backend.tensorflow_backend.set_session(get_session())\n",
"\n",
"WEIGHTS_PATH_NO_TOP = 'https://github.com/fchollet/deep-learning-models/releases/download/v0.2/resnet50_weights_tf_dim_ordering_tf_kernels_notop.h5'"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/lib/python3.6/site-packages/ipykernel/__main__.py:15: UserWarning: Output \"classification_softmax\" missing from loss dictionary. We assume this was done on purpose, and we will not be expecting any data to be passed to \"classification_softmax\" during training.\n",
"/usr/lib/python3.6/site-packages/ipykernel/__main__.py:15: UserWarning: Output \"concatenate_23\" missing from loss dictionary. We assume this was done on purpose, and we will not be expecting any data to be passed to \"concatenate_23\" during training.\n",
"/usr/lib/python3.6/site-packages/ipykernel/__main__.py:15: UserWarning: Output \"focal_loss_2\" missing from loss dictionary. We assume this was done on purpose, and we will not be expecting any data to be passed to \"focal_loss_2\" during training.\n",
"/usr/lib/python3.6/site-packages/ipykernel/__main__.py:15: UserWarning: Output \"concatenate_22\" missing from loss dictionary. We assume this was done on purpose, and we will not be expecting any data to be passed to \"concatenate_22\" during training.\n"
]
}
],
"source": [
"def create_model(num_classes=3, *args, **kwargs):\n",
" image = keras.layers.Input((512, 512, 3))\n",
" im_info = keras.layers.Input((3,))\n",
" gt_boxes = keras.layers.Input((None, 5))\n",
" \n",
" return keras_retinanet.models.ResNet50RetinaNet([image, im_info, gt_boxes], num_classes=num_classes)\n",
"\n",
"model = create_model()\n",
"\n",
"# load imagenet weights\n",
"weights_path = get_file('resnet50_weights_tf_dim_ordering_tf_kernels_notop.h5', WEIGHTS_PATH_NO_TOP, cache_subdir='models', md5_hash='a268eb855778b3df3c7506639542a6af')\n",
"model.load_weights(weights_path, by_name=True)\n",
"\n",
"# compile model\n",
"model.compile(loss=None, optimizer=keras.optimizers.Adam(lr=1e-4))"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQYAAAD8CAYAAACVSwr3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADWlJREFUeJzt3VuMnOV9x/HvrzaHtFAcjrVstwbFF3DREmQRR0QVJUkF\nbhRzARVRJFxkyVIPUiIqpaaVWkXqRelFIFErUqugmioHaA6yhZJSZIjaGwx2OMclmIrCyggLAU4q\npLZO/r2YZ5Opn4Ud7JmdWfh+pNE87/M+s/Nfz/q3z3vcVBWSNOwXpl2ApNljMEjqGAySOgaDpI7B\nIKljMEjqTCQYklyd5Nkkh5LsmMR7SJqcjPs8hiQrgB8CHwfmgEeBT1XVD8b6RpImZhIzhsuBQ1X1\nH1X1P8DXgS0TeB9JE7JyAl9zDfDS0PIc8KG3e0EST7+UJu/VqjpvlIGTCIYs0Nf9x0+yHdg+gfeX\ntLD/HHXgJIJhDlg3tLwWOHz8oKraCewEZwzSrJnEPoZHgQ1JLkxyKnADsGcC7yNpQsY+Y6iqY0n+\nCLgfWAHcVVXPjPt9JE3O2A9XnlARbkpIS+FAVW0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text/plain": [
"<matplotlib.figure.Figure at 0x7f63e19c0d30>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"(1, 512, 512, 3) (1, 3) (1, 2, 5)\n"
]
}
],
"source": [
"# generate really simple image with one object\n",
"image = np.zeros((512, 512, 3), dtype=keras.backend.floatx())\n",
"image[192:400, 192:400, :] = 1.0\n",
"image[64:128, 64:128, :] = -1.0\n",
"plt.imshow(image, cmap='gray')\n",
"plt.show()\n",
"\n",
"# create input batch blobs\n",
"im_info_batch = np.array([[512, 512, 1.0]])\n",
"gt_boxes_batch = np.array([[[192, 192, 400, 400, 2], [64, 64, 128, 128, 1]]])\n",
"\n",
"image_batch = np.expand_dims(image, axis=0)\n",
"\n",
"inputs = [image_batch, im_info_batch, gt_boxes_batch]\n",
"\n",
"def simple_data_generator():\n",
" while True:\n",
" yield inputs, None\n",
"\n",
"print(image_batch.shape, im_info_batch.shape, gt_boxes_batch.shape)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch 1/10\n",
"100/100 [==============================] - 12s - loss: 4.7327e-07 \n",
"Epoch 2/10\n",
"100/100 [==============================] - 12s - loss: 3.9538e-07 \n",
"Epoch 3/10\n",
"100/100 [==============================] - 12s - loss: 3.3207e-07 \n",
"Epoch 4/10\n",
"100/100 [==============================] - 12s - loss: 2.8016e-07 \n",
"Epoch 5/10\n",
"100/100 [==============================] - 12s - loss: 2.3733e-07 \n",
"Epoch 6/10\n",
"100/100 [==============================] - 12s - loss: 2.0144e-07 \n",
"Epoch 7/10\n",
"100/100 [==============================] - 12s - loss: 1.7116e-07 \n",
"Epoch 8/10\n",
"100/100 [==============================] - 12s - loss: 1.4550e-07 \n",
"Epoch 9/10\n",
"100/100 [==============================] - 12s - loss: 1.2357e-07 \n",
"Epoch 10/10\n",
"100/100 [==============================] - 12s - loss: 1.0511e-07 \n"
]
},
{
"data": {
"text/plain": [
"<keras.callbacks.History at 0x7f645abee128>"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# train for some iterations\n",
"model.fit_generator(generator=simple_data_generator(),steps_per_epoch=100,epochs=10,verbose=1)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"scrolled": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(1, 49104) (1, 49104, 3) (1, 49104, 4)\n",
"1.0 [ 2.07611942e-03 9.97923851e-01 8.24712035e-11]\n",
"1.0 [ 1.56506745e-03 9.98434961e-01 4.64021355e-09]\n",
"1.0 [ 2.26700786e-06 9.99997735e-01 1.67636641e-10]\n",
"1.0 [ 7.85623677e-04 9.99214411e-01 2.13077578e-09]\n",
"1.0 [ 2.11134943e-06 9.99997854e-01 4.09125755e-09]\n",
"1.0 [ 1.47294742e-03 9.98527050e-01 1.51459467e-08]\n",
"1.0 [ 9.21399312e-09 1.00000000e+00 1.45735035e-10]\n",
"1.0 [ 2.23192242e-09 1.00000000e+00 2.62091393e-09]\n",
"1.0 [ 1.32897890e-06 9.99998689e-01 4.00265110e-09]\n",
"1.0 [ 3.70260682e-06 9.99996305e-01 1.93765022e-08]\n",
"1.0 [ 2.19099573e-03 9.97808993e-01 3.85744636e-09]\n",
"1.0 [ 2.48410215e-04 9.99750555e-01 1.08024267e-06]\n",
"1.0 [ 4.45585293e-08 1.00000000e+00 3.21081717e-10]\n",
"1.0 [ 4.23887229e-07 9.99999166e-01 3.87737089e-07]\n",
"1.0 [ 1.50253763e-03 9.98493433e-01 4.05902438e-06]\n",
"1.0 [ 2.06248346e-03 9.97937560e-01 8.75598172e-09]\n",
"1.0 [ 1.04739307e-03 9.98952627e-01 2.19782628e-08]\n",
"1.0 [ 1.79870876e-05 9.99981999e-01 6.34386640e-13]\n",
"1.0 [ 3.37892375e-03 9.96621013e-01 2.71500265e-16]\n",
"1.0 [ 0.00169148 0.99830854 0. ]\n",
"1.0 [ 3.59520433e-03 9.96404767e-01 9.08144651e-22]\n",
"1.0 [ 2.18646252e-03 9.97813463e-01 5.99607495e-13]\n",
"1.0 [ 6.50533475e-05 9.99934912e-01 7.29690960e-12]\n",
"1.0 [ 1.28020400e-10 1.00000000e+00 0.00000000e+00]\n",
"1.0 [ 1.63928782e-09 1.00000000e+00 9.92936821e-17]\n",
"1.0 [ 1.15664232e-11 1.00000000e+00 3.42808979e-13]\n",
"1.0 [ 1.26417644e-11 1.00000000e+00 1.15590670e-13]\n",
"1.0 [ 2.32336230e-08 1.00000000e+00 0.00000000e+00]\n",
"1.0 [ 1.42165864e-05 9.99985814e-01 5.40237560e-12]\n",
"1.0 [ 0.00166771 0.99833232 0. ]\n",
"1.0 [ 3.04485881e-03 9.96955156e-01 5.53238255e-09]\n",
"1.0 [ 4.57107380e-04 9.99542952e-01 5.89325073e-12]\n",
"1.0 [ 2.95174832e-04 9.99704659e-01 1.71102045e-07]\n",
"1.0 [ 3.69009096e-03 9.96309936e-01 3.42398473e-13]\n",
"1.0 [ 1.53104274e-03 9.98468697e-01 2.21423718e-07]\n",
"1.0 [ 0.00146389 0.99853611 0. ]\n",
"1.0 [ 3.26309423e-03 9.96736825e-01 1.41052325e-07]\n",
"2.0 [ 1.42700563e-03 1.43542775e-10 9.98572946e-01]\n",
"2.0 [ 2.48760771e-04 3.27116148e-08 9.99751151e-01]\n",
"2.0 [ 4.18200689e-05 5.77188124e-12 9.99958158e-01]\n",
"2.0 [ 2.74131919e-04 5.03822619e-08 9.99725759e-01]\n",
"2.0 [ 1.12352578e-03 1.45903115e-07 9.98876274e-01]\n",
"2.0 [ 2.32492550e-03 4.49036224e-06 9.97670591e-01]\n",
"2.0 [ 2.57360842e-03 7.43304203e-12 9.97426331e-01]\n",
"2.0 [ 1.03544546e-04 4.95569509e-07 9.99895930e-01]\n",
"2.0 [ 1.41000934e-03 1.40816803e-06 9.98588502e-01]\n",
"2.0 [ 1.74566798e-04 1.26644972e-09 9.99825418e-01]\n",
"2.0 [ 5.69057993e-05 2.16667830e-12 9.99943137e-01]\n",
"2.0 [ 2.82478373e-04 4.96227448e-10 9.99717534e-01]\n",
"2.0 [ 1.45129266e-03 3.68589924e-12 9.98548687e-01]\n",
"2.0 [ 5.65189282e-07 2.36307415e-12 9.99999404e-01]\n",
"2.0 [ 3.13012949e-09 2.22377228e-09 1.00000000e+00]\n",
"2.0 [ 7.11576909e-10 1.17960561e-15 1.00000000e+00]\n",
"2.0 [ 1.43832363e-10 1.49871673e-12 1.00000000e+00]\n",
"2.0 [ 4.92735630e-08 8.37724225e-15 1.00000000e+00]\n",
"2.0 [ 1.67512528e-08 1.98524808e-10 1.00000000e+00]\n",
"2.0 [ 4.14237803e-07 1.54323885e-07 9.99999404e-01]\n",
"2.0 [ 6.17919284e-07 2.14155277e-15 9.99999404e-01]\n",
"2.0 [ 1.67996872e-09 2.96160006e-11 1.00000000e+00]\n",
"2.0 [ 1.58451451e-03 7.63657461e-14 9.98415470e-01]\n",
"2.0 [ 4.17562404e-07 3.08762438e-09 9.99999523e-01]\n",
"2.0 [ 2.69039022e-03 1.96636705e-07 9.97309446e-01]\n",
"2.0 [ 7.76574307e-04 1.72582656e-06 9.99221683e-01]\n",
"2.0 [ 3.56694986e-03 8.25459406e-12 9.96433020e-01]\n",
"2.0 [ 8.97541104e-05 1.74763748e-09 9.99910235e-01]\n",
"2.0 [ 3.33245983e-03 5.36455082e-16 9.96667564e-01]\n",
"2.0 [ 2.65802100e-07 1.98834368e-06 9.99997735e-01]\n",
"2.0 [ 1.29129319e-06 2.07540140e-15 9.99998689e-01]\n",
"2.0 [ 2.08257589e-09 4.46392532e-12 1.00000000e+00]\n",
"2.0 [ 3.98147131e-05 8.14328871e-09 9.99960184e-01]\n",
"2.0 [ 5.01298600e-05 1.04539940e-05 9.99939442e-01]\n",
"2.0 [ 5.25748124e-04 7.26537937e-15 9.99474227e-01]\n",
"2.0 [ 2.35757497e-07 6.30105551e-11 9.99999762e-01]\n",
"2.0 [ 1.04627409e-03 5.31124655e-08 9.98953700e-01]\n",
"2.0 [ 3.62033909e-03 2.82681071e-07 9.96379435e-01]\n",
"2.0 [ 2.03396613e-03 4.33538116e-06 9.97961760e-01]\n",
"2.0 [ 2.53706914e-03 2.81509529e-06 9.97460186e-01]\n",
"2.0 [ 2.29555159e-03 1.18074684e-04 9.97586370e-01]\n",
"2.0 [ 3.17676324e-07 3.52383613e-05 9.99964476e-01]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAksAAAJCCAYAAADQsoPKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3V+sdWddJ/DvjxbEqGMBgTRtZ8DYC7wYkWmYJsyFomMA\nieUCMhhHGtLkvXESTJw46I1xooneiCEzIWmEWIyKBGVojJmxKRjnBqQV5I/V4ZUw9J02NA5QdUg0\n6DMXZ73t4XTvZ/85+89ae30+yck5e+211/nt/eyz9vc861nPqtZaAABY7FnHLgAAYMyEJQCADmEJ\nAKBDWAIA6BCWAAA6hCUAgI69hKWqek1V/WVVXa2qt+/jdwAAHELtep6lqrohyf9K8m+TXEvy8SQ/\n2lr7853+IgCAA9hHz9Irk1xtrX2+tfYPSd6X5K49/B4AgL27cQ/bvCXJo+duX0vyr3sPqCrTiAMA\nh/bXrbUXrlppH2GpFix7RhiqqitJruzh9wMArON/r7PSPsLStSS3nbt9a5LHLq7UWrs3yb2JniUA\nYLz2MWbp40lur6qXVtVzkrw5yf17+D0AAHu3856l1trXq+o/JPkfSW5I8p7W2md3/XsAAA5h51MH\nbFWEw3AAwOE93Fq7Y9VKZvAGAOgQlgAAOoQlAIAOYQkAoENYAgDoEJYAADqEJQCADmEJAKBDWAIA\n6BCWAAA6hCUAgA5hCQCgQ1gCAOgQlgAAOoQlAIAOYQkAoOPGYxfACu3YBRxBHbsAAHianqUxm2NQ\nSub7vAEYJWFprOYeGOb+/AEYDWEJAKBDWAIA6BCWAAA6nA03Jad8lpgxSgCMlJ4lAI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VORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f63c692d390>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# predict the same image again\n",
"classification, labels, cls_loss, anchors = model.predict_on_batch(inputs)\n",
"\n",
"# visualize the positive anchors\n",
"indices = np.where(labels[0, :] > 0)[0]\n",
"im = image_batch[0, ...].copy()\n",
"print(labels.shape, classification.shape, anchors.shape)\n",
"for idx in indices:\n",
" # print the label and the classification scores\n",
" print(labels[0, idx], classification[0, idx, :])\n",
" b = anchors[0, idx, :].astype(int)\n",
" cv2.rectangle(im, (b[0], b[1]), (b[2], b[3]), (0, 1, 0), 3)\n",
" \n",
"plt.figure(figsize=(10, 10))\n",
"plt.imshow(im)\n",
"plt.show()"
]
}
],
"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.6.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment