Merge pull request 'create test set' (#2) from test_set into main

Reviewed-on: #2
This commit is contained in:
Marcin Kostrzewski 2023-01-31 19:54:54 +01:00
commit b3bfa970c7
51 changed files with 41 additions and 0 deletions

41
load_test_data.py Normal file
View File

@ -0,0 +1,41 @@
import numpy as np
import os
from skimage.io import imread
import cv2 as cv
from pathlib import Path
def load_data(input_dir, newSize=(64,64)):
image_path = Path(input_dir)
file_names = os.listdir(image_path)
categories_name = []
categories_count = []
count = 0
n = file_names[0]
for name in file_names:
if name != n:
categories_count.append(count)
n = name
count = 1
else:
count += 1
if not name in categories_name:
categories_name.append(name)
categories_count.append(count)
test_img = []
labels = []
for n in file_names:
p = image_path / n
img = imread(p) # zwraca ndarry postaci xSize x ySize x colorDepth
img = cv.resize(img, newSize, interpolation=cv.INTER_AREA) # zwraca ndarray
img = img / 255 # type: ignore #normalizacja
test_img.append(img)
labels.append(n)
X = {}
X["values"] = np.array(test_img)
X["name"] = categories_name
X["names_count"] = categories_count
X["labels"] = labels
return X

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
test_set/Aisaka, Taiga.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
test_set/Alucard.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

BIN
test_set/Dazai, Osamu.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
test_set/Elric, Edward.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
test_set/Emilia.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

BIN
test_set/Gasai, Yuno.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
test_set/Gojou, Satoru.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 KiB

BIN
test_set/Guts.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
test_set/Kamina.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
test_set/Kaneki, Ken.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
test_set/Lawliet, L.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
test_set/Levi.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
test_set/Makise, Kurisu.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

BIN
test_set/Megumin.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
test_set/Morow, Hisoka.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
test_set/Mustang, Roy.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
test_set/Rem.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

BIN
test_set/Roronoa, Zoro.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
test_set/Saber.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

BIN
test_set/Saitama.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
test_set/Sanji.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
test_set/Spiegel, Spike.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 KiB

BIN
test_set/Uchiha, Itachi.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
test_set/Uchiha, Sasuke.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 KiB

BIN
test_set/Yagami, Light.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
test_set/Yato.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
test_set/Yeager, Eren.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
test_set/Yuuki, Asuna.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 KiB

BIN
test_set/Zero Two.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
test_set/holo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB