Using just a single image of a meal, NutriPic employs computer vision and deep learning techniques to identify food types and generate nutrition information for the user.
This application was built using Node.js v20.12.2 and Python using following libraries, packages, and modules:
- Express - Local Server
- multer - Middleware
- sharp - Image Conversion
- node-fetch - Fetch API
- requests - Python HTTP
- python-dotenv - Python Environment Variables
You must have a well supported-version of Python (including pip) installed, and of course an up-to-date node.js with the included node-modules. When the project is installed, run node server.js to start a localhost server on port 3000.
You will need a LogMeal API User Token stored in a .env file (API_USER_TOKEN=) in the same "base" directory as server.js.
This program utilizes the LogMeal API to retrieve food recognition and nutritional informational data. The front-end is built with HTML/CSS/Javascript, with a functional back-end that primarily uses Node.js, Express.js, and Python. After running the express server, the webpages are hosted on the localhost:3000.
The user may click the upload file button to input an image of a meal (according to the LogMeal API requirements), this captures the data of the image, passes it to server.js where it is converted to a .jpg file. The file is then passed to the LogMeal API for recognition and nutritional information. This information is downloaded as a .json and is parsed out for the client-side Javascript to display in the HTML page.