Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhijit Balaji committed Mar 5, 2020
1 parent a215f93 commit 33ca60d
Showing 1 changed file with 229 additions and 0 deletions.
229 changes: 229 additions & 0 deletions occlusion_experiment.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "occlusion_experiment.ipynb",
"provenance": [],
"authorship_tag": "ABX9TyPDsrECAUVObezjdlqT1gzv",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/Abhijit-2592/visualizing_cnns/blob/master/occlusion_experiment.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"id": "-wWQnozRiUzt",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "68340aed-5d66-4eb3-c05e-265936332b7b"
},
"source": [
"%tensorflow_version 2.x"
],
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"text": [
"TensorFlow 2.x selected.\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "Un88VuGziv2a",
"colab_type": "code",
"colab": {}
},
"source": [
"import numpy as np\n",
"import tensorflow as tf\n",
"import matplotlib.pyplot as plt\n",
"import json\n",
"import cv2"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "tzZxS-dTiwU9",
"colab_type": "code",
"colab": {}
},
"source": [
"%matplotlib inline"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "0c02FBw0izW4",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 67
},
"outputId": "7460db45-610d-44f8-a2e0-e8e95f9bb79b"
},
"source": [
"print(cv2.__version__)\n",
"print(tf.__version__)\n",
"print(np.__version__)"
],
"execution_count": 4,
"outputs": [
{
"output_type": "stream",
"text": [
"4.1.2\n",
"2.1.0\n",
"1.17.5\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "3uTk0_7_i1-S",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 50
},
"outputId": "5db97650-15d2-4870-f138-5accc86fdb50"
},
"source": [
"model = tf.keras.applications.vgg16.VGG16(include_top=True, weights=\"imagenet\")"
],
"execution_count": 5,
"outputs": [
{
"output_type": "stream",
"text": [
"Downloading data from https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5\n",
"553467904/553467096 [==============================] - 6s 0us/step\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "ArDzVEI1i4mX",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 924
},
"outputId": "4cde8e3d-6946-4720-829f-fc61c5fd4664"
},
"source": [
"model.summary()"
],
"execution_count": 6,
"outputs": [
{
"output_type": "stream",
"text": [
"Model: \"vgg16\"\n",
"_________________________________________________________________\n",
"Layer (type) Output Shape Param # \n",
"=================================================================\n",
"input_1 (InputLayer) [(None, 224, 224, 3)] 0 \n",
"_________________________________________________________________\n",
"block1_conv1 (Conv2D) (None, 224, 224, 64) 1792 \n",
"_________________________________________________________________\n",
"block1_conv2 (Conv2D) (None, 224, 224, 64) 36928 \n",
"_________________________________________________________________\n",
"block1_pool (MaxPooling2D) (None, 112, 112, 64) 0 \n",
"_________________________________________________________________\n",
"block2_conv1 (Conv2D) (None, 112, 112, 128) 73856 \n",
"_________________________________________________________________\n",
"block2_conv2 (Conv2D) (None, 112, 112, 128) 147584 \n",
"_________________________________________________________________\n",
"block2_pool (MaxPooling2D) (None, 56, 56, 128) 0 \n",
"_________________________________________________________________\n",
"block3_conv1 (Conv2D) (None, 56, 56, 256) 295168 \n",
"_________________________________________________________________\n",
"block3_conv2 (Conv2D) (None, 56, 56, 256) 590080 \n",
"_________________________________________________________________\n",
"block3_conv3 (Conv2D) (None, 56, 56, 256) 590080 \n",
"_________________________________________________________________\n",
"block3_pool (MaxPooling2D) (None, 28, 28, 256) 0 \n",
"_________________________________________________________________\n",
"block4_conv1 (Conv2D) (None, 28, 28, 512) 1180160 \n",
"_________________________________________________________________\n",
"block4_conv2 (Conv2D) (None, 28, 28, 512) 2359808 \n",
"_________________________________________________________________\n",
"block4_conv3 (Conv2D) (None, 28, 28, 512) 2359808 \n",
"_________________________________________________________________\n",
"block4_pool (MaxPooling2D) (None, 14, 14, 512) 0 \n",
"_________________________________________________________________\n",
"block5_conv1 (Conv2D) (None, 14, 14, 512) 2359808 \n",
"_________________________________________________________________\n",
"block5_conv2 (Conv2D) (None, 14, 14, 512) 2359808 \n",
"_________________________________________________________________\n",
"block5_conv3 (Conv2D) (None, 14, 14, 512) 2359808 \n",
"_________________________________________________________________\n",
"block5_pool (MaxPooling2D) (None, 7, 7, 512) 0 \n",
"_________________________________________________________________\n",
"flatten (Flatten) (None, 25088) 0 \n",
"_________________________________________________________________\n",
"fc1 (Dense) (None, 4096) 102764544 \n",
"_________________________________________________________________\n",
"fc2 (Dense) (None, 4096) 16781312 \n",
"_________________________________________________________________\n",
"predictions (Dense) (None, 1000) 4097000 \n",
"=================================================================\n",
"Total params: 138,357,544\n",
"Trainable params: 138,357,544\n",
"Non-trainable params: 0\n",
"_________________________________________________________________\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "r29SGO6vi6YG",
"colab_type": "code",
"colab": {}
},
"source": [
""
],
"execution_count": 0,
"outputs": []
}
]
}

0 comments on commit 33ca60d

Please sign in to comment.