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

Sigfox Forest Fire Detector
Intermediate
  • 2,454
  • 16

Full instructions

How to prevent forest from burning? A small Sigfox signal can prevent natural disasters. We will use an Arduino MKRFOX + a flame detector.

D Cage (Monitor and Control your Chicken Coop)
Intermediate
  • 13
  • 0

Control temperature, automatically fill the water and food tanks, and monitor the cage via web and Android.

Control the Injection of a Liquid
Intermediate
  • 311
  • 2

Protip

Control the injection of a liquid with GOBLIN 2 from anywhere via Ubidots platform.

How to build a text to speech IOT speaker
Intermediate
  • 146
  • 1

Full instructions

In this project we'll be building a speaker that has text to speech ability and will expose a secure API for remote control.

Otto DIY+ Arduino Bluetooth robot easy to 3dprint
Intermediate
  • 12,484
  • 59

Work in progress

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

C.H.I.P.py Ruxpin ʕ•ᴥ•ʔ
Intermediate
  • 48,654
  • 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!

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog