-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#To run first unzip ../load_raw_image_data.zip into ../ | ||
# so the train and test directories reside in this directory | ||
|
||
from autokeras.image_supervised import load_image_dataset | ||
from keras.datasets import mnist | ||
from autokeras import ImageClassifier | ||
|
||
|
||
def load_images(): | ||
x_train, y_train = load_image_dataset(csv_file_path="train/label.csv", | ||
images_path="train") | ||
print(x_train.shape) | ||
print(y_train.shape) | ||
|
||
x_test, y_test = load_image_dataset(csv_file_path="test/label.csv", | ||
images_path="test") | ||
print(x_test.shape) | ||
print(y_test.shape) | ||
return x_train, y_train, x_test, y_test | ||
|
||
def run(): | ||
x_train, y_train, x_test, y_test = load_images() | ||
#After loading train and evaluate classifier. | ||
clf = ImageClassifier(verbose=True, augment=False) | ||
clf.fit(x_train, y_train, time_limit=12 * 60 * 60) | ||
clf.final_fit(x_train, y_train, x_test, y_test, retrain=True) | ||
y = clf.evaluate(x_test, y_test) | ||
print(y * 100) | ||
|
||
if __name__ == '__main__': | ||
run() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters