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
Guide: | |
1. Install Armbian_5.24.161216_Orangepizero_Ubuntu_xenial_3.4.113.img onto a uSD card using Win32DiskImager or Ubuntu Disk Image Writer | |
2. (Optional) Mount the uSD in Ubuntu Laptop and expand the partition using GParted. | |
3. Delete everything from uSD except /boot, /lib/modules and /lib/firmware. | |
4. Mount openwrt-15.05.1-sunxi-root.ext4 on Ubuntu using loopback interface on /mnt/openwrt |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
import os | |
from pathlib import Path | |
import keras | |
from keras.preprocessing.image import ImageDataGenerator | |
from keras.applications import ResNet50 | |
from keras.applications.resnet50 import preprocess_input |
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
conv_base = ResNet50(include_top=False, | |
weights='imagenet', | |
input_shape=(224, 224, 3)) | |
for layer in conv_base.layers: | |
layer.trainable = False | |
x = conv_base.output | |
x = layers.GlobalAveragePooling2D()(x) | |
x = layers.Dense(512, activation='relu')(x) | |
x = layers.Dense(256, activation='softmax')(x) | |
predictions = layers.Dense(2, activation='softmax')(x) |
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
history = model.fit_generator( | |
generator=train_generator, | |
epochs=15, | |
validation_data=validation_generator, | |
steps_per_epoch=40, | |
validation_steps=20) | |
plt.plot(history.history['acc']) | |
plt.plot(history.history['val_acc']) | |
plt.title('Model doğruluğu') |
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
Epoch 1/15 40/40 - 43s 1s/step - loss: 0.6341 - acc: 0.8280 - val_loss: 0.6007 - val_acc: 0.9412 | |
Epoch 2/15 40/40 - 29s 716ms/step - loss: 0.5988 - acc: 0.9592 - val_loss: 0.5942 - val_acc: 0.9542 | |
Epoch 3/15 40/40 - 30s 741ms/step - loss: 0.5888 - acc: 0.9830 - val_loss: 0.5916 - val_acc: 0.9412 | |
Epoch 4/15 40/40 - 30s 744ms/step - loss: 0.5843 - acc: 0.9800 - val_loss: 0.5878 - val_acc: 0.9542 | |
Epoch 5/15 40/40 - 30s 741ms/step - loss: 0.5793 - acc: 0.9902 - val_loss: 0.5842 - val_acc: 0.9477 | |
Epoch 6/15 40/40 - 30s 742ms/step - loss: 0.5745 - acc: 0.9913 - val_loss: 0.5821 - val_acc: 0.9477 | |
Epoch 7/15 40/40 - 30s 742ms/step - loss: 0.5691 - acc: 0.9961 - val_loss: 0.5786 - val_acc: 0.9477 | |
Epoch 8/15 40/40 - 30s 743ms/step - loss: 0.5673 - acc: 0.9889 - val_loss: 0.5750 - val_acc: 0.9542 | |
Epoch 9/15 40/40 - 30s 739ms/step - loss: 0.5626 - acc: 0.9937 - val_loss: 0.5712 - val_acc: 0.9608 | |
Epoch 10/15 40/40 - 30s 742ms/step - loss: 0.5581 - acc: 0.9961 - val_loss: 0.5685 - val_acc: 0.9477 |