Skip to content

Commit c49eac0

Browse files
author
AdamMiltonBarker
committed
Preparing 0.1.0
1 parent 7664e58 commit c49eac0

File tree

95 files changed

+404
-9423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+404
-9423
lines changed

Android/__int__.py

Whitespace-only changes.
File renamed without changes.

Augmentation/V1/Manual.py Augmentation/Augmentation.py

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
21
############################################################################################
32
#
4-
# Project: Peter Moss Acute Myeloid/Lymphoblastic Leukemia AI Research Project
5-
# Repository: AML/ALL Detection System
3+
# Project: Peter Moss Acute Myeloid & Lymphoblastic Leukemia AI Research Project
4+
# Repository: ALL Detection System 2019
5+
# Project: Data Augmentation
66
#
77
# Author: Adam Milton-Barker (AdamMiltonBarker.com)
8-
# Title: Manual Augmentation Class
9-
# Description: Manual augmentation class for the AML/ALL Detection System.
8+
# Contributors:
9+
# Title: Manual Data Augmentation Class
10+
# Description: Manual data augmentation class for the ALL Detection System 2019.
1011
# License: MIT License
11-
# Last Modified: 2019-05-09
12+
# Last Modified: 2020-07-14
1213
#
1314
############################################################################################
1415

@@ -21,14 +22,14 @@
2122
plt.rcParams['image.cmap'] = 'gray'
2223

2324

24-
class ManualAugmentation():
25-
""" AML/ALL Detection System Manual Augmentation Class
25+
class Augmentation():
26+
""" ALL Detection System 2019 Manual Data Augmentation Class
2627
27-
Manual augmentation class for the AML/ALL Detection System.
28+
Manual data augmentation wrapper class for the ALL Detection System 2019 Data Augmentation project.
2829
"""
2930

3031
def __init__(self):
31-
""" Initializes the AML/ALL Detection System Manual Augmentation Class. """
32+
""" Initializes the Augmentation class. """
3233

3334
self.Data = Data()
3435

@@ -47,7 +48,7 @@ def processDataset(self):
4748

4849
print("!! Data Augmentation Program Starting !!")
4950
print("")
50-
ManualAugmentation = ManualAugmentation()
51-
ManualAugmentation.processDataset()
51+
Augmentation = Augmentation()
52+
Augmentation.processDataset()
5253
print(" Data Augmentation Program Complete")
5354
print("")

Augmentation/V1/Classes/Data.py Augmentation/Classes/Data.py

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
############################################################################################
22
#
3-
# Project: Peter Moss Acute Myeloid/Lymphoblastic Leukemia AI Research Project
4-
# Repository: AML/ALL Detection System
5-
# Project: AML/ALL Detection System
3+
# Project: Peter Moss Acute Myeloid & Lymphoblastic Leukemia AI Research Project
4+
# Repository: ALL Detection System 2019
5+
# Project: Data Augmentation
66
#
77
# Author: Adam Milton-Barker (AdamMiltonBarker.com)
88
# Contributors:
9-
# Title: Augmentation Data Helpers Class
10-
# Description: Helper functions for data augmentation used with the
11-
# AML/ALL Detection System.
9+
# Title: Data Class
10+
# Description: Data augmentation class for the ALL Detection System 2019.
1211
# License: MIT License
1312
# Credit: Based on methods outline in the Leukemia Blood Cell Image
1413
# Classification Using Convolutional Neural Network paper:
1514
# http://www.ijcte.org/vol10/1198-H0012.pdf
16-
# Last Modified: 2019-05-09
15+
# Last Modified: 2020-07-14
1716
#
1817
############################################################################################
1918

@@ -25,20 +24,21 @@
2524
import numpy as np
2625
import matplotlib.pyplot as plt
2726

27+
from numpy.random import seed
2828
from scipy import ndimage
2929
from PIL import Image
3030

3131
from Classes.Helpers import Helpers
3232

3333

3434
class Data():
35-
""" AML/ALL Detection System Data Helpers Class
35+
""" ALL Detection System 2019 Data Class
3636
37-
Data augmentation functions.
37+
Data augmentation class for the ALL Detection System 2019 Data Augmentation project.
3838
"""
3939

4040
def __init__(self):
41-
""" Initializes the AML/ALL Detection System Data Helpers Class. """
41+
""" Initializes the Data class. """
4242

4343
self.Helpers = Helpers()
4444
self.confs = self.Helpers.loadConfs()
@@ -48,6 +48,9 @@ def __init__(self):
4848
self.filesMade = 0
4949
self.trainingDir = self.confs["Settings"]["TrainDir"]
5050

51+
self.seed = self.confs["Settings"]["Seed"]
52+
seed(self.seed)
53+
5154
def writeImage(self, filename, image):
5255
""" Writes an image to provided file path. """
5356

@@ -174,6 +177,8 @@ def rotation(self, path, filePath, filename, show=False):
174177
cols, rows, chs = image.shape
175178

176179
for i in range(0, 20):
180+
# Seed needs to be set each time randint is called
181+
random.seed(self.seed)
177182
randDeg = random.randint(-180, 180)
178183
matrix = cv2.getRotationMatrix2D((cols/2, rows/2), randDeg, 0.70)
179184
rotated = cv2.warpAffine(image, matrix, (rows, cols), borderMode=cv2.BORDER_CONSTANT,

Augmentation/V1/Classes/Helpers.py Augmentation/Classes/Helpers.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
############################################################################################
22
#
3-
# Project: Peter Moss Acute Myeloid/Lymphoblastic Leukemia AI Research Project
4-
# Repository: AML/ALL Detection System
5-
# Project: AML/ALL Detection System
3+
# Project: Peter Moss Acute Myeloid & Lymphoblastic Leukemia AI Research Project
4+
# Repository: ALL Detection System 2019
5+
# Project: Data Augmentation
66
#
77
# Author: Adam Milton-Barker (AdamMiltonBarker.com)
88
# Contributors:
9-
# Title: Data Augmentation Helper Class
10-
# Description: Helper functions for the AML/ALL Detection System Augmentation Class.
9+
# Title: Helper Class
10+
# Description: Helper class for the ALL Detection System 2019.
1111
# License: MIT License
12-
# Last Modified: 2019-05-09
12+
# Last Modified: 2020-07-14
1313
#
1414
############################################################################################
1515

@@ -20,18 +20,18 @@
2020

2121

2222
class Helpers():
23-
""" AML/ALL Detection System Movidius NCS1 Classifier Helper Class
23+
""" ALL Detection System 2019 Helper Class
2424
25-
Common helper functions for the AML/ALL Detection System Movidius NCS1 Classifier.
25+
Common helper functions for the ALL Detection System 2019 Data Augmentation project.
2626
"""
2727

2828
def __init__(self):
29-
""" Initializes the AML/ALL Detection System Helper Class. """
29+
""" Initializes the Helper class. """
3030

3131
pass
3232

3333
def loadConfs(self):
34-
""" Loads the AML/ALL Detection System configuration. """
34+
""" Loads the configuration. """
3535

3636
confs = {}
3737
with open('Required/confs.json') as confs:
File renamed without changes.
Loading
Loading
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)