|
8 | 8 | "source": [ |
9 | 9 | "import os\n", |
10 | 10 | "from pathlib import Path\n", |
11 | | - "from typing import List\n", |
12 | 11 | "\n", |
13 | 12 | "import matplotlib.pyplot as plt\n", |
14 | 13 | "import numpy as np\n", |
|
24 | 23 | "# Plot distribution of embedding lenghts\n", |
25 | 24 | "fig, axs = plt.subplots(1, 2, figsize=(12, 5))\n", |
26 | 25 | "axs = np.ravel(axs) # Flatten to 1D array\n", |
27 | | - "axs: List[plt.Axes] # Type hinting\n", |
| 26 | + "axs: list[plt.Axes] # Type hinting\n", |
28 | 27 | "\n", |
29 | 28 | "# Plot Arcface distribution\n", |
30 | 29 | "embed_arc = np.array(np.load(\"../results/xqlfw_arcface-r50.npy\"))\n", |
|
65 | 64 | "sort_idx = np.argsort(ampl_mag)\n", |
66 | 65 | "\n", |
67 | 66 | "\n", |
68 | | - "def plot_images(axs: List[plt.Axes], order: str = \"lowest\"):\n", |
| 67 | + "def plot_images(axs: list[plt.Axes], order: str = \"lowest\"):\n", |
69 | 68 | " for i in range(len(axs)):\n", |
70 | 69 | " if order == \"lowest\":\n", |
71 | 70 | " idx = sort_idx[i]\n", |
|
91 | 90 | "\n", |
92 | 91 | "\n", |
93 | 92 | "fig, axs = plt.subplots(1, 2, figsize=(15, 20))\n", |
94 | | - "axs: List[plt.Axes] # Type hinting\n", |
| 93 | + "axs: list[plt.Axes] # Type hinting\n", |
95 | 94 | "axs[0].imshow(plt.imread(\"../results/magface_lowest.png\"))\n", |
96 | 95 | "axs[0].tick_params(left=False, bottom=False, labelleft=False, labelbottom=False)\n", |
97 | 96 | "axs[0].set_frame_on(False)\n", |
|
127 | 126 | "name": "python", |
128 | 127 | "nbconvert_exporter": "python", |
129 | 128 | "pygments_lexer": "ipython3", |
130 | | - "version": "3.11.11" |
| 129 | + "version": "3.11.12" |
131 | 130 | } |
132 | 131 | }, |
133 | 132 | "nbformat": 4, |
|
0 commit comments