ploting notebooks
All checks were successful
Build Typst document / build_typst_documents (push) Successful in 22s

This commit is contained in:
lukas-heiligenbrunner 2025-01-01 20:53:05 +01:00
parent fe9f4433b3
commit 882c6f54bb
14 changed files with 149 additions and 17 deletions

BIN
notebooks/CAML-bottle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
notebooks/CAML-cable.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
notebooks/P>M>F-bottle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
notebooks/P>M>F-cable.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -282,7 +282,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.12.4" "version": "3.13.1"
} }
}, },
"nbformat": 4, "nbformat": 4,

File diff suppressed because one or more lines are too long

View File

@ -887,7 +887,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.12.4" "version": "3.13.1"
} }
}, },
"nbformat": 4, "nbformat": 4,

View File

@ -2,14 +2,18 @@
"cells": [ "cells": [
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": 1,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "ename": "ModuleNotFoundError",
"output_type": "stream", "evalue": "No module named 'torchvision'",
"text": [ "output_type": "error",
"imports imported\n" "traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[1], line 8\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mmatplotlib\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mpyplot\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mplt\u001b[39;00m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mtorch\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m optim, nn\n\u001b[0;32m----> 8\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mtorchvision\u001b[39;00m\n\u001b[1;32m 9\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mtorchvision\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m datasets, models, transforms\n\u001b[1;32m 10\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01malbumentations\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mA\u001b[39;00m\n",
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'torchvision'"
] ]
} }
], ],
@ -238,9 +242,9 @@
"\n", "\n",
"print(resnetshotnr0)\n", "print(resnetshotnr0)\n",
"# Step 2: Modify the model to output features from the layer before the fully connected layer\n", "# Step 2: Modify the model to output features from the layer before the fully connected layer\n",
"class ResNetshotnr0Embeddings(nn.Module):\n", "class ResNet50Embeddings(nn.Module):\n",
" def __init__(self, original_model, layernr):\n", " def __init__(self, original_model, layernr):\n",
" super(ResNetshotnr0Embeddings, self).__init__()\n", " super(ResNet50Embeddings, self).__init__()\n",
" #print(list(original_model.children())[4 + layernr])\n", " #print(list(original_model.children())[4 + layernr])\n",
" #print(nn.Sequential(*list(original_model.children())[:4 + shotnr]))\n", " #print(nn.Sequential(*list(original_model.children())[:4 + shotnr]))\n",
" self.features = nn.Sequential(*list(original_model.children())[:4+layernr])\n", " self.features = nn.Sequential(*list(original_model.children())[:4+layernr])\n",
@ -252,7 +256,7 @@
" return x\n", " return x\n",
"\n", "\n",
"# Instantiate the modified model\n", "# Instantiate the modified model\n",
"model = ResNetshotnr0Embeddings(resnetshotnr0, shotnr) # 3 = layer before fully connected one\n", "model = ResNet50Embeddings(resnetshotnr0, shotnr) # 3 = layer before fully connected one\n",
"model.eval() # Set the model to evaluation mode\n", "model.eval() # Set the model to evaluation mode\n",
"print()\n" "print()\n"
] ]
@ -487,9 +491,9 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.14" "version": "3.13.1"
} }
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 2 "nbformat_minor": 4
} }