项目作者: turdubars

项目描述 :
Food detector using YOLOv3 and custom ResNet-50 written in MXNet/Python
高级语言: Jupyter Notebook
项目地址: git://github.com/turdubars/food-detector.git
创建时间: 2020-06-04T10:00:56Z
项目社区:https://github.com/turdubars/food-detector

开源协议:MIT License

下载


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

  1. docker-compose up --build

And run shell in the container with

  1. docker-compose run food-detector bash

Pip

If you want to install with pip instead of Docker

  1. pip install -r requirements.txt

Usage

Basic usage with a local image file

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

For example:

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

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

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

  1. python food-detector.py --help