Giter Club home page Giter Club logo

iseefood's Introduction

Requirements Status

What Is This?

A python module to recognize the existence of food in images by using a trained AI - SFCA.

Dependencies

In order to run the iSeefood module, you need to install the following packages:

  • Numpy
  • Tensorflow
  • Pillow
  • Nose
  • Tornado
  • You can just run the following command to install all required packages:
$ pip install -r requirements.txt

How To Use This

  1. Download/ Clone the source code.

    NOTE: Make sure that you download all the saved_model data file (≈217MB).

    You can download the saved_model files:

    1. Manualy through the repository.

    2. By running the following command:

      $ git lfs pull
  2. Copy the iSeefood file to your project directory.

    Recommended file structure:

    yourProject/
    ├── iSeefood/
    │   ├── README.md
    │   ├── SeefoodAI.py
    │   ├── __init__.py
    │   ├── samples/
    │   └── saved_model/
    │       ├── checkpoint
    │       ├── model_epoch5.ckpt.data-00000-of-00001
    │       ├── model_epoch5.ckpt.index
    │       └── model_epoch5.ckpt.meta
    ├── __init__.py
    └── main.py
  3. Import the package to your main.py file.

      from iSeefood import SeefoodAI
  4. Instantiate a new object.

      example = SeefoodAI()
  5. Pass an image to be processed (.png and .jpg only).

      example.process('../image.png')
  6. Get the processing statistics.

      statistics = example.getScore()
  7. Evaluate the statistics.

      result = example.getResult(statistics)

Example

from iSeefood.SeefoodAI import SeefoodAI

example = SeefoodAI()
example.process("../cookies.png")
statistics = example.getScores()
result = example.getResult(statistics)
print  'Does the image contains food: ', result

Output

Does the image contains food:  True

⚠️ Notes

  • SeefoodAI class assumes that the saved_models are stored in the following path:

    yourWorkingDirectory/iSeefood/saved_model/
  • If you try to run your project from any location other than the project-base-path, the SeefoodAI class will not be able to find the saved_model directory!

  • If you would like to manipulate the directory location, you will have to update saved_models/ direcotry path inside the SeefoodAI.py class. The saved_models directory is specified inside the __setup() function.

    def __setup(self):
      ......
      saver = tf.train.import_meta_graph(
                'yourCustomizedPath/iSeefood/saved_model/model_epoch5.ckpt.meta')
      saver.restore(self.sess, tf.train.latest_checkpoint('yourCustomizedPath/iSeefood/saved_model/'))
      ......

📃 Documentation

Function Parameter Return value Description
process() image_path:String True/False:bool If the image has been processed, then True. Else, then False.
getScores() --- numpy.ndarray Returns the data of the last processed image.
getResult() scores:numpy.ndarray True/False:bool If there is food in the image, then True. Else, then False.

Built With

Versioning

We use Github for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see LICENSE for details.

Acknowledgments

  • Machine Learning and Complex Systems Lab at Wright State University - GitHub repo

iseefood's People

Contributors

ibrahimnm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

iseefood's Issues

Reformat the readme file.

A readme file content shall be clear for all readers.

  • Verify all dependancies with virtualenv
  • Mention all contributors.
  • Give an example of how to use it.

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.