Giter VIP home page Giter VIP logo

deep-shrooms's Introduction

deep-shrooms

Project for the Helsinki University course Introduction to Data Science

frontend backend

Project website

here

To edit the content of the site, edit docs/index.Rmd markdown. Then ping Tuomo or use RStudio/knitr to update the .html.

Scraper

To run the scraper to scrape the mushroom details and pictures from MushroomWorld you have to first install scrapy: pip install scrapy

Then go the to folder: cd shroom_scrapers/

And enter: scrapy crawl mw_scraper

NOTE:

The images have been already downloaded and are downloaded inside the Jupyter notebook.

Loading the trained model

Below is an example on how to load the keras model from a json file and then attach the trained weights to it.

from keras.models import model_from_json

json_file = open('models/model.json', 'r')
loaded_model_json = json_file.read()
json_file.close()
loaded_model = model_from_json(loaded_model_json)
loaded_model.load_weights("models/weights.h5")

Predicting

Note that the model expects inputs as 4d arrays: (None, 480, 480, 3). If you want to predict the probability of edibility of a single mushroom, pass the image to the model as a (1, 480, 480, 3) array. Also note that the model has been trained using images where the pixes values have been rescaled to value between 0 and 1. The model expects that all inputs are rescaled by a division by 255.

x = X_imgs[0]               # X_imgs contains images as (N, 480, 480, 3) array
x.shape = (1, ) + x.shape   # reshape x to (1, 480, 480, 3)
x = x / 255.0               # rescale

loaded_model.predict(x).round(3)
# array([[ 0.32712618]], dtype=float32)

deep-shrooms's People

Contributors

tuomonieminen avatar teemukoivisto avatar jonharju avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.