Skip to content

This repository contains all the necessary scripts to run a demo for the new TensorFlow 2 Object Detection API. I used this as part of my workshop in UP ACM Fest 2021: "AI Hackathon: Building Your First Prototype".

License

Notifications You must be signed in to change notification settings

abbyDC/tf2-object-detection-api-demo

Repository files navigation

Tensorflow 2 Object Detection API Demo

In this repository you can find some examples on how to use the Tensorflow OD API with Tensorflow 2. Referenced from Tensorflow Object Detection with Tensorflow 2 (Gilbert Tanner)

This TF2 OD example code was used for the demo in my talk, UP ACM Fest 2021 "AI Hackathon: Building Your First Prototype"

Accompanying slides can be found here: Google Slides Link

Recorded video can be viewed here (13:55 mark) Building AI Prototypes Workshop

I. Project Setup

  1. Creating python virtual env
$ python3 -m venv ~/venvs/[name_of_env]

e.g.
$ python3 -m venv ~/venvs/tf-od
  1. Activating python virtual env
$ source ~/venvs/[name_of_env]/bin/activate

e.g.
$ source ~/venvs/tf-od/bin/activate
  1. Install the project's requirements
$ pip3 install -r requirements.txt

II. Download Pre-trained Model

  1. Go to TF Object Detection Model Zoo

  2. Choose one of the models and download

  3. Extract the downloaded model

**For the example output, efficientdet_d2_coco17_tpu-32 was used

III. Video Inference

  1. Upload your video in the vids folder

  2. Run the following command but replace the parameters as needed

python3 detect_from_video.py --model=efficientdet_d2_coco17_tpu-32/ \
                                --video_path=vids/smarthome.mp4 \
                                --labelmap=mscoco_label_map.pbtxt
  1. Your video output should be inside the outputs folder

About

This repository contains all the necessary scripts to run a demo for the new TensorFlow 2 Object Detection API. I used this as part of my workshop in UP ACM Fest 2021: "AI Hackathon: Building Your First Prototype".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published