From 2eb83a3d0244d6c8e08a089584de0a47c27ba703 Mon Sep 17 00:00:00 2001 From: Kamila Bobkowska Date: Sun, 24 May 2020 14:17:49 +0000 Subject: [PATCH] touch up --- Report_Klaudia_Przybylska.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Report_Klaudia_Przybylska.md b/Report_Klaudia_Przybylska.md index d5a3dfb..94c9c77 100644 --- a/Report_Klaudia_Przybylska.md +++ b/Report_Klaudia_Przybylska.md @@ -57,21 +57,29 @@ trainingFileNames, testFileNames = np.split(np.array(allFileNames), [int(len(all ## Implementation Functions in garbageDumpSorting.py: * createSets - divides images between test and training set. This function should be run only once, unless the folders with training and test set are removed, + ``` trainingFileNames, testFileNames = np.split(np.array(allFileNames), [int(len(allFileNames) * (1 - testRatio))]) ``` + * huMoments, haralick, histogram - calculate global feature descriptors, * processTrainData, processTestData - both work in the same way, they iterate over files in train or test directory, saves features as a matrix and then saves results to h5 file, it is recommended to run it only once as it takes some time to finish. + ``` allFeatures = np.hstack([histo, hara, huMoments]) + ``` * trainAndTest - creates classifier, trains it and scores it, + ``` clf = RandomForestClassifier(n_estimators=100, max_depth=15, random_state=9) ``` + * classifyImage - predicts what kind of garbage is visible on a single image, + ``` prediction = clf.predict(features)[0] + ``` * sortDump - checks what kinds of trash are inside the garbage truck and their quantity, empties the garbage truck and sorts its contents on the garbage dump.