Giter VIP home page Giter VIP logo

mobile-recipe-generator's Introduction

Mobile-Recipe-Generator

An Android application to classify ingredients, then fetch recipes using the classification.

If the original classification is incorrect, the user has the option to select a class out of the Top-5 highest probability predictions.

GIF Demo

Project Structure

With there being multiple compontents of the app (the CNN being trained, the server used to host the CNN for classification, the Android app itself), I've tried to separate each into its own sub-directory:

Python Code - Contains the sub-directories Flask Server & PyTorch CNN Training, with the component's corresponding scripts.

MobileRecipeGenerator - Contains the Android Studio project, seen within the demo provided above.

Training the CNN

When training the neural network, I used the Fruits 360 dataset.

With the size of the dataset being so large, I decided to exclude it from the repository, but can be found here.

I also removed a large number of classes from the dataset (62 classes remain) as it contained objects not commonly seen in UK supermarkets - the class list can be seen under Python Code > FlaskServer > app.py > class_types.

Flask Server

The CNN is hosted on a server, where the android app calls an endpoint.

The main reasoning behind this was to reduce the overall size of the app, whilst increasing classification speed (by it being ran on a pc with better specs).

Running the Server

To run the server locally, simply start the app.py script.

Running the Android App

The android app has been tested on multiple emulators within Android Studio (multiple Android versions), as well as on a real device (Samsung Galaxy S9 Edge) - as seen above.

To connect to the server, the constant ** within Helper.java needs to be changed to the ipv4 address of the device running the Flask server (typing ipconfig in a cmd session).

Dependencies

Anaconda was used to install dependencies needed, the packages used are:

Python 3.9

  • torch
  • torchvision
  • Flask
  • numpy

mobile-recipe-generator's People

Contributors

bardiaalavi-2020 avatar lukeguest 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.