Skip to content

Food detector using YOLOv3 and custom ResNet-50 written in MXNet/Python

License

Notifications You must be signed in to change notification settings

turdubars/food-detector

Repository files navigation

Food Detector

Python 3.8 MXNet Docker MIT License

Food Detector Demo

A custom model to detect local food using two convolutional neural networks: YOLOv3 and ResNet-50.
YOLOv3 model was pretrained on COCO Dataset and ResNet-50 was pretrained on Imagenet and finetuned for the custom dataset of local food that was collected from Google Images with Python and Javascript. Model structure

Installation

Docker

If you don't want to deal with packages, install with Docker Compose

docker-compose up --build

And run shell in the container with

docker-compose run food-detector bash

Pip

If you want to install with pip instead of Docker

pip install -r requirements.txt

Usage

Basic usage with a local image file

python food-detector.py --file <path to image file>

For example:

python food-detector.py --file test_images/test0.jpg

To predict food in an image from internet use -u or --url flag

python food-detector.py --url <url of image>

Note that during the first run the application automatically will download YOLOv3 parameters

By default the application saves images in 'predictions' folder as 'prediction.jpg' file

There are other flags to print outputs (-p), to save predicted images (-w), to set a threshold (-t)
Run -h or --help to get the additional information

python food-detector.py --help

Releases

No releases published

Packages

No packages published

Languages