Skip to content

MatthieuHanania/Computer-vision-website-for-plastic-detection

Repository files navigation

Plastic Detection Projects

Matthieu Hanaania

Overview

This project is a django website associated with a object detection deep learning model.

Part 0. Installation

Install tensorflow pip install tensorflow==2.14.0
Download the tensorflow github from git clone --depth 1 https://github.com/tensorflow/models copy the setup.py file from models/research/object_detection/packages/tf2/setup.py to models/research/ In the list of required packages, add 'PyYAML==5.3.1', and then execute python -m pip install .

Then install django pip install Django

Part 1. The Deep Learning Model

Dowloading_a_model_whithout_retrain.ipynb

For this project, I use an existing and already trained model. (ssd_mobilenet_v2_320x320_coco17_tpu-8 )

The model is saved as a folder with the weight details and the :configuration file.

It has been train of the coco dataset : a large dataset with 90+ categories.

By loading the model, it is possible to send it an image, and it will detect different objects, based on the categories it has been trained on. It will frame the detected objects with boxes and attribute each boxe with an index. By knowing that the bottles are the 44th index. We can keep only the boxes associated with this index.

With the object_detection.utils library it is possible to put boxes on the image, and save it with the cv2.imrite function

Part 2. The Django Website

Globlal overwiew

The Django architecture is firstly composed of a projet "Website" with its configuration files in the "mysite" folder. Most of the content is automatically. in the "urls" file, we define all the urls link of the application.

It is in the "plasticDetection" application that we develop the plastic-detection website.

The website is divided in 2 pages. The image submission for AI plastic detection, and the global map page

Everything is based on views in the "views.py" file. It define all the functions that can interact with the HTML website. The "urls.py" file redirect every path to a view.

Moreover, Django contains a sql database, defined in the "models.py file"

The execution

To run the website, execute the command py Website\manage.py runserver

and then go to the link http://127.0.0.1:8000/plastic-detection/

The Django architecture is divited into website

The object detection

This page calls the model, that detect plastic bottle in the user-submitted picture.

You can submit an image, and call the AI model. That will frame some plastic waste in the picture.

If an image contains geographical information ( longitute and latitude ) they will be print on the web page

submission

The database page

When an image is submitted, its position is stored in a sql database that is displayed in this page.

Global Map

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published