Coder Social home page Coder Social logo

teslakoile / nutri-scan Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 19.26 MB

NutriScan is a Discord bot that provides nutritional estimates for meals based on images you provide. It utilizes OpenAI's GPT-4 Vision model to analyze images of food and return a concise breakdown of their nutritional content.

Dockerfile 10.06% Python 89.94%
computer-vision discord discord-bot docker gpt-4 gpt-4-vision nutrition nutrition-services nutritional-data openai

nutri-scan's Introduction

NutriScan

NutriScan is a Discord bot that provides nutritional estimates for meals based on images you provide. It utilizes OpenAI's GPT-4 Vision model to analyze images of food and return a concise breakdown of their nutritional content.

Features

  • Analyzes images of meals and provides a nutritional estimate.
  • Supports various image formats (jpg, jpeg, png, gif, bmp).
  • Provides a concise breakdown of total calories, protein, fat, and fiber content.
  • Includes a 'Breakdown' of each major component of the meal.

How it works

This project consists of two main Python scripts: bot.py and vision_ai.py

bot.py

  • This script is responsible for the main functionality of the bot. It handles user interactions, processes user inputs, and generates appropriate responses. The bot uses various AI and machine learning techniques to understand and respond to user queries.

vision_ai.py

  • This script is responsible for image analysis. When provided with an image of a meal, it gives a concise nutritional estimate using midpoint values for ranges. The response includes total calories, protein, fat, and fiber content. It also provides a breakdown of each major component of the meal. If the image does not depict food, it responds with a message asking for an image of a meal.

Installation

Clone this repository to your local machine:

git clone https://github.com/yourusername/nutri-bot.git

Install the required Python packages:

pip install -r requirements.txt

Create a .env file in the project directory and add your Discord bot token and OpenAI API key:

DISCORD_BOT_TOKEN=your_discord_bot_token
OPENAI_API_KEY=your_openai_api_key

Run the bot:

python bot.py

Usage

To use NutriScan, simply mention it in a Discord chat and attach an image of a meal. NutriScan will analyze the image and provide a nutritional estimate in response.

@NutriScan

Salad

Credits

NutriScan uses OpenAI's GPT-4 Vision model for image analysis.

nutri-scan's People

Contributors

teslakoile avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.