Things used in this project

Hardware components:
Pack pro mobile lgnchugrkz
Walabot
×1
Chip%20v1
C.H.I.P.
×1

Code

An image Classification example Python
Such an easy script can be used to classify images gathered by walabot.
import os
import numpy as np
from keras.models import Sequential
from keras.layers import Activation, Dropout, Flatten, Dense
from keras.preprocessing.image import ImageDataGenerator
from keras.layers import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras import optimizers

img_width, img_height = 150, 150

train_data_dir = 'data/train_small'
validation_data_dir = 'data/validation_small'


# loading the images in two groups: training and validation
datagen = ImageDataGenerator(
    rescale=1./255,
    shear_range=0.2,
    zoom_range=0.2,
    horizontal_flip=True)

train_generator = datagen.flow_from_directory(
    train_data_dir,
    target_size=(img_width, img_height),
    batch_size=32,
    class_mode='binary'
)

validation_generator = datagen.flow_from_directory(
    validation_data_dir,
    target_size=(img_width, img_height),
    batch_size=32,
    class_mode='binary'
)

# building the brain
model = Sequential()
model.add(Convolution2D(32, (3, 3), input_shape=(img_width, img_height, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))

model.add(Convolution2D(32, (3, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))

model.add(Convolution2D(64, (3, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))

model.add(Flatten())
model.add(Dense(64))
model.add(Activation('relu'))
model.add(Dropout(0.5))
model.add(Dense(1))
model.add(Activation('sigmoid'))

model.compile(loss='binary_crossentropy',
             optimizer='rmsprop',
             metrics=['accuracy'])

# training the model
nb_epoch = 30
nb_train_samples = 2048
nb_validation_samples = 832

model.fit_generator(
    train_generator,
    steps_per_epoch=nb_train_samples/32,
    epochs=nb_epoch,
    validation_steps=nb_validation_samples/32)

# validate the weights
model.evaluate_generator(validation_generator, nb_validation_samples)

Credits

69655715399db5fa781b35bde1984fdb
Enrico Colautti

Software developer, DIYer, scuba diver

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Third Eye for The Blind
Intermediate
  • 1,131
  • 14

Full instructions

An innovative wearable technology for visually impaired peoples.

Roomba Dashboard - A CLI Dashboard for iRobot Create 2
Intermediate
  • 199
  • 1

Roomba-Dash is a CLI dashboard for the iRobot Create 2 platform written in Golang. It is cross-platform compatible.

FAM
Intermediate
  • 1,373
  • 7

Work in progress

Super Secret Messaging with PocketCHIP!

C.H.I.P.py Ruxpin ʕ•ᴥ•ʔ
Intermediate
  • 47,392
  • 73

Full instructions

Bring Teddy Ruxpin back to life, but on your own terms! Make him say whatever you want, or have him search twitter to read tweets!

Otto DIY+
Intermediate
  • 8,128
  • 51

Work in progress

"Otto DIY with steroids" + Bluetooth + APP + switch + sensors + strength +...

Otto DIY+

Team Otto builders

Push for Pizza Using Proximus Public LoRaWAN Connectivity
Intermediate
  • 160
  • 0

A simple push button using Proximus public LPWAN connectivity. Optimized for power consumption (<30 microAmps) and long distance (>15km!).

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login