stud-ai/1-intro/6-one_image.ipynb

384 lines
43 KiB
Plaintext
Raw Normal View History

2024-08-06 11:37:45 +02:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 74,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD5CAYAAADhukOtAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAW5klEQVR4nO3dfXDVVXoH8O+Te2/eE5IYEsJrANEVRMBG1l1l15dqWessOtOxulvL7Diy21mny3T7h2Nnunamf+x2qo5/tHawMqJjfamKsB0sKmNrnbZgQORFFhQMLwHyAiQBQt6f/nF/dIJ7npNwX8Oe72eG4eY899zfyS/3yc39PfecI6oKIvrdV5DvARBRbjDZiQLBZCcKBJOdKBBMdqJAMNmJAhFPp7OILAfwLIAYgH9W1V/67l9bW6uNjY3pHJKIPFpaWtDZ2SmuWMrJLiIxAP8A4C4AxwB8IiIbVfVzq09jYyOam5tTPSQRjaGpqcmMpfNn/FIAX6rqIVUdAPAagBVpPB4RZVE6yT4NwNFRXx+L2ohoAsr6BToRWSUizSLS3NHRke3DEZEhnWRvBTBj1NfTo7ZLqOoaVW1S1abJkyencTgiSkc6yf4JgHkiMltECgE8CGBjZoZFRJmW8tV4VR0SkccAbEay9LZWVfdmbGRElFFp1dlVdROATRkaCxFlET9BRxQIJjtRIJjsRIFgshMFgslOFAgmO1EgmOxEgWCyEwWCyU4UCCY7USCY7ESBYLITBYLJThQIJjtRIJjsRIFgshMFgslOFAgmO1EgmOxEgWCyEwWCyU4UCCY7USCY7ESBYLITBYLJThSItHaEEZEWAGcBDAMYUlV7J3gAqorBwcF0DnnFUVUz1t3dbcaOHfutPTL/X9fpM5d9vKrqarNPQ8MUM1ZVXWXG4vG0nj6UBb7nWyZ+WreramcGHoeIsoh/xhMFIt1kVwDvich2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6/cU/Ho73efqy3vb7Efr9z9eL51AfnKThQIJjtRIJjsRIFgshMFgslOFAgmO1Egxiy9ichaAPcCaFfV66O2JwE8CuDiTI4nVHXTWI9VXlGBW5fd6oytf2ej2W+4wj3Rofd8r9nHN5mhtNguu/hKbz097lJTR6e9vpivzOfjm+wyZ3ajGeu54C7jnPOs/bateYcZ822H5dsayppo4puo0dBgb4c1OGiX5drb7HLY8LB7/UKrHQBOeya0VFfXmLH6eru8WVxir4lozV7yTfT68IMPnO1n0yy9vQhguaP9GVVdHP0bM9GJKL/GTHZV/QjAmJs2EtHEls579sdEZJeIrBURbrxONMGlmuzPAZgLYDGAEwCesu4oIqtEpFlEmru7ulI8HBGlK6VkV9U2VR1W1REAzwNY6rnvGlVtUtWmSVVVKQ6TiNKVUrKLyOgtLO4HsCczwyGibBlP6e1VALcBqBWRYwB+AeA2EVkMQAG0APjxeA5WUlKChYsWuwfimQH2zoYNznZfGScWt3+PnfeW7Ow14zpPuUsyvnHEPeOY2uDe9gcAykvtrZDmXn21Gdu6rdnZ3nXenpnn4/u5xOOXP2lyaMgueYnYsatq3GsXAkBfn10ePG+UHH0/s2lT7RLgtGnTzFiZZ2bb0ID9vDL7eMqNAwNDznbvc3GsA6rqQ47mF8bqR0QTCz9BRxQIJjtRIJjsRIFgshMFgslOFIicLjhZUFCARKG7pDR/4UKzX0VlhbP97TffNvu0HDlmxgoL7XJSa6u9DdWgsYgiPLO/PJUQlJaVmrG4tX8SgI8/+i8zdsFYvNA3i863FZJvZpvvMYeG3KWhds+CjUeOtJix06ftmYXFRUVmrLZ2srtPsT0LrdB4jgLAgHF+AcA+U/YWZgBQoO5Ygefn0mjMfCz0nAu+shMFgslOFAgmO1EgmOxEgWCyEwWCyU4
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Balerinki: 6.47%\n",
"Botki: 3.45%\n",
"Creepersy: 7.02%\n",
"Czolenka: 3.83%\n",
"Domowe: 11.32%\n",
"Espadryle: 5.27%\n",
"Glany: 4.10%\n",
"Kalosze: 1.63%\n",
"Klapki: 8.62%\n",
"Kozaki: 0.00%\n",
"Mokasyny: 8.28%\n",
"Polbuty: 5.79%\n",
"Pozostale: 6.90%\n",
"Sandaly: 7.30%\n",
"Sniegowce: 3.05%\n",
"Sportowe: 6.44%\n",
"Tenisowki: 6.18%\n",
"Trekkingowe: 4.36%\n",
"biel: 3.80%\n",
"czern: 13.46%\n",
"inny-kolor: 10.42%\n",
"odcienie-brazu-i-bezu: 6.71%\n",
"odcienie-czerwieni: 2.75%\n",
"odcienie-fioletu: 8.17%\n",
"odcienie-granatowego: 13.61%\n",
"odcienie-niebieskiego: 11.62%\n",
"odcienie-pomaranczowego: 4.03%\n",
"odcienie-rozu: 0.00%\n",
"odcienie-szarosci-i-srebra: 9.14%\n",
"odcienie-zieleni: 5.95%\n",
"odcienie-zoltego-i-zlota: 1.45%\n",
"wielokolorowy: 8.89%\n",
"Domowe odcienie-granatowego\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD5CAYAAADhukOtAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAYmUlEQVR4nO3dbWyc1ZUH8P/xeMYvYydOYjsxdmKTF2hDNgQyzaZtRHhpC6VoA1JV0Q8tH6qmaou0legHxEqF1VarvtGKbXdpA0lJu5SXvqlol92WDahst0uoKeDECbQ0OBDHsZ3ETuzYnvHYZz/ME8lh77l2PG8J9/+Totj3+PFz/djHM37OnHtFVUFE734V5Z4AEZUGk50oEEx2okAw2YkCwWQnCgSTnSgQlfkcLCI3AXgAQAzAw6r6Nd/HNzY2akdHRz6nJCKPnp4eHD9+XFyxeSe7iMQA/DOADwM4AuAPIvKUqh6wjuno6E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qblve1mYeM/3Xm+d5LntRzDffPOQcPzlkt1k0eBajnJy0X33Z1dVlxqzutvb2DvOY91z+HjPmux77PPP48b/+xIw9++xzzvGtW68xj9m48Wrn+MSE3YHJR3aiQDDZiQLBZCcKBJOdKBBMdqJAMNmJAlHS0lu8Mo5lS1ucsbGxUfO400anVGZy0j6Z2L/HJj3H+brlrMU3slm7vDY5ae+HduX6DWas2lPiSafTZqzKKDXVePaOa72k1YxlPdcq6ymH1da4599zuMc8ZsTTEVdba3cBVni+Z/+7d69z/LSxFx0
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Balerinki: 11.13%\n",
"Botki: 10.93%\n",
"Creepersy: 1.87%\n",
"Czolenka: 16.84%\n",
"Domowe: 0.63%\n",
"Espadryle: 1.21%\n",
"Glany: 6.07%\n",
"Kalosze: 1.64%\n",
"Klapki: 0.00%\n",
"Kozaki: 2.64%\n",
"Mokasyny: 12.56%\n",
"Polbuty: 8.10%\n",
"Pozostale: 7.79%\n",
"Sandaly: 4.03%\n",
"Sniegowce: 1.48%\n",
"Sportowe: 3.63%\n",
"Tenisowki: 5.98%\n",
"Trekkingowe: 3.48%\n",
"biel: 5.27%\n",
"czern: 8.17%\n",
"inny-kolor: 9.55%\n",
"odcienie-brazu-i-bezu: 0.62%\n",
"odcienie-czerwieni: 2.27%\n",
"odcienie-fioletu: 11.20%\n",
"odcienie-granatowego: 13.46%\n",
"odcienie-niebieskiego: 14.54%\n",
"odcienie-pomaranczowego: 7.65%\n",
"odcienie-rozu: 3.07%\n",
"odcienie-szarosci-i-srebra: 5.34%\n",
"odcienie-zieleni: 7.19%\n",
"odcienie-zoltego-i-zlota: 0.00%\n",
"wielokolorowy: 11.67%\n",
"Czolenka odcienie-niebieskiego\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD5CAYAAADhukOtAAAAOXR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efJqyt0kq5MJlKHUWoCScUt74mL3YJeGU5drbw4uDvBLa+LizRZUz/1Ta7kWYMspX3jxGnQU+m5/aYsa2bX/OjPWdfZYZu/jidwbHr7zy3eYx5523LDiey9nl0Kk8sn8bwFWB8a+r6oryv8qJTkRNVTHZVXUTgIqbNhLRzDadv9lvEZFtIrJeRMLPzYloxqg22b8JYCmAFQAOArjT+kARWSMi/SLSX+3WwEQ0fVUlu6oOqGpBS+1IvgVgpfOx61Q1o6qZRLKxjXGI6HeqSnYRWTjp3esB2LchiWhGqLjqTUS+B+B9AHoBDAD4Uvn9FQAUwB4An1VVu6lXWdusLl18YbiHl86xV6mJsboqN/CSeYxO2OUTMXraAUCyxS69tRnlwUSLXfrJHbbLgwVn1VsqbZfXvG2vkAuX+vJjR8xDxCm9eSvbxPnRkUR4m6Si0z/PK4eJU+bzWD/f3jZOaa+U5/Tkq3ZnKKuE2dZm/ywumB9e8fnoo7/E8PDh4EwqPq9W1ZsCw/dUOo6IZha+go4oEkx2okgw2YkiwWQnigSTnSgSDX2VixTzaM2GX2Y/MWqXO/LGqjevYWOi7TQzluywt+nRsWEzNjG0NzguXmPAfNaeh1dec16ApDl7dVhhYiQ4XnRKaCnnXAmj2SfgN6osGmU0r7zm1a7EOZdXPE4YKxzTabv86q3m80rV1TZvtVb0jYzYrzjdfSxcdp6YsBuL8pGdKBJMdqJIMNmJIsFkJ4oEk50oEkx2okg0tvQGRaIQLkW1jx4wjxsZORYcT7ba5bVEz9l
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Balerinki: 6.88%\n",
"Botki: 1.42%\n",
"Creepersy: 9.72%\n",
"Czolenka: 2.11%\n",
"Domowe: 7.20%\n",
"Espadryle: 5.38%\n",
"Glany: 4.77%\n",
"Kalosze: 0.89%\n",
"Klapki: 7.30%\n",
"Kozaki: 0.00%\n",
"Mokasyny: 5.78%\n",
"Polbuty: 9.16%\n",
"Pozostale: 6.55%\n",
"Sandaly: 5.41%\n",
"Sniegowce: 2.76%\n",
"Sportowe: 9.59%\n",
"Tenisowki: 7.45%\n",
"Trekkingowe: 7.62%\n",
"biel: 4.53%\n",
"czern: 7.76%\n",
"inny-kolor: 9.83%\n",
"odcienie-brazu-i-bezu: 0.31%\n",
"odcienie-czerwieni: 1.39%\n",
"odcienie-fioletu: 12.41%\n",
"odcienie-granatowego: 14.03%\n",
"odcienie-niebieskiego: 14.15%\n",
"odcienie-pomaranczowego: 8.37%\n",
"odcienie-rozu: 3.32%\n",
"odcienie-szarosci-i-srebra: 4.68%\n",
"odcienie-zieleni: 6.95%\n",
"odcienie-zoltego-i-zlota: 0.00%\n",
"wielokolorowy: 12.26%\n",
"Creepersy odcienie-niebieskiego\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD5CAYAAADhukOtAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAVLElEQVR4nO3da2ycVXoH8P8z4/HYHt/jiXGTgBMSLlkKAUwKgq5Y2N0CXQRUFYKqiA9os1otUqm2HxCVCiv1A1sVEB8qqrBEsCvKZRcQaQu7hCyFZVsFDIQkJMstG9gEx5ckTny3Z+bph3mjOu55jp25Ojn/nxRlfB6feY9f+5nXfp8554iqgohOf7FqD4CIKoPJThQIJjtRIJjsRIFgshMFgslOFIiaYjqLyHUAHgUQB/ATVX3Q9/kdHR3a3d1dzCGrqpAypYiUYSREbvv27cPQ0JDzh67gZBeROIB/AfAtAPsBvCsim1V1t9Wnu7sbvb29hR6yInwJPTU14w548rkuWVvkiIgWrqenx4wV82v8egCfqepeVZ0G8CyAm4p4PiIqo2KSfRmAP8z6eH/URkSLUNlv0InIBhHpFZHewcHBch+OiAzFJPsBACtmfbw8ajuBqm5U1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g4j0ikjv4OBgUYMlosItKNlFJIF8oj+tqi9Gzf0i0hXFuwAMuPqq6kZV7VHVnnQ6XYoxE1EB5k12ERHk92Pfo6oPzwptBnBn9PhOAC+XfnhEVCoLmfV2JYA7AOwUke1R230AHgTwvIjcBeALALeWZYQVls3a9bBk3P3aODw1afZJjNmlq/PTjWasodb+1iypS5ixmYx7/LUx+3W9xhObzjSYsfaGOjN
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Balerinki: 3.03%\n",
"Botki: 10.12%\n",
"Creepersy: 5.18%\n",
"Czolenka: 4.62%\n",
"Domowe: 2.23%\n",
"Espadryle: 0.16%\n",
"Glany: 8.46%\n",
"Kalosze: 12.42%\n",
"Klapki: 2.96%\n",
"Kozaki: 11.97%\n",
"Mokasyny: 2.46%\n",
"Polbuty: 2.84%\n",
"Pozostale: 8.41%\n",
"Sandaly: 4.87%\n",
"Sniegowce: 11.06%\n",
"Sportowe: 0.00%\n",
"Tenisowki: 4.89%\n",
"Trekkingowe: 4.31%\n",
"biel: 8.37%\n",
"czern: 4.25%\n",
"inny-kolor: 8.15%\n",
"odcienie-brazu-i-bezu: 0.00%\n",
"odcienie-czerwieni: 1.89%\n",
"odcienie-fioletu: 9.10%\n",
"odcienie-granatowego: 7.77%\n",
"odcienie-niebieskiego: 14.16%\n",
"odcienie-pomaranczowego: 7.08%\n",
"odcienie-rozu: 7.18%\n",
"odcienie-szarosci-i-srebra: 5.30%\n",
"odcienie-zieleni: 10.11%\n",
"odcienie-zoltego-i-zlota: 3.08%\n",
"wielokolorowy: 13.57%\n",
"Kalosze odcienie-niebieskiego\n"
]
}
],
"source": [
"import requests\n",
"from torch.autograd import Variable\n",
"import torchvision.transforms as transforms\n",
"import torch.nn as nn\n",
"import torch.nn.functional as F\n",
"from PIL import Image\n",
"import torch\n",
"\n",
"import numpy as np\n",
"import os.path\n",
"\n",
"import matplotlib.pyplot as plt\n",
"\n",
"# functions to show an image\n",
"\n",
"\n",
"def imshow(img):\n",
" img = img / 2 + 0.5 # unnormalize\n",
" npimg = img.numpy()\n",
" plt.imshow(np.transpose(npimg, (1, 2, 0)))\n",
" plt.show()\n",
"\n",
"transform = transforms.Compose(\n",
" [ transforms.Resize(32),\n",
" transforms.Pad(10, fill=255),\n",
" transforms.CenterCrop((32, 32)),\n",
" transforms.ToTensor(),\n",
" transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))\n",
" ]\n",
")\n",
"\n",
"class Net(nn.Module):\n",
" def __init__(self):\n",
" super(Net, self).__init__()\n",
" self.conv1 = nn.Conv2d(3, 6, 5)\n",
" self.pool = nn.MaxPool2d(2, 2)\n",
" self.conv2 = nn.Conv2d(6, 16, 5)\n",
" self.fc1 = nn.Linear(16 * 5 * 5, 120)\n",
" self.fc2 = nn.Linear(120, 84)\n",
" self.fc3 = nn.Linear(84, 18)\n",
"\n",
" def forward(self, x):\n",
" x = self.pool(F.relu(self.conv1(x)))\n",
" x = self.pool(F.relu(self.conv2(x)))\n",
" x = x.view(-1, 16 * 5 * 5)\n",
" x = F.relu(self.fc1(x))\n",
" x = F.relu(self.fc2(x))\n",
" x = self.fc3(x)\n",
" return x\n",
"\n",
"class NetBoss(nn.Module):\n",
" def __init__(self):\n",
" super(NetBoss, self).__init__()\n",
" self.conv1 = nn.Conv2d(3, 6, 5)\n",
" self.pool = nn.MaxPool2d(2, 2)\n",
" self.conv2 = nn.Conv2d(6, 16, 5)\n",
" self.fc1 = nn.Linear(16 * 5 * 5, 120)\n",
" self.fc2 = nn.Linear(120, 84)\n",
" self.fc3 = nn.Linear(84, 14)\n",
"\n",
" def forward(self, x):\n",
" x = self.pool(F.relu(self.conv1(x)))\n",
" x = self.pool(F.relu(self.conv2(x)))\n",
" x = x.view(-1, 16 * 5 * 5)\n",
" x = F.relu(self.fc1(x))\n",
" x = F.relu(self.fc2(x))\n",
" x = self.fc3(x)\n",
" return x\n",
" \n",
"\n",
"# loading exisiting NN's\n",
"if os.path.isfile(\"nn-state-dict.pth\"):\n",
" net_kind = Net()\n",
" net_kind.load_state_dict(torch.load(\"nn-state-dict.pth\"))\n",
" net_kind.eval()\n",
" \n",
"\n",
"if os.path.isfile(\"nn-col-state-dict.pth\"):\n",
" net_col = NetBoss()\n",
" net_col.load_state_dict(torch.load(\"nn-col-state-dict.pth\"))\n",
" net_col.eval()\n",
" \n",
"\n",
"url1 = \"https://chillizet-static.hitraff.pl/uploads/productfeeds/images/99/dd/house-klapki-friends-czarny.jpg\"\n",
"url2 = \"https://e-obuwniczy.pl/pol_pl_POLBUTY-BUT-BAL-VENETTO-635-SKORA-LICOWA-CZARNY-2551_5.jpg\"\n",
"url3 = \"https://bhp-nord.pl/33827-thickbox_default/but-s1p-portwest-steelite-tove-ft15.jpg\"\n",
"url4 = \"https://www.sklepmartes.pl/174554-thickbox_default/dzieciece-kalosze-cosy-wellies-kids-2076-victoria-blue-bejo.jpg\"\n",
"urls = [url1, url2, url3, url4]\n",
"\n",
"# dictionary with names of shoe kinds & shoe colours\n",
"import pickle\n",
"kind = open(\"class-shoe.pkl\", \"rb\")\n",
"colour = open(\"class-col.pkl\", \"rb\")\n",
"shoe_kinds = pickle.load(kind)\n",
"shoe_colours = pickle.load(colour)\n",
"\n",
"for url in urls:\n",
" img = Image.open(requests.get(url, stream=True).raw)\n",
"\n",
" image_tensor = transform(img).float()\n",
" imshow(image_tensor)\n",
" image_tensor = image_tensor.unsqueeze_(0)\n",
" inputi = Variable(image_tensor)\n",
"\n",
" \n",
" # calculating the % probability of the shoe kind\n",
" output_kind = net_kind(inputi)\n",
" \n",
" _, predicted_1 = torch.max(output_kind.data, 1)\n",
" _, predicted_1m = torch.min(output_kind.data, 1)\n",
" \n",
" output_kind.data.add_(-output_kind.data[0][int(predicted_1m)])\n",
" \n",
" percentage_kind = output_kind.data.div(torch.sum(output_kind.data)) * 100\n",
" for i in range(0, len(percentage_kind[0])):\n",
" print(shoe_kinds[i] + \":\", '%.2f' % float(percentage_kind[0][i]) + \"%\")\n",
" \n",
" # calculating the % probability of the shoe colour\n",
" output_col = net_col(inputi)\n",
" #print(output_col)\n",
" _, predicted_2 = torch.max(output_col.data, 1)\n",
" _, predicted_2m = torch.min(output_col.data, 1)\n",
" \n",
" # problem: colour net wrongly built on a net that outputs 18 classes instead of 14; needs fixing\n",
"\n",
" output_col.data.add_(-output_col.data[0][int(predicted_2m)])\n",
" \n",
" percentage_colour = output_col.data.div(torch.sum(output_col.data)) * 100\n",
" #print(hoh)\n",
" #print(torch.sum(hoh[:14]))\n",
" for i in range(0, len(percentage_colour[0])):\n",
" print(shoe_colours[i] + \":\", '%.2f' % float(percentage_colour[0][i]) + \"%\")\n",
" \n",
" # printing the most probable shoe type and colur\n",
" print(shoe_names[int(predicted_1)], shoe_colours[int(predicted_2)])\n",
"\n",
" \n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 4
}