Skip to content

This code trains and deploys an object detection model using the TensorFlow Object Detection API. The model is trained to detect hotel items like a jug, cup, and flask.

License

Notifications You must be signed in to change notification settings

arunkarthik-periyaswamy/Tensorflow-hotel-object-detection

Repository files navigation

Advanced Object Detection for Hotel Items using TensorFlow

Python Logo TensorFlow Logo TFLite Logo

Abstract

Object detection is extensively applied in various domains such as vehicle detection, face recognition, autonomous driving, and pedestrian monitoring. TensorFlow's Object Detection API is a robust tool that empowers users to rapidly develop and deploy sophisticated image recognition applications. Object detection encompasses not only classifying and recognizing objects within an image but also localizing these objects and delineating them with bounding boxes. This project primarily focuses on configuring the environment and utilizing TensorFlow Lite (TFLite) models for detecting hotel items such as jugs, cups, and flasks. The TensorFlow Object Detection API has been leveraged for model training, specifically employing the Single Shot Multibox Detector (SSD) with MobileNet V2 architecture.

Usage

Training the Model

To train the object detection model, execute the following command:

python train.py

Deploying the Model

To deploy the trained model, execute the following command:

python deploy.py

Prerequisites

  • TensorFlow: A comprehensive open-source platform for machine learning.
  • TensorFlow Object Detection API: A library for training and deploying object detection models.

Installation

To install the TensorFlow Object Detection API, follow the instructions provided in the TensorFlow Object Detection API documentation.

Training Process

To train the model, a pipeline configuration file must be created. This file defines the model architecture, training parameters, and input/output configurations.

With the pipeline configuration file in place, initiate the training process using the train.py script. The script accepts the following parameters:

  • master: The TensorFlow master server name.
  • task: The task ID.
  • num_clones: Number of model replicas per worker.
  • clone_on_cpu: Deploy clones on CPU.
  • worker_replicas: Number of worker replicas.
  • ps_tasks: Number of parameter server tasks.
  • train_dir: Directory for saving checkpoints and training summaries.
  • pipeline_config_path: Path to the TrainEvalPipelineConfig configuration file.
  • train_config_path: Path to the TrainConfig configuration file.
  • input_config_path: Path to the InputReader configuration file.
  • model_config_path: Path to the DetectionModel configuration file.

Deployment Process

To deploy the model, use the deploy.py script with the following parameters:

  • model_path: Path to the trained model.
  • image_path: Path to the image for detection.
  • output_path: Path to save the output image with detected objects.

Example

Training the Model

python train.py

Deploying the Model

python deploy.py --model_path trained_model.pb --image_path image.jpg --output_path output.jpg

Hotel Object Detection Output

Hotel Object Detection Output

Troubleshooting

For any issues encountered during training or deployment, refer to the TensorFlow Object Detection API documentation.

Technologies Used

  • Python: Python
  • TensorFlow: TensorFlow
  • TensorFlow Object Detection API: TensorFlow
  • TensorFlow Lite (TFLite): TFLite
  • Single Shot Multibox Detector (SSD): SSD
  • MobileNet V2: MobileNet V2

This document provides a comprehensive guide to setting up, training, and deploying an object detection model using TensorFlow's Object Detection API. It includes all necessary steps and commands to ensure a smooth implementation of advanced object detection for specific hotel items.

About

This code trains and deploys an object detection model using the TensorFlow Object Detection API. The model is trained to detect hotel items like a jug, cup, and flask.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages