GithubHelp home page GithubHelp logo

isabella232 / tensorflow-nata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudflare/tensorflow-nata

0.0 0.0 0.0 30.4 MB

Our model uses a convolutional neural network and TensorFlow to infer if an image is a Pastel de Nata or not. We trained it with thousands of Portuguese egg custard tart (Pasteis de Nata) images and other non related images to get the "Nata or Not" classifier.

License: MIT License

Jupyter Notebook 100.00%

tensorflow-nata's Introduction

Nata or Not Model

Our model uses a convolutional neural network and TensorFlow to infer if an image is a Pastel de Nata or not.

We took the Mobilenet V3 pre-trained network and trained a new layer on top of it with thousands of Portuguese egg custard tart (Pasteis de Nata) images and other non related images to get the "Nata or Not" classifier. The model was trained on a server with an NVIDIA A100 Tensor Core GPU. Check our Jupyter notebook for details and code, inspired by the "Retraining an Image Classifier" tutorial.

The dataset

To get a reasonable training dataset, we simply used as many Creative Commons images as possible from Google Images using the "pastel de nata" keywords. We also added a few of our own; the Lisbon Office is quite a fan of the famous pastry.

Finally, we also searched for non-egg tart images, the kind we think would be the most common for people to try out, like other foods, furniture, pets, people, and, of course, hotdogs.

How to build your own

Get your dataset and use the following folder structure to place the pastel and not-pastel images.

nata-model
│   notebooks
└───data
    |   pastel
    └───not-pastel

Setup your python environment using python 3.7.10:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Run the notebook:

cd notebooks
jupyter notebook

How to use ours

To perform an inference run this notebook notebooks/inference.ipynb. You can change the default image in the fpath variable.

Demo

We did a little live demo using this TensorFlow model using Cloudflare Workers and a Cloudflare server which has an NVIDIA A100 Tensor Core GPU in it.

Check our blog post for more information.

tensorflow-nata's People

Contributors

carlosefr avatar csazevedo avatar larcher 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.