Skip to content

Commit

Permalink
chalky classifier
Browse files Browse the repository at this point in the history
  • Loading branch information
arielcatli committed Mar 16, 2018
1 parent 3a48e30 commit 7080af7
Show file tree
Hide file tree
Showing 197 changed files with 225 additions and 56 deletions.
16 changes: 16 additions & 0 deletions chalky_range.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
206,213,195
225,226,212
235,234,216
220,223,204
236,233,216
235,236,228
235,230,215
217,222,202
226,227,209
215,216,198
229,228,208
220,216,205
216,213,204
235,236,222
227,226,206
238,237,220
Binary file removed img-src/38/extracted/p/d/p99.jpg
Binary file not shown.
Binary file added img-src/52/bkn/p0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/bkn/p12.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/bkn/p19.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/bkn/p2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/bkn/p5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/bkn/p8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p13.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p17.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p18.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p19.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p20.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img-src/52/chalky/p8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img-src/52/extracted/p/p100.jpg
Binary file not shown.
Binary file removed img-src/52/extracted/p/p101.jpg
Binary file not shown.
Binary file removed img-src/52/extracted/p/p102.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p104.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p105.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p106.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p107.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p108.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p109.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p22.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p23.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p24.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p26.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p27.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p28.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p29.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p30.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p31.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p32.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p33.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p34.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p35.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p36.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p38.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p39.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p40.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p41.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p42.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p43.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p44.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p45.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p46.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p48.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p49.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p50.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p51.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p52.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p53.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p54.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p55.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p56.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p57.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p58.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p59.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p60.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p61.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p62.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p63.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p64.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p65.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p66.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p67.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p68.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p70.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p71.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p72.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p73.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p74.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p75.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p76.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p77.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p78.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p79.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p80.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p81.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p82.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p83.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p84.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p85.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p86.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p87.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p88.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p89.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p90.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p92.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p93.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p94.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p95.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p96.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p97.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p98.jpg
Diff not rendered.
Binary file removed img-src/52/extracted/p/p99.jpg
Diff not rendered.
Binary file added img-src/52/nbkn/p1.jpg
Binary file added img-src/52/nbkn/p11.jpg
Binary file added img-src/52/nbkn/p13.jpg
Binary file added img-src/52/nbkn/p14.jpg
Binary file added img-src/52/nbkn/p16.jpg
Binary file added img-src/52/nbkn/p17.jpg
Binary file added img-src/52/nbkn/p18.jpg
Binary file added img-src/52/nbkn/p20.jpg
Binary file added img-src/52/nbkn/p21.jpg
Binary file added img-src/52/nbkn/p4.jpg
Binary file added img-src/52/nbkn/p6.jpg
Binary file added img-src/52/nbkn/p7.jpg
Binary file added img-src/52/nbkn/p9.jpg
Binary file added img-src/52/nchalky/p12.jpg
Binary file added img-src/52/nchalky/p14.jpg
Binary file added img-src/52/nchalky/p15.jpg
Binary file added img-src/52/nchalky/p16.jpg
Binary file added img-src/52/nchalky/p21.jpg
Binary file added img-src/52/nchalky/p6.jpg
Binary file added img-src/52/nchalky/p9.jpg
10 changes: 10 additions & 0 deletions python2/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ def __create_sample_directory(self):
os.mkdir(self.sample_directory_extracted)
self.sample_directory_extracted_e = self.sample_directory_extracted + "/e/"
self.sample_directory_extracted_p = self.sample_directory_extracted + "/p/"
self.sample_directory_bkn = self.sample_directory + "/bkn/"
self.sample_directory_nbkn = self.sample_directory + "/nbkn/"
self.sample_directory_nylw = self.sample_directory + "/nylw/"
self.sample_directory_ylw = self.sample_directory + "/ylw/"
self.sample_directory_grn = self.sample_directory + "/grn/"
self.sample_directory_ngrn = self.sample_directory + "/ngrn/"
self.sample_directory_npaddy = self.sample_directory + "/npaddy/"
self.sample_directory_paddy = self.sample_directory + "/paddy/"
self.sample_directory_nchalky = self.sample_directory + "/nchalky/"
self.sample_directory_chalky = self.sample_directory + "/chalky/"
os.mkdir(self.sample_directory_extracted_e)
os.mkdir(self.sample_directory_extracted_p)
print "Created: " + self.sample_directory_extracted
Expand Down
122 changes: 103 additions & 19 deletions python2/chalky-classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
import numpy as np
import pickle
import os
import shutil


class Chalky_classifier():
def __init__(self):
self.__isCalibrated = False
self.__chalky_range = []
self.test_files = []
self.data_X = []
self.data_Y = []
self.files = []


def calibrate(self, chalky_range):
Expand All @@ -26,13 +31,29 @@ def calibrate(self, chalky_range):
print("Range is invalid")
self.__isCalibrated = False
break

def add_grains(self, grain_directory):
files = os.listdir(grain_directory)
self.files_name = files
for file in files:
self.files.append(grain_directory+file)

def add_test_grains(self, grain_directory, data_class):
files = os.listdir(grain_directory)
for file in files:
self.test_files.append(grain_directory+file)
self.data_Y.append(data_class)

def add_test_dataset(self, grain_directory):
images = os.listdir(grain_directory)
def test_classify(self):
images = self.test_files
chalky = 0
TP = 0
FP = 0
TN = 0
FN = 0
if self.__isCalibrated:
for image in images:
file_name = grain_directory + image
image_file = cv2.imread(file_name)
for i,image in enumerate(images):
image_file = cv2.imread(image)
# image_ = cv2.imread(file_name)
# mask_image = cv2.threshold(cv2.GaussianBlur(image_file, (7,7), 0),127,255, cv2.THRESH_OTSU + cv2.THRESH_BINARY)
# b = cv2.calcHist([image_], [0], mask_image[1], [256], [0,256])
Expand All @@ -42,32 +63,95 @@ def add_test_dataset(self, grain_directory):
# r = cv2.calcHist([image_], [2], mask_image[1], [256], [0,256])
# #r_perc = (sum(r[self.__chalky_range[0][0]:self.__chalky_range[0][1]])/sum(r))[0]
chalky_pixels = 0
total_pixels = 0

for row in image_file:
for column in row:
if(self.__within_range(column[0], self.__chalky_range[2]) and self.__within_range(column[1], self.__chalky_range[1]) and
self.__within_range(column[2], self.__chalky_range[0])):
chalky_pixels += 1
for column in row:
if(not column[0] == 0 and not column[1] == 0 and not column[2] == 0):
total_pixels += 1
if(self.__within_range(column[0], self.__chalky_range[2]) and self.__within_range(column[1], self.__chalky_range[1]) and
self.__within_range(column[2], self.__chalky_range[0])):
chalky_pixels += 1

total_pixels = image_file.shape[0] * image_file.shape[1]
print(chalky_pixels, total_pixels)
chalky_percentage = ((chalky_pixels/total_pixels)*100)
self.data_X.append(chalky_percentage)

if chalky_percentage >= 50:
chalky += 1

if chalky_percentage >= 50 and self.data_Y[i] == 1:
TP += 1

if chalky_percentage >= 50 and self.data_Y[i] == 0:
FP += 1

if chalky_percentage < 50 and self.data_Y[i] == 1:
FN += 1

if chalky_percentage < 50 and self.data_Y[i] == 0:
TN += 1

return [chalky, len(images), [TP, TN, FP, FN]]

def __within_range(self, number, range_):
if number > range_[0] and number < range_[1]:
return True
else:
return False


def classify(self, class0_dir, class1_dir):
chalky = 0
if self.__isCalibrated:
images = self.files
for i,image in enumerate(images):
image_file = cv2.imread(image)
chalky_pixels = 0
total_pixels = 0

for row in image_file:
for column in row:
if(not column[0] == 0 and not column[1] == 0 and not column[2] == 0):
total_pixels += 1
if(self.__within_range(column[0], self.__chalky_range[2]) and self.__within_range(column[1], self.__chalky_range[1]) and
self.__within_range(column[2], self.__chalky_range[0])):
chalky_pixels += 1

chalky_percentage = ((chalky_pixels/total_pixels)*100)

if chalky_percentage >= 50:
chalky += 1
shutil.copy(self.files[i], class1_dir+self.files_name[i])
else:
shutil.copy(self.files[i], class0_dir+self.files_name[i])

return [chalky, len(images)]

else:
print("Range is not calibrated")





if __name__ == "__main__":
chalk = Chalky_classifier()
chalk.calibrate([[150,255],[150,255],[150,255]])
chalk.add_test_dataset("../img-src/40/extracted/d/")
img = cv2.imread("../img-src/40/extracted/d/p57.jpg")
cv2.imshow("h", img)
print(img[85,29])
cv2.waitKey(0)
cv2.destroyAllWindows()
chalk.calibrate([[190, 255],[190, 255],[180, 255]])
chalk.add_test_grains("../testing/chalky/data/chalky/", 1)
chalk.add_test_grains("../testing/chalky/data/nchalky/", 0)
chalk_results = chalk.test_classify()
print((chalk_results[2][0]+chalk_results[2][1])/sum(chalk_results[2]))
# print(chalk.data_X)
# print(chalk.data_Y)
chalk.add_grains("../img-src/52/extracted/p/")
chalk.classify("../img-src/52/nchalky/", "../img-src/52/chalky/")

##
# images = os.listdir("../img-src/52/extracted/p/j")
# for i,image in enumerate(images):
# img = cv2.imread("../img-src/52/extracted/p/j/"+image)
# cv2.imshow(str(i), img)
#
# cv2.waitKey(0)
# cv2.destroyAllWindows()


Binary file added python3/utils/__pycache__/led.cpython-36.pyc
Binary file not shown.
133 changes: 96 additions & 37 deletions python3/utils/modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,42 @@ def __init__(self, isHOG):
self.dataset_filenames_nodir_test = []
self.dataset_test = []
self.isHOG = isHOG
self.dataset_classification = []
self.dataset_files = []

def add_dataset(self, data_folder):
if os.path.exists(data_folder):
images = os.listdir(data_folder)

if self.isHOG:
HOG = cv2.HOGDescriptor()
for image in images:
file_name = data_folder + image
self.dataset_files.append(file_name)
image = cv2.imread(file_name)
image_hog = HOG.compute(image)
self.dataset_classification.append(image_hog)

elif self.isHOG == False:

for image in images:
img_hist = np.zeros([])
file_name = data_folder + image
self.dataset_files.append(file_name)
image = cv2.imread(file_name)
mask_image = cv2.threshold(cv2.GaussianBlur(cv2.imread(file_name, 0), (7,7), 0),127,255, cv2.THRESH_OTSU + cv2.THRESH_BINARY)
r = cv2.calcHist([image], [0], mask_image[1], [256], [0,256])
r = r/max(r)
g = cv2.calcHist([image], [1], mask_image[1], [256], [0,256])
g = g/max(g)
b = cv2.calcHist([image], [2], mask_image[1], [256], [0,256])
b = b/max(b)

img_hist = np.concatenate((r,g,b))

self.dataset_classification(img_hist)



def add_model_dataset(self, data_folder, data_class):
if os.path.exists(data_folder):
Expand Down Expand Up @@ -141,8 +177,11 @@ def load_dataset(self, dataset_folder):
return pickle.load(dataset)

#def test(class1_dest, class0_dest, dataset=self.dataset_test, model=self.__model):

def classify(self, class0_dest, class1_dest):
def set_model(self, model_dir):
with open(model_dir) as model:
self.__model = pickle.load(model)

def test_classify(self, class0_dest, class1_dest):
count = 0
correct = 0

Expand Down Expand Up @@ -175,6 +214,21 @@ def classify(self, class0_dest, class1_dest):
FP += 1

return [results, self.dataset_filenames_test, [correct, count], [TP, TN, FP, FN]]

def classify(self, class0_dir, class1_dir):
if self.__model != None:
if self.isHOG:
self.dataset_classification = np.array(self.dataset_classification).reshape(-1,3780)

predictions = self.__model.predict(self.dataset_classification)
print(predictions)

for i,prediction in enumerate(predictions):
if prediction == 1:
shutil.copy(self.dataset_files[i], class1_dir)
else:
shutil.copy(self.dataset_files[i], class0_dir)



#def add_test_dataset(self):
Expand All @@ -188,44 +242,49 @@ def classify(self, class0_dest, class1_dest):
bkn.add_test_dataset("../../testing/bkn/data/bkn/", 0)
bkn.add_test_dataset("../../testing/bkn/data/unbkn/", 1)
bkn.build_test_dataset("../../testing/bkn/bins/", "bkn_test_dataset")
results = bkn.classify("../../testing/bkn/results/bkn/", "../../testing/bkn/results/unbkn/")
results = bkn.test_classify("../../testing/bkn/results/bkn/", "../../testing/bkn/results/unbkn/")
print(results[2][0]/results[2][1])
print(results[3])

ylw = Classifier(False)
ylw.add_model_dataset("../../training/ylw/data/ylw/", 1)
ylw.add_model_dataset("../../training/ylw/data/nylw/", 0)
ylw.build_model_dataset("../../training/ylw/bins/", "ylw_dataset")
ylw.build_model("../../training/ylw/bins/", "model_ylw")
ylw.add_test_dataset("../../testing/ylw/data/ylw/", 1)
ylw.add_test_dataset("../../testing/ylw/data/nylw/", 0)
ylw.build_test_dataset("../../testing/ylw/bins/", "ylw_test_dataset")
results = ylw.classify("../../testing/ylw/results/ylw/", "../../testing/ylw/results/nylw/")
print(results[2][0]/results[2][1])
print(results[3])
bkn.add_dataset("../../img-src/52/extracted/p/")
bkn.classify("../../img-src/52/bkn/", "../../img-src/52/nbkn")

# ylw = Classifier(False)
# ylw.add_model_dataset("../../training/ylw/data/ylw/", 1)
# ylw.add_model_dataset("../../training/ylw/data/nylw/", 0)
# ylw.build_model_dataset("../../training/ylw/bins/", "ylw_dataset")
# ylw.build_model("../../training/ylw/bins/", "model_ylw")
# ylw.add_test_dataset("../../testing/ylw/data/ylw/", 1)
# ylw.add_test_dataset("../../testing/ylw/data/nylw/", 0)
# ylw.build_test_dataset("../../testing/ylw/bins/", "ylw_test_dataset")
# results = ylw.test_classify("../../testing/ylw/results/ylw/", "../../testing/ylw/results/nylw/")
# print(results[2][0]/results[2][1])
# print(results[3])
#
# grn = Classifier(False)
# grn.add_model_dataset("../../training/grn/data/grn/", 1)
# grn.add_model_dataset("../../training/grn/data/ngrn/", 0)
# grn.build_model_dataset("../../training/grn/bins/", "grn_dataset")
# grn.build_model("../../training/grn/bins/", "model_grn")
# grn.add_test_dataset("../../testing/grn/data/grn/", 1)
# grn.add_test_dataset("../../testing/grn/data/ngrn/", 0)
# grn.build_test_dataset("../../testing/grn/bins/", "grn_test_dataset")
# results = grn.test_classify("../../testing/grn/results/grn/", "../../testing/grn/results/ngrn/")
# print(results[2][0]/results[2][1])
# print(results[3])
##
# paddy = Classifier(False)
# paddy.add_model_dataset("../../training/paddy/data/paddy/", 1)
# paddy.add_model_dataset("../../training/paddy/data/npaddy/", 0)
# paddy.build_model_dataset("../../training/paddy/bins/", "paddy_dataset")
# paddy.build_model("../../training/paddy/bins/", "model_paddy")
# paddy.add_test_dataset("../../testing/paddy/data/paddy/", 1)
# paddy.add_test_dataset("../../testing/paddy/data/npaddy/", 0)
# paddy.build_test_dataset("../../testing/paddy/bins/", "paddy_test_dataset")
# results = paddy.test_classify("../../testing/paddy/results/paddy/", "../../testing/paddy/results/npaddy/")
# print(results[2][0]/results[2][1])
# print(results[3])


grn = Classifier(False)
grn.add_model_dataset("../../training/grn/data/grn/", 1)
grn.add_model_dataset("../../training/grn/data/ngrn/", 0)
grn.build_model_dataset("../../training/grn/bins/", "grn_dataset")
grn.build_model("../../training/grn/bins/", "model_grn")
grn.add_test_dataset("../../testing/grn/data/grn/", 1)
grn.add_test_dataset("../../testing/grn/data/ngrn/", 0)
grn.build_test_dataset("../../testing/grn/bins/", "grn_test_dataset")
results = grn.classify("../../testing/grn/results/grn/", "../../testing/grn/results/ngrn/")
print(results[2][0]/results[2][1])
print(results[3])
#
paddy = Classifier(False)
paddy.add_model_dataset("../../training/paddy/data/paddy/", 1)
paddy.add_model_dataset("../../training/paddy/data/npaddy/", 0)
paddy.build_model_dataset("../../training/paddy/bins/", "paddy_dataset")
paddy.build_model("../../training/paddy/bins/", "model_paddy")
paddy.add_test_dataset("../../testing/paddy/data/paddy/", 1)
paddy.add_test_dataset("../../testing/paddy/data/npaddy/", 0)
paddy.build_test_dataset("../../testing/paddy/bins/", "paddy_test_dataset")
results = paddy.classify("../../testing/paddy/results/paddy/", "../../testing/paddy/results/npaddy/")
print(results[2][0]/results[2][1])
print(results[3])


Binary file added testing/chalky/data/chalky/p0.jpg
Binary file added testing/chalky/data/chalky/p1.jpg
Binary file added testing/chalky/data/chalky/p11.jpg
Binary file added testing/chalky/data/chalky/p13.jpg
Binary file added testing/chalky/data/chalky/p17.jpg
Binary file added testing/chalky/data/chalky/p18.jpg
Binary file added testing/chalky/data/chalky/p19.jpg
Binary file added testing/chalky/data/chalky/p2.jpg
Binary file added testing/chalky/data/chalky/p20.jpg
Binary file added testing/chalky/data/chalky/p4.jpg
Binary file added testing/chalky/data/chalky/p5.jpg
Binary file added testing/chalky/data/chalky/p7.jpg
Binary file added testing/chalky/data/chalky/p8.jpg
Binary file added testing/chalky/data/nchalky/0 (2).jpg
Binary file added testing/chalky/data/nchalky/0.jpg
Binary file added testing/chalky/data/nchalky/1 (2).jpg
Binary file added testing/chalky/data/nchalky/1.jpg
Binary file added testing/chalky/data/nchalky/10.jpg
Binary file added testing/chalky/data/nchalky/13.jpg
Binary file added testing/chalky/data/nchalky/14 (2).jpg
Binary file added testing/chalky/data/nchalky/14.jpg
Binary file added testing/chalky/data/nchalky/15.jpg
Binary file added testing/chalky/data/nchalky/16.jpg
Binary file added testing/chalky/data/nchalky/18.jpg
Binary file added testing/chalky/data/nchalky/19.jpg
Binary file added testing/chalky/data/nchalky/2.jpg
Binary file added testing/chalky/data/nchalky/21.jpg
Binary file added testing/chalky/data/nchalky/22.jpg
Binary file added testing/chalky/data/nchalky/23.jpg
Binary file added testing/chalky/data/nchalky/25.jpg
Binary file added testing/chalky/data/nchalky/26.jpg
Binary file added testing/chalky/data/nchalky/27 (2).jpg
Binary file added testing/chalky/data/nchalky/27.jpg
Binary file added testing/chalky/data/nchalky/3.jpg
Binary file added testing/chalky/data/nchalky/31.jpg
Binary file added testing/chalky/data/nchalky/4 (2).jpg
Binary file added testing/chalky/data/nchalky/4.jpg
Binary file added testing/chalky/data/nchalky/5.jpg
Binary file added testing/chalky/data/nchalky/7.jpg
Binary file added testing/chalky/data/nchalky/8.jpg
Binary file added testing/chalky/data/nchalky/9 (2).jpg
Binary file added testing/chalky/data/nchalky/9.jpg
Binary file added testing/chalky/data/nchalky/p12.jpg
Binary file added testing/chalky/data/nchalky/p14.jpg
Binary file added testing/chalky/data/nchalky/p15.jpg
Binary file added testing/chalky/data/nchalky/p16.jpg
Binary file added testing/chalky/data/nchalky/p21.jpg
Binary file added testing/chalky/data/nchalky/p6.jpg
Binary file added testing/chalky/data/nchalky/p65.jpg
Binary file added testing/chalky/data/nchalky/p66.jpg
Binary file added testing/chalky/data/nchalky/p67.jpg
Binary file added testing/chalky/data/nchalky/p68.jpg
Binary file added testing/chalky/data/nchalky/p69.jpg
Binary file added testing/chalky/data/nchalky/p71.jpg
Binary file added testing/chalky/data/nchalky/p72.jpg
Binary file added testing/chalky/data/nchalky/p73.jpg
Binary file added testing/chalky/data/nchalky/p74.jpg
Binary file added testing/chalky/data/nchalky/p75.jpg
Binary file added testing/chalky/data/nchalky/p76.jpg
Binary file added testing/chalky/data/nchalky/p77.jpg
Binary file added testing/chalky/data/nchalky/p78.jpg
Binary file added testing/chalky/data/nchalky/p79.jpg
Binary file added testing/chalky/data/nchalky/p9.jpg

0 comments on commit 7080af7

Please sign in to comment.