2024-09-12 13:58:14 +02:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2025-01-01 20:53:05 +01:00
|
|
|
"execution_count": 1,
|
2024-09-12 13:58:14 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2025-01-01 20:53:05 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABW4AAAPdCAYAAAAauvH/AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gU1frA8e/upvfeSKVJ74TelBJBFL0oigKhiIKK/LCAlSYiYAFUuBaqYNfrtSAYFEQuSGhBIKhgEkJJCKQS0ja78/tjkiWbTUgC6byf55mH3bNnZs4cUmbfvPsejaIoCkIIIYQQQgghhBBCCCHqDW1dD0AIIYQQQgghhBBCCCGEOQncCiGEEEIIIYQQQgghRD0jgVshhBBCCCGEEEIIIYSoZyRwK4QQQgghhBBCCCGEEPWMBG6FEEIIIYQQQgghhBCinpHArRBCCCGEEEIIIYQQQtQzErgVQgghhBBCCCGEEEKIekYCt0IIIYQQQgghhBBCCFHPSOBWCCGEEEIIIYQQQggh6hkJ3AohGrzLly/z7LPPMnToULy9vdFoNMybN6/S+8fExDBixAiCg4Oxt7fHw8ODXr16sWnTpkrtv3PnTjQaTZnb77//fp1XZS40NJQ77rijWo4FcP78eebNm0dMTEy1HbOxGjhwIAMHDqzrYQghhBA3tfXr16PRaEhISKjyvsX3al9++WW1jaf4mDt37qy2Y9aVefPmodFo6noYogLV+TU3cOBA2rVrd+ODKpKTk8O8efMaxfeDEPWNVV0PQAghblRqairvv/8+HTt2ZNSoUXz44YdV2j8jI4OgoCAeeOABmjRpwpUrV9i8eTPjxo0jISGBF198sVLHefXVVxk0aJBZW3XeEFW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nnqKOXPm4Ovry4cffsjkyZNp3rw5/fv3B+Cvv/6id+/e+Pj4sHLlSjw9Pdm0aRORkZFcuHCBZ599li5durBu3TomTpzIiy++yIgRIwAIDAys0njKotfrufPOO5k8eTJPPfUUu3btYuHChbi6uvLyyy8D6pumQYMG8c8//zB//nw6dOjAb7/9xuLFi4mJibG4yf3mm2/47bffePnll/Hz88PHx4f9+/cDMGXKFO655x4+/fRTDh8+zPPPP09hYSF//fUX99xzD1OnTmX79u0sWbKEgIAAZs2aZTpuQkICjzzyCMHBwQD8/vvvPPHEE5w7d840ViGEEELUb8nJyTz44IM89dRTzJ07l//85z8899xzBAQEMH78eLO+zz//PF26dOHDDz8kMzOTefPmMXDgQA4fPkzTpk0B9f7glltu4f7778fDw4OkpCRWr15N9+7diY2NxcvLq9yxVHXfKVOmMGLECD7++GPOnDnDM888w0MPPcQvv/xi6vPyyy+zcOFC7rnnHp566ilcXV05duyYWTB406ZNjB8/nrvuuosNGzZgbW3Ne++9x7Bhw9i2bRu33XYbAD///DN33XUXvXr14tNPPzXd7124cOGG/x/Kc733atVxvxgbG0vv3r0JDg7mjTfewM/Pj23btjFjxgwuXbrE3Llzyx230Whk5MiRHDhwgHnz5tGlSxf27t1LRESERd9ff/2VIUOG0KFDB9asWYOtrS2rVq1i5MiRfPLJJ4wZMwao3H06wIULFxgwYADW1tasWrUKX19fNm/ezOOPP16pOR83bhyHDh1i0aJFtGzZkoyMDA4dOkRqaqpZv8p871y8eJHevXtTUFDAwoULCQ0N5fvvv+fpp5/mn3/+YdWqVfj7+7N161YiIiKYPHkyU6ZMATAFcys7HiFEORQhhGhELl68qADK3Llzq7zvI488ogAKoNjY2CirVq2q1H6HDh1SnnzySeU///mPsmvXLmXt2rVK69atFZ1Op2zduvWa+166dEkBlOXLl1+zX0hIiGJnZ6ecPn3a1Jabm6t4eHgojzzyiKnt/vvvV2xtbZXExESz/W+//XbFwcFBycjIUBRFUfbv368Ayrp1665rPGWZMGGCAiiff/65Wfvw4cOVW265xfT83//+d5n9lixZogDKTz/9ZGoDFFdXVyUtLc2s77p16xRAeeKJJ8zaR40apQDKm2++adbeqVMnpUuXLuWO3WAwKHq9XlmwYIHi6empGI1G02sDBgxQBgwYcO2LF0IIIUSNKv7dHx8fb2obMGCAAij79u0z69umTRtl2LBhpuc7duxQAKVLly5mv+MTEhIUa2trZcqUKeWet7CwUMnOzlYcHR2VFStWWBxzx44dVd63+FqmT59u1n/p0qUKoCQlJSmKoihxcXGKTqdTHnzwwXLPceXKFcXDw0MZOXKkWbvBYFA6duyohIeHm9p69OihBAQEKLm5uaa2rKwsxcPDQ6nu0MCN3qtVx/3isGHDlMDAQCUzM9Os/fHHH1fs7Ows+pf0ww8/KICyevVqs/bFixdbvNfo2bOn4uPjo1y+fNnUVlhYqLRr104JDAw0fc1V9j599uzZikajUWJiYsz6DRkypMKvOUVRFCcnJ2XmzJnX7FPZ7505c+aU2W/atGmKRqNR/vrrL0VRrv0erDLjEUKUT0olCCFEkeeff579+/fzww8/MGnSJB5//PFKfXysc+fOLF++nFGjRtGvXz8mTpzInj178Pf3N/3lvDweHh40a9aMZcuW8eabb3L48OEyP9oH0KlTJ1N2KICdnR0tW7Y0y7j45ZdfuO222wgKCjLbNzIykpycHPbu3Vtt4ymLRqNh5MiRZm0dOnSwGKOjoyOjR4+2GCNg8bG+W2+9FXd39zLPd8cdd5g9b926NYApi7hke+mPKf7yyy8MHjwYV1dXdDod1tbWvPzyy6SmppKSklLBlQohhBCiPvDz8yM8PNysrfS9R7GxY8ealdcKCQmhd+/e7Nixw9SWnZ3N7Nmzad68OVZWVlhZWeHk5MSVK1c4ceLENcdS1X3vvPNOi3EDprFHRUVhMBh47LHHyj3nnj1
|
2024-09-12 13:58:14 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1400x1000 with 6 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"import matplotlib.pyplot as plt\n",
|
|
|
|
"\n",
|
|
|
|
"# Define data\n",
|
|
|
|
"bottle_data = {\n",
|
|
|
|
" \"ResNet50\": {\n",
|
|
|
|
" \"1,3,5 shots normal\": [0.5892857142857143, 0.7321428571428571, 0.75],\n",
|
|
|
|
" \"inbalanced - more good shots\": [0.75, 0.732, 0.696, 0.696],\n",
|
|
|
|
" \"2 ways only detect if faulty or not\": [0.8395, 0.8315, 0.8031],\n",
|
|
|
|
" \"inbalance 2 way\": [0.8031, 0.81893, 0.8336, 0.8031],\n",
|
|
|
|
" \"only faulty class detect\": [0.7638, 0.7428, 0.787]\n",
|
|
|
|
" },\n",
|
|
|
|
" \"P>M>F\": {\n",
|
|
|
|
" \"1,3,5 shots normal\": [0.67910401, 0.71710526, 0.78860294],\n",
|
|
|
|
" \"inbalanced - more good shots\": [0.78768382, 0.78860294, 0.75827206, 0.74356618],\n",
|
|
|
|
" \"2 ways only detect if faulty or not\": [0.86422306, 0.93201754, 0.93933824],\n",
|
|
|
|
" \"inbalance 2 way\": [0.92371324, 0.87867647, 0.86397059, 0.87775735],\n",
|
|
|
|
" \"only faulty class detect\": [0.57380952, 0.76705653, 0.84191176]\n",
|
|
|
|
" },\n",
|
|
|
|
" \"CAML\": {\n",
|
|
|
|
" \"1,3,5 shots normal\": [0.40740741, 0.39726027, 0.30769231],\n",
|
|
|
|
" \"2 ways only detect if faulty or not\": [0.79012346, 0.84415584, 0.87671233],\n",
|
|
|
|
" \"only faulty class detect\": [0.58064516, 0.51785714, 0.52]\n",
|
|
|
|
" }\n",
|
|
|
|
"}\n",
|
|
|
|
"\n",
|
|
|
|
"cable_data = {\n",
|
|
|
|
" \"ResNet50\": {\n",
|
|
|
|
" \"1,3,5 shots normal\": [0.21808, 0.43815, 0.4321478],\n",
|
|
|
|
" \"inbalanced - more good shots\": [0.4321478, 0.432986, 0.42340, 0.4464635],\n",
|
|
|
|
" \"2 ways only detect if faulty or not\": [0.8592, 0.8772, 0.8495],\n",
|
|
|
|
" \"inbalance 2 way\": [0.8495, 0.8180, 0.7460, 0.6846],\n",
|
|
|
|
" \"only faulty class detect\": [0.240, 0.4740, 0.4805]\n",
|
|
|
|
" },\n",
|
|
|
|
" \"P>M>F\": {\n",
|
|
|
|
" \"1,3,5 shots normal\": [0.25199021, 0.44388328, 0.46975059],\n",
|
|
|
|
" \"inbalanced - more good shots\": [0.50425859, 0.48023277, 0.43118282, 0.41842534],\n",
|
|
|
|
" \"2 ways only detect if faulty or not\": [0.79263485, 0.8707712, 0.86756514],\n",
|
|
|
|
" \"inbalance 2 way\": [0.86966158, 0.80142425, 0.80961366, 0.66028834],\n",
|
|
|
|
" \"only faulty class detect\": [0.24383256, 0.43800505, 0.51304563]\n",
|
|
|
|
" },\n",
|
|
|
|
" \"CAML\": {\n",
|
|
|
|
" \"1,3,5 shots normal\": [0.24031008, 0.19834711, 0.15929204],\n",
|
|
|
|
" \"2 ways only detect if faulty or not\": [0.57364341, 0.54545455, 0.59292035],\n",
|
|
|
|
" \"only faulty class detect\": [0.12962963, 0.36363636, 0.58823529]\n",
|
|
|
|
" }\n",
|
|
|
|
"}\n",
|
|
|
|
"# Prepare the data\n",
|
|
|
|
"measurement_types = [\n",
|
|
|
|
" \"1,3,5 shots normal\",\n",
|
|
|
|
" \"inbalanced - more good shots\",\n",
|
|
|
|
" \"2 ways only detect if faulty or not\",\n",
|
|
|
|
" \"inbalance 2 way\",\n",
|
|
|
|
" \"only faulty class detect\"\n",
|
|
|
|
"]\n",
|
|
|
|
"\n",
|
|
|
|
"models = [\"ResNet50\", \"P>M>F\", \"CAML\"]\n",
|
|
|
|
"\n",
|
|
|
|
"# Create subplots\n",
|
|
|
|
"fig, axes = plt.subplots(3, 2, figsize=(14, 10))\n",
|
|
|
|
"axes = axes.flatten()\n",
|
|
|
|
"\n",
|
|
|
|
"# Loop through each measurement type\n",
|
|
|
|
"for i, measurement in enumerate(measurement_types):\n",
|
|
|
|
" ax = axes[i]\n",
|
|
|
|
" for model in models:\n",
|
|
|
|
" # Get the bottle and cable data for the current measurement and model\n",
|
|
|
|
" bottle_accuracy = bottle_data[model].get(measurement, [])\n",
|
|
|
|
" cable_accuracy = cable_data[model].get(measurement, [])\n",
|
|
|
|
" \n",
|
|
|
|
" # Plot both bottle and cable data\n",
|
|
|
|
" ax.plot(bottle_accuracy, marker='o', label=f'{model} - Bottle', linestyle='-')\n",
|
|
|
|
" \n",
|
|
|
|
" ax.set_title(measurement)\n",
|
|
|
|
" ax.set_xlabel(\"Shots / Samples\")\n",
|
|
|
|
" ax.set_ylabel(\"Accuracy\")\n",
|
|
|
|
" ax.legend()\n",
|
|
|
|
" ax.grid(True)\n",
|
|
|
|
"\n",
|
|
|
|
"# Adjust layout\n",
|
|
|
|
"plt.tight_layout()\n",
|
|
|
|
"plt.show()\n"
|
|
|
|
]
|
|
|
|
},
|
2025-01-01 20:53:05 +01:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 57,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHWCAYAAAD6oMSKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB7IUlEQVR4nO3dd3gU1eLG8e+mJ6RAAqRACKETQgfpRXovIuWKUixX5Soi2FCRovdiV9QfqChFRKlSVESCSBEQaaEF6RBKINQkQEhCMr8/BlZCCgkkbLK8n+c5D+zsmZmzu7B5c+acMxbDMAxEREREpNBzsHUDRERERCRvKNiJiIiI2AkFOxERERE7oWAnIiIiYicU7ERERETshIKdiIiIiJ1QsBMRERGxEwp2IiIiInZCwU5ERETETijYiUi+mTZtGhaLxVqcnJwoXbo0gwcP5vjx43d8/JUrV1qPPW3atEzrtGrVCovFQtmyZe/4fABly5ZN95puLBcvXsyTc+S1MWPGYLFYOHPmzC3rtmzZkpYtW+Z/o0QkXzjZugEiYv+mTp1KlSpVSExMZPXq1YwfP55Vq1axY8cOihQpcsfH9/Ly4uuvv2bQoEHpth86dIiVK1fi7e19x+e4UZMmTXj//fczbPfw8MjT84iI5JaCnYjku/DwcOrVqwfA/fffT2pqKm+++SYLFy6kf//+JCYmcubMGYKDg2/r+H379uWrr75i3759VKxY0bp9ypQplCpViurVqxMVFZVun3379lGhQgUsFkuuz1e0aFEaNmx4W20VEclPuhQrInfd9VB05MgRAE6dOkVISAjNmzdn0qRJObpkeKO2bdsSHBzMlClTrNvS0tKYPn06AwcOxMEh41fdE088QUhICC+99BJbt269g1eTf7777jsaNWqEp6cnnp6e1KpVi6+//tr6fEREBN27d6d06dK4ublRoUIFnnzyySzfv6NHj/LAAw/g7e2Nj48PDz/8MKdPn75lO5KTk3nrrbeoUqUKrq6ulChRgsGDB+doXxG5uxTsROSu279/PwAlSpQAIDg4mAULFlCqVClefPFFAgMD6dSpEzNmzCAhIeGWx3NwcGDQoEF88803pKamArBs2TKOHTvG4MGDM91n4sSJPPzww8yfP586depQtWpVxo0bx759+255PsMwuHr1arqSlpaW05efI2+88Qb9+/cnKCiIadOmsWDBAgYOHGgNwwAHDhygUaNGTJo0iWXLlvHGG2+wYcMGmjZtSkpKSoZj9uzZkwoVKjBv3jzGjBnDwoULad++faZ1r0tLS6N79+68/fbbPPTQQ/z888+8/fbbRERE0LJlSxITE/P0dYvIHTJERPLJ1KlTDcD4888/jZSUFCMhIcH46aefjBIlShheXl7GyZMnM+xz6dIlY/bs2UbPnj0NNzc3w93d3ejdu7fxww8/GFeuXElX9/fffzcAY+7cucbBgwcNi8Vi/PTTT4ZhGEbv3r2Nli1bGoZhGJ07dzZCQkKybOdff/1lDB8+3ChdurQBGHXr1jU++OAD49ixYxnqhoSEGECG8tprr93BO5XewYMHDUdHR6N///453ictLc1ISUkxjhw5YgDGokWLrM+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HUqlUrT9qTnw4fPozFYiEyMjLbenv27CEgIICEhIS707BCLKfvaVZatmzJsGHD8rRNOVG/fn1++OGHu35ee6Ngl5moxfBxOE7f9qDekUk4fdsDPg43t4tIoZaaZrD+wFkWRR5n/YGzpKYZ+Xq+QYMG0aNHj3w9x73gtdde4z//+U+OboIutnc7v1iMGjWKV155JU+WMzp16hSDBg2yTrbq0KED+/btu+PjFgYKdjeLWgxzBkD8ifTb42PM7Qp
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 640x480 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# Create subplots\n",
|
|
|
|
"fig, ax = plt.subplots()\n",
|
|
|
|
"\n",
|
|
|
|
"# Loop through each measurement type\n",
|
|
|
|
"model = \"P>M>F\"\n",
|
|
|
|
"data = cable_data\n",
|
|
|
|
"imgclass = \"cable\"\n",
|
|
|
|
"\n",
|
|
|
|
"# Plot both bottle and cable data\n",
|
|
|
|
"ax.plot([5,10,15, 30], data[model].get(\"inbalanced - more good shots\", []), marker='o', label=f'Inbalanced (more good shots) - 9 way', linestyle='-')\n",
|
|
|
|
"ax.plot([5,10,15, 30], data[model].get(\"inbalance 2 way\", []), marker='o', label=f'faulty or not - 2 way', linestyle='-')\n",
|
|
|
|
"\n",
|
|
|
|
"ax.set_title(f'{model} - {imgclass}')\n",
|
|
|
|
"ax.set_xlabel(\"Shots per class\")\n",
|
|
|
|
"ax.set_ylabel(\"Accuracy\")\n",
|
|
|
|
"ax.legend()\n",
|
|
|
|
"ax.grid(True)\n",
|
|
|
|
"\n",
|
|
|
|
"ax.set(xlim=(4.5, 30.5), xticks=[5,10,15, 30])\n",
|
|
|
|
"\n",
|
|
|
|
"# Adjust layout\n",
|
|
|
|
"plt.tight_layout()\n",
|
|
|
|
"plt.savefig(f\"{model}-{imgclass}-inbalanced.png\")"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 55,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHWCAYAAAD6oMSKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAACWGUlEQVR4nOzdeVwV9f7H8ddh35EdBATcRTQXVFxYLLfMtUX61a00rWveckEzrcz15m6mN71qKpmWZl1brcQKEKVcMRNLc0MRRFDZl8M58/sDOXoEERQ4gJ/n48FDmfnOzHfAgbffbVSKoigIIYQQQoh6z8jQFRBCCCGEENVDgp0QQgghRAMhwU4IIYQQooGQYCeEEEII0UBIsBNCCCGEaCAk2AkhhBBCNBAS7IQQQgghGggJdkIIIYQQDYQEOyGEEEKIBkKCnRCixkVGRqJSqXQfJiYmeHl5MWrUKJKTk+/7/NHR0bpzR0ZGllvm4YcfRqVS4evre9/XA/D19dW7p1s/cnJyquUapdcZNGhQtZ0vLy+PWbNmER0dXWbfvn37mDVrFtevXy+zLywsjLCwsGqrhxCiZpgYugJCiAfHxo0bad26Nfn5+cTGxjJ//nxiYmI4duwY1tbW931+W1tb1q9fz8iRI/W2nz17lujoaOzs7O77Grfq2bMnS5YsKbPdysqqWq9TnfLy8pg9ezZAmaC2b98+Zs+ezciRI2nUqFHtV04Icd8k2Akhak1AQACBgYEA9O7dG41Gw9y5c/nyyy959tlnyc/PJz09HW9v73s6f3h4OB9++CGnTp2iRYsWuu0bNmzA09OTdu3akZiYqHfMqVOnaN68OSqVqsrXa9SoEUFBQfdUVyGEqAnSFSuEMJjSUHT+/HkALl++jI+PDyEhIaxevZr09PQqna9v3754e3uzYcMG3TatVstHH33ECy+8gJFR2R95L730Ej4+PkydOpUjR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3bh1arZZffvml3FeJGRsb8/XXX/P+++/z8ccfM3/+fN2r4kJDQ++pZVIIcf9UiqIohq6EEEIIIYS4f7LciRBCCCFEAyHBTgghhBCigZBgJ4QQQgjRQEiwE0IIIYRoICTYCSGEEEI0EBLshBBCCCEaCFnHrhxarZZLly5ha2tb4WuLhBBCCCFqmqIoZGdn07hxY4yMKm6Tk2BXjkuXLuHt7W3oagghhBBC6Fy4cAEvL68Ky0iwK0fp63MuXLhQbS/+riy1Ws2uXbvo169fpd+LKYSom+R5FqLhMOTznJWVhbe3d7mv97udBLtylHa/2tnZGSTYWVlZYWdnJ78IhKjn5HkWouGoC89zZYaHGXzyxKpVq/Dz88PCwoLOnTuzZ8+eCst/8MEHtGnTBktLS1q1asWmTZv09kdGRqJSqcp8FBQU1ORtCCGEEEIYnEFb7LZt28bEiRNZtWoVPXv2ZM2aNTz66KMkJibSpEmTMuVXr17N9OnTWbduHV26dGH//v289NJLODg4MHjwYF05Ozs7/vrrL71jLSwsavx+hBBCCCEMyaDBbtmyZYwePZoxY8YAsHz5cn788UdWr17N/Pnzy5T/+OOP+ec//0l4eDgATZs25ddff2XhwoV6wU6lUuHu7l47NyGEEEIIUUcYrCu2qKiIQ4cO0a9fP73t/fr1Y9++feUeU1hYWKblzdLSkv3796NWq3XbcnJy8PHxwcvLi0GDBnHkyJHqvwEhhBBCiDrGYC126enpaDQa3Nzc9La7ubmRmppa7jH9+/fnww8/ZNiwYXTq1IlDhw6xYcMG1Go16enpeHh40Lp1ayIjI2nXrh1ZWVm8//779OzZk6NHj9KiRYtyz1tYWEhhYaHu86ysLKBkoOStgbE2lF6vtq8rhKh+8jw
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 640x480 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# Create subplots\n",
|
|
|
|
"fig, ax = plt.subplots()\n",
|
|
|
|
"\n",
|
|
|
|
"# Loop through each measurement type\n",
|
|
|
|
"model = \"P>M>F\"\n",
|
|
|
|
"data = bottle_data\n",
|
|
|
|
"imgclass = \"bottle\"\n",
|
|
|
|
"\n",
|
|
|
|
"# Plot both bottle and cable data\n",
|
|
|
|
"ax.plot([1,3,5], data[model].get(\"1,3,5 shots normal\", []), marker='o', label=f'Normal all classes - 4 way', linestyle='-')\n",
|
|
|
|
"ax.plot([1,3,5], data[model].get(\"2 ways only detect if faulty or not\", []), marker='o', label=f'faulty or not - 2 way', linestyle='-')\n",
|
|
|
|
"ax.plot([1,3,5], data[model].get(\"only faulty class detect\", []), marker='o', label=f'faulty classes - 3 way', linestyle='-')\n",
|
|
|
|
"\n",
|
|
|
|
"ax.set_title(f'{model} - {imgclass}')\n",
|
|
|
|
"ax.set_xlabel(\"Shots per class\")\n",
|
|
|
|
"ax.set_ylabel(\"Accuracy\")\n",
|
|
|
|
"ax.legend()\n",
|
|
|
|
"ax.grid(True)\n",
|
|
|
|
"\n",
|
|
|
|
"ax.set(xlim=(0.75, 5.25), xticks=[1,3,5])\n",
|
|
|
|
"\n",
|
|
|
|
"# Adjust layout\n",
|
|
|
|
"plt.tight_layout()\n",
|
|
|
|
"plt.savefig(f\"{model}-{imgclass}.png\")"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 61,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHWCAYAAAD6oMSKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB0i0lEQVR4nO3dd3xT9f4/8NdJmu5F96BNy4aW2dIBsmSDgFwVFGUJLlTk1gX3ei9DvaD3K4IDfnplFVQQEUUvIlVkeGnLKAWkqMjoTDdtupsm5/dHaGhIRwJp04bX00cfNCefc87nACkvP+fzeR9BFEURRERERNThSSzdASIiIiIyDwY7IiIiIivBYEdERERkJRjsiIiIiKwEgx0RERGRlWCwIyIiIrISDHZEREREVoLBjoiIiMhKMNgRERERWQkGOyIyu61bt0IQBN2XjY0NOnfujPnz5yM7O/uOj3/48GHdsbdu3dpom3vvvReCICAkJOSOzwcAISEhetfU8Ku8vNws56g/z3333We241VWVmLFihU4fPiwwXvHjx/HihUrUFJSYvDeyJEjMXLkSLP1g4jaho2lO0BE1mvLli3o1asXqqqqcPToUaxevRpHjhzB+fPn4eTkdMfHd3FxwaZNmzBv3jy97VevXsXhw4fh6up6x+doaOjQofi///s/g+2Ojo5mPY85VVZWYuXKlQBgENSOHz+OlStXYt68eXB3d2/7zhGR2THYEVGrCQ8PR2RkJABg1KhRUKvVeP311/H111/j0UcfRVVVFQoLCxEUFHRbx585cyY++eQTXLp0Cd27d9dt37x5MwIDA9G3b1+kpaXp7XPp0iV069YNgiCYfD53d3fExMTcVl+JiNoCb8USUZupD0Xp6ekAgLy8PMjlcgwfPhwbN25EYWGhSccbO3YsgoKCsHnzZt02jUaDbdu2Ye7cuZBIDH/EPfHEE5DL5XjllVdw5syZO7ia1rV3717069cP9vb26NKlC9577z2DNhkZGXjsscfg4+MDOzs79O7dG++88w40Gg0A4Nq1a/D29gYArFy5UnfreN68eVixYgVefvllAEBoaKjuvcZu2darra3FG2+8gV69esHOzg7e3t6YP38+CgoKzP8bQES3hcGOiNrMn3/+CQC6sBEUFIS9e/ciMDAQL7/8Mvz9/TFp0iRs374dZWVlLR5PIpFg3rx5iI+Ph1qtBgAcPHgQWVlZmD9/fqP7bNiwAY899hj27NmDQYMGoXfv3li1ahUuXbrU4vlEUURdXZ3eV32IMqfU1FQsWbIEf/3rX7F3714MGTIEL7zwgt5t4IKCAgwZMgQHDx7E66+/jn379mHMmDF46aWX8NxzzwEA/P39ceDAA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IiMCxY8eabf/pp5+if//+cHR0hL+/P+bPn4+ioqI26i0RERFR+2XROXa7du3CkiVLsGHDBgwdOhQfffQRJk6ciLS0NAQHBxu0/+WXXzBnzhy8++67mDJlCrKzs/H0009j4cKF2Lt3r1n7plaroVKpzHpMlUoFGxsbVFdXQ61Wm/XYZEgmk0EqlVq6G0RERG3GosFu7dq1WLBgARYuXAgAWLduHX744Qds3LgRq1evNmiflJSEkJAQLF68GAAQGhqKp556Cm+//bbZ+iSKInJzc1FSUmK2YzY8tp+fHzIzM1lDr424u7vDz8+Pv99ERHRXsFiwq62txenTp7F06VK97ePGjcPx48cb3WfIkCH4+9//jv3792PixInIz8/Hl19+icmTJ5utX/WhzsfHB46OjmYNBBqNBuXl5XB2dm6xwCDdGVEUUVlZifz8fACAv7+/hXtERETU+iwW7AoLC6FWq+Hr66u33dfXF7m5uY3uM2TIEHz66ae
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 640x480 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# Create subplots\n",
|
|
|
|
"fig, ax = plt.subplots()\n",
|
|
|
|
"\n",
|
|
|
|
"# Loop through each measurement type\n",
|
|
|
|
"model = \"P>M>F\"\n",
|
|
|
|
"data = bottle_data\n",
|
|
|
|
"imgclass = \"bottle\"\n",
|
|
|
|
"\n",
|
|
|
|
"# Plot both bottle and cable data\n",
|
|
|
|
"ax.plot([1,3,5], data[\"ResNet50\"].get(\"1,3,5 shots normal\", []), marker='o', label=f'ResNet50', linestyle='-')\n",
|
|
|
|
"ax.plot([1,3,5], data[\"P>M>F\"].get(\"1,3,5 shots normal\", []), marker='o', label=f'P>M>F', linestyle='-')\n",
|
|
|
|
"ax.plot([1,3,5], data[\"CAML\"].get(\"1,3,5 shots normal\", []), marker='o', label=f'CAML', linestyle='-')\n",
|
|
|
|
"\n",
|
|
|
|
"ax.set_title(f'{model} - {imgclass}')\n",
|
|
|
|
"ax.set_xlabel(\"Shots per class\")\n",
|
|
|
|
"ax.set_ylabel(\"Accuracy\")\n",
|
|
|
|
"ax.legend()\n",
|
|
|
|
"ax.grid(True)\n",
|
|
|
|
"\n",
|
|
|
|
"ax.set(xlim=(0.75, 5.25), xticks=[1,3,5])\n",
|
|
|
|
"\n",
|
|
|
|
"# Adjust layout\n",
|
|
|
|
"plt.tight_layout()\n",
|
|
|
|
"plt.savefig(f\"{model}-{imgclass}.png\")"
|
|
|
|
]
|
|
|
|
},
|
2024-09-12 13:58:14 +02:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 2,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABW0AAAPdCAYAAADxjUr8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8fJSN1AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gUVd/H4c/uplcICUloSegl9Bp670h5UZoCAoIiIAJSFIQAgoBUJYhKEUFFRVTKAwQhdAQEFAi9l9AhBRKy2Z33jyEry24aqSS/22su2bMzZ86cbDaz3z1zRqMoioIQQgghhBBCCCGEEEKIHEGb3Q0QQgghhBBCCCGEEEII8R8JbYUQQgghhBBCCCGEECIHkdBWCCGEEEIIIYQQQgghchAJbYUQQgghhBBCCCGEECIHkdBWCCGEEEIIIYQQQgghchAJbYUQQgghhBBCCCGEECIHkdBWCCGEEEIIIYQQQgghchAJbYUQQgghhBBCCCGEECIHkdBWCCGEEEIIIYQQQgghchAJbYUQL4Xo6GhGjx5Ny5Yt8fLyQqPRMGnSpFRvf/ToUdq1a0exYsVwdHTEw8ODoKAgVq5cmartw8LC0Gg0Vpf9+/e/4FGZ8/f3p3379hlS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qmVW9vz5SKKePXuaTbPl5+dH3bp12b59u6ksJiaGMWPGULJkSWxsbLCxscHFxYVHjx5x8uTJZNuS1m1feeUVi3YDpraHhoZiMBh49913k9zn3r17uX//Pn369CEhIcG
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1400x1000 with 6 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# Create subplots\n",
|
|
|
|
"fig, axes = plt.subplots(3, 2, figsize=(14, 10))\n",
|
|
|
|
"axes = axes.flatten()\n",
|
|
|
|
"\n",
|
|
|
|
"# Loop through each measurement type\n",
|
|
|
|
"for i, measurement in enumerate(measurement_types):\n",
|
|
|
|
" ax = axes[i]\n",
|
|
|
|
" for model in models:\n",
|
|
|
|
" # Get the bottle and cable data for the current measurement and model\n",
|
|
|
|
" bottle_accuracy = bottle_data[model].get(measurement, [])\n",
|
|
|
|
" cable_accuracy = cable_data[model].get(measurement, [])\n",
|
|
|
|
" \n",
|
|
|
|
" # Plot both bottle and cable data\n",
|
|
|
|
" ax.plot(cable_accuracy, marker='o', label=f'{model} - Cable', linestyle='-')\n",
|
|
|
|
" \n",
|
|
|
|
" ax.set_title(measurement)\n",
|
|
|
|
" ax.set_xlabel(\"Shots / Samples\")\n",
|
|
|
|
" ax.set_ylabel(\"Accuracy\")\n",
|
|
|
|
" ax.legend()\n",
|
|
|
|
" ax.grid(True)\n",
|
|
|
|
"\n",
|
|
|
|
"# Adjust layout\n",
|
|
|
|
"plt.tight_layout()\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"kernelspec": {
|
2025-01-01 20:53:05 +01:00
|
|
|
"display_name": "Python 3 (ipykernel)",
|
2024-09-12 13:58:14 +02:00
|
|
|
"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",
|
2025-01-01 20:53:05 +01:00
|
|
|
"version": "3.13.1"
|
2024-09-12 13:58:14 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
2025-01-01 20:53:05 +01:00
|
|
|
"nbformat_minor": 4
|
2024-09-12 13:58:14 +02:00
|
|
|
}
|