summaryrefslogtreecommitdiff
path: root/dataset_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'dataset_utils.py')
-rw-r--r--dataset_utils.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/dataset_utils.py b/dataset_utils.py
deleted file mode 100644
index 927a78a..0000000
--- a/dataset_utils.py
+++ /dev/null
@@ -1,32 +0,0 @@
-import numpy as np
-from PIL import Image
-from pathlib import Path
-
-"""Class to interface the training and testing data."""
-class DatasetUtils:
- def __init__(self) -> None:
- self.data_path = Path('./data')
-
- """Convert the dataset to a 2 dimension array."""
- def data_to_arrays(self):
- for dir in self.data_path.iterdir():
- if not dir.is_dir(): continue
-
- for file in dir.glob('*.png'):
- image = Image.open(str(file)).convert(mode='L')
- # Return the image's pixel values as an array alongside
- # the character that it represents.
- yield (dir.name, np.asarray(image))
-
- """
- Get an image from the dataset.
- """
- def get_image(self, path: str):
- return np.asarray(Image.open(f"{self.data_path}/{path}").convert('1'))
-
- """Search for a file in the dataset."""
- def search(self, filename: str):
- pass
-
- def get_random_sample(self):
- pass