{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "K33ASxR6M1H-" }, "source": [ "#Original Author: Jonathan Hudson\n", "#CPSC 433 F24" ] }, { "cell_type": "markdown", "metadata": { "id": "DhZTTSlltFh2" }, "source": [ "Imports that are needed" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "KsdVGfVCnQ4J" }, "outputs": [], "source": [ "import sys\n", "import tensorflow as tf\n", "import numpy as np\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "markdown", "metadata": { "id": "huG1gu0KtG_a" }, "source": [ "Determine the arguments" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "ukCbw8ydnP3k", "outputId": "49b72c0b-5d91-4056-be67-d9b3540aa2ea" }, "outputs": [ { "name": "stdin", "output_type": "stream", "text": [ "Dataset: notMNIST\n", "Model: notMNIST.h5\n" ] } ], "source": [ "sys.argv = [\"\", input(\"Dataset:\"), input(\"Model:\")]" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "6TD50Q9e_0ZE" }, "outputs": [], "source": [ "def check_args():\n", " if(len(sys.argv) == 1):\n", " print(\"No arguments so using defaults\")\n", " if input(\"Y for MNIST, otherwise notMNIST:\") == \"Y\":\n", " sys.argv = [\"predict_test.py\", \"MNIST\", \"MNIST.keras\"]\n", " else:\n", " sys.argv = [\"predict_test.py\", \"notMNIST\", \"notMNIST.keras\"]\n", " if(len(sys.argv) != 3):\n", " print(\"Usage python predict_test.py \")\n", " sys.exit(1)\n", " if sys.argv[1] == \"MNIST\":\n", " print(\"--Dataset MNIST--\")\n", " class_names = list(range(10))\n", " mnist = tf.keras.datasets.mnist\n", " (x_train, y_train), (x_test, y_test) = mnist.load_data()\n", " x_train, x_test = x_train / 255.0, x_test / 255.0\n", " data = (x_test, y_test)\n", " elif sys.argv[1] == \"notMNIST\":\n", " print(\"--Dataset notMNIST--\")\n", " class_names = [\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\"]\n", " with np.load(\"notMNIST.npz\", allow_pickle=True) as f:\n", " x_train, y_train = f['x_train'], f['y_train']\n", " x_test, y_test = f['x_test'], f['y_test']\n", " x_train, x_test = x_train / 255.0, x_test / 255.0\n", " data = (x_test, y_test)\n", " else:\n", " print(f\"Choose MNIST or notMNIST, not {sys.argv[1]}\")\n", " sys.exit(2)\n", " if sys.argv[2][-6:] != \".keras\":\n", " print(f\"{sys.argv[2]} is not a keras extension\")\n", " sys.exit(3)\n", " return class_names, data" ] }, { "cell_type": "markdown", "metadata": { "id": "GFqxpnv4tjR6" }, "source": [ "Completed functions to plot for you" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "E75I4-RVeme5" }, "outputs": [], "source": [ "def plot(class_names, prediction, true_label, predicted_label, img):\n", " plt.figure(figsize=(6,3))\n", " plt.subplot(1,2,1)\n", " plt.grid(False)\n", " plt.xticks([])\n", " plt.yticks([])\n", " plt.imshow(img, cmap=plt.cm.binary)\n", " predicted_label = np.argmax(prediction)\n", " if predicted_label == true_label:\n", " color = 'blue'\n", " else:\n", " color = 'red'\n", " plt.xlabel(\"{} {:2.0f}% ({})\".format(class_names[predicted_label],100*np.max(prediction),class_names[true_label]),color=color)\n", " plt.subplot(1,2,2)\n", " plt.grid(False)\n", " plt.xticks(range(10))\n", " plt.yticks([])\n", " thisplot = plt.bar(class_names, prediction, color=\"#777777\")\n", " plt.ylim([0, 1])\n", " thisplot[predicted_label].set_color('red')\n", " thisplot[true_label].set_color('blue')" ] }, { "cell_type": "markdown", "metadata": { "id": "kL_b5WbYtonX" }, "source": [ "Finish this function to predict output from input" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "GChTgYKGtoFN", "outputId": "2b74a067-ca31-4fa8-bdfe-4e12848fd64d" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "--Dataset notMNIST--\n", "--Load Model notMNIST.h5--\n" ] }, { "name": "stdin", "output_type": "stream", "text": [ "Pick test_image (0 -> 9999): 1\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "--Should be Class 0--\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAekAAAESCAYAAADZmy1NAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/av/WaAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAbVUlEQVR4nO3de3CV1dXH8ZUQkgi5YLiYhkQhQEGKMJarRFsFakBBtIjoSIsFLxQQbLEV1BdUBEVqGbk61iMXsY5QYQoZioAiOiIE5CKMhNFa5JLAIAQIl2Au+/3jEYGQvZ6TcxLYJN/PTMbkrKx9nnPA/HhOznp2hDHGCAAAcE7k5T4AAABQPkIaAABHEdIAADiKkAYAwFGENAAAjiKkAQBwFCENAICjoi73AQC4MpSWlkpubq7Ex8dLRETE5T4c4IpmjJGCggJJSUmRyEj7+TIhDSAoubm5kpaWdrkPA6hW9u7dK6mpqdY6IQ0gKPHx8SLi/VBJSEi4zEcDXNmOHz8uaWlpP/1/ZUNIAwjK2Ze4ExISCGmgkvj96og3jgEA4ChCGgAARxHSAAA4ipAGAMBRhDQAAI4ipAEAcFTII1hcfQioHMFeeQhAzRNySHP1IaBy+V15CEDNE3JIc/WhmsEYo9ZLSkqstVq1aqm92iswpaWlau+OHTvUek5OjrV2/Phxtbdu3brWWr169dTer776ylqLi4sr9/bCwkIZN26c75WHANQ8IYc0Vx+qGVwNaVvgnVWnTh1rraioSO296qqrQlpXRCQ2NjakdUX8rzwEoObhF2AAADiKkAYAwFGENAAAjiKkAQBwFFtVQn3zl9+bmaKi7H+FDh8+rPa+++671tqaNWvU3hYtWqj1bt26hVQTEUlKSrLWoqOj1d7k5GRrbcSIEeXerj3/AGo2zqQBAHAUIQ0AgKMIaQAAHEVIAwDgKEIaAABHEdIAADiKEaxqwO86137X39ausV1QUKD2Tp482VoLBAJqb69evay1l156Se39+c9/rta1x+w3VlZcXKzWNfPmzbPWfvWrX5V7+5kzZ+S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ZmTJz5kw5efLkRfWjZS/tF6KPPvpItm/fLv369auU9S63+vXry29+8xuZMWNGuc8bKgdn0gCqVFZWluTn58uQIUMuOmPu16+fBAIBGWq7so/izJkzcuDHnVvy8/NlxowZcuLECenTp0+F15o5c6ZkZGRIp06d5IUXXpC2bdtKcXGxrFq1SmbPni07d+4M6djOH8F66aWXpHfv3vL73/++wsd3/mM9KyoqShpc5kv5zZo1SzIyMqRDhw7y3HPPSdu2bSUyMlI2btwoOTk50r59+8t6fNUBIQ2gSgUCAenRo0e5L2n369dPXnnlFfnyyy+lbdu2FVp3xYoV8rOf/UxEROLj46VVq1ayaNGikH7HnZ6eLps3b5aJEyfK6NGjJS8vTxo2bCjt27e/6HekFTm2qKgoufrqq6Vdu3Yybdo0GTRoUIXf2Hb+eudr2bLlJXmJXtOsWTPZsmWLTJo0ScaOHSv79u2TmJgYad26tTz55JMybNiwy3p8VaW0tLTCs+6hijAMsgEAELSePXtK8+bNZcaMGVV+X/xOGgCAIOTn50tWVpZ8/PHH0qNHj0tyn7zcDQBAEAYPHiwbN26U0aNHS9++fS/JffJyNwAAjuLlbgAAHEVIAwDgKEIaAABHEdIAADiKkAYAwFGENAAAjiKkAQBwFCENAICj/h8MZCwX7meDTAAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ "Pick test_image (0 -> 9999): 2\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "--Should be Class 5--\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAekAAAESCAYAAADZmy1NAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/av/WaAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAV0UlEQVR4nO3df2zV1f3H8ddtS38ILQoYWLFz1jKYCwVlc2i3xaFIjTDcOifJqjKZk8AIKi7DxYkxA/cdc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mdfjw4fgn2Q9wuBtASrW1tenZZ5/Vk08+qX379p25vf3228rPz9eGRDb16SQUCiktLU1NTU0x9Rs2bJimTZumlStXqrGxsVt7IqU/nb322mt69913VVZWlpTx+trw4cM1depUVVRU9Pi+ITlYSQNIqW3btqmurk5z5szptmIuKytTOBzWXL9NfRxaWlpU+/nFZOrq6lRRUaGGhgbNmDEj5rFWrlypkpISXXvttXr88cdVXFystrY2vfLKK1q1apX2798f19w6l2A98cQTmj59uu66666Y59f5tXbIyMjQiBEjYh4rmZ566imVlJToa1/7mh577DEVFxcrLS1Nu3fv1nvvvadJkyb16fz6A0IaQEqFw2HddNNNPR7SLisr029/+1u98847Ki4ujmnc7du36wtf+IIkKTc3V+PGjdMLL7wQ13fchYWF2rt3r5YuXapFixbpyJEjuvTSSzVp0qRu35HGMreMjAxdcsklmjBhgv70pz/p7rvvjvnEts7jdTZ27Njzcoje5corr9Rbb72lZcuW6eGHH9bhw4eVlZWlq666Sg899JDmdd5AqR+JRCIx17rHi+tJAwAQg9LSUhUVFamioiLlz8V30gAA9EJdXZ22bdum119/XTedp2sScLgbAIBeuOeee7R7924tWrRIM2fOPC/PyeFuAACM4nA3AABGEdIAABhFSAMAYBQhDQCAUYQ0AABGEdIAABhFSAMAYBQhDQCAUf8P1WQjFdxYF4sAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ "Pick test_image (0 -> 9999): 3\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "--Should be Class 9--\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAekAAAESCAYAAADZmy1NAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/av/WaAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAVhklEQVR4nO3de2yV9R3H8c9pTzlAb0hLwNYOqOUiDlBxrKTT4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fXqyDWboFOlJeXa+3atZKcoPjBD36gGTNm6MCBA3HPVVdXp7KyMg0aNEiPPPKIxo8frzNnzujll1/WokWLtGfPnoTW1tbWpsOHD2vLli1asmSJfve732nTpk0KBuP70dvxc22XTJ9uZ/MNSeAckn379p39uq1cuVLjx49XKBTS22+/rdWrV6uwsFBf+MIXEl4nCGnE6/bbnfat99+XTp1yzhCfONE5qUxyDs0vX+592Bx9UktLizZu3KidO3eqoaFB69at03K/i/l4CIVCGvbJL4fDhg3TsmXLdMMNN+jIkSNxB87ChQsVCARUU1OjzA7XnL/66qt11113JbW2wsJCXXfddSotLdUtt9yidevWacGCBQnPlwqpmm/hwoUKBoPauXPneV+34uJizZo1y/c2jPDH4W7E7557nBttTJggffCBc1Jcu5ISp70LuMCzzz6rsWPHasyYMZo7d67WrFmTsh/iLS0t+s1vfqOSkhLl5eXFNfb48ePasmWLFi1adF7QtBt04TUIEnTzzTdr4sSJer6zP0Vdgo4dO6Y//vGPrl83SUndLQ0OQhqJueYapw/6H/9wwhrwEQ6HNfeTi/mUl5frxIkT2pbExXyqq6uVlZWlrKwsZWdna9OmTdq4caPnbf86s3fvXkWjUY0dOzbhtcRq7NixqnO7xK+Hjp9r+9vKlSsTXseF882ePTvuOdq/bmPGjDnv4/n5+Wfn/f73v5/UurKysnTbbbfFvbbehMPdALpcbW2tampq9MILL0iSgsGg5syZo3A4rKlTpyY050033aSqqipJUmNjo5544gnddtttqqmp0fA4TlrszkOy0Wg0od1lx8+13eDBgxNex4Xzue2EE1FTU6NIJKKvfOUrOnXqVFLrkqTXXnvt7C93fREhDaDLhcNhtba2nneiWDQaVSgUUmVlZUz31b1QZmamSkpKzr7/1FNPKTc3V08++aQefvjhmOcZNWqUAoFA3CeHJWL37t0aOXJk3OMu/FyTlYr5SkpKFAgEVNveFvqJ4uJiSdKAAQNSsq5Dhw4lvshegMPdALpUa2urnn76aT366KPatWvX2bc333xTBQUFeiaZi/l0EAgElJaWppMnT8Y1bvDgwZo+fbpWrVqljz766KJ6Mq0/Hb3yyit6++23VVFRkZL5elpeXp6mTZumysrKTr9uSA120gC6VHV1tRobGzV//vyLdswVFRUKh8O62+1iPh5OnTqlhk9uItPY2KjKykq1tLRo5syZcc+1atUqlZWVafLkyXrooYc0YcIEtba26k9/+pOqqqq0e/fuhNbWsQXrxz/+sWbMmKGvfe1rca+v4+faLhgMKr+9q6KHPPHEEyorK9P111+vBx98UBMmTFBaWpp27NihPXv2aNKkST26vt6AkAbQpcLhsG699dZOD2lXVFToZz/7md566y1NiPMExC1btujyyy+XJGVnZ2vs2LF67rnnEvobd3FxsV5//XWtWLFCS5cu1QcffKAhQ4Zo0qRJF/2NNJ61BYNBXXbZZZo4caJ+8Ytf6Otf/3rcJ7Z1nK+jMWPGdMshei9XXnml3njjDa1cuVL333+/Dh06pFAopHHjxum+++7Two4XTupFIpFI3L3uieJ+0gAAxKG8vFwlJSWqrKzs8ufib9IAAMSgsbFR1dXV2rp1q27tpnsTcLgbAIAY3HXXXdqxY4eWLl2qWbNmdctzcrgbAACjONwNAIBRhDQAAEYR0gAAGEVIAwBgFCENAIBRhDQAAEYR0gAAGEVIAwBg1P8B8ivgP6YROHgAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "def main():\n", " class_names, data = check_args()\n", " x_test, y_test = data\n", " print(f\"--Load Model {sys.argv[2]}--\")\n", " #Load the model that should be in sys.argv[2]\n", " model = None\n", " pick = input(f\"Pick test_image (0 -> {len(x_test)-1}):\")\n", " while pick.isdigit() and int(pick) >= 0 and int(pick) < len(x_test):\n", " pick = int(pick)\n", " img = x_test[pick]\n", " guess = y_test[pick]\n", " print(f\"--Should be Class {guess}--\")\n", " predict(model, class_names, img, guess)\n", " pick = input(f\"Pick test_image (0 -> {len(x_test)-1}):\")\n", " print(\"Done\")\n", "\n", "def predict(model, class_names, img, true_label):\n", " img = np.array([img])\n", " #Replace these two lines with code to make a prediction\n", " prediction = [1/10,1/10,1/10,1/10,1/10,1/10,1/10,1/10,1/10,1/10]\n", " #Determine what the predicted label is\n", " predicted_label = 0\n", " plot(class_names, prediction, true_label, predicted_label, img[0])\n", " plt.show()\n", "main()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "Ko8pbdWkM1IC" }, "outputs": [], "source": [] } ], "metadata": { "colab": { "provenance": [] }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.7" } }, "nbformat": 4, "nbformat_minor": 0 }