{"id":20284943,"url":"https://github.com/chayanforyou/shape_detection","last_synced_at":"2026-05-10T13:03:04.138Z","repository":{"id":97438020,"uuid":"211635946","full_name":"chayanforyou/shape_detection","owner":"chayanforyou","description":"Shape detection with tensorflow lite","archived":false,"fork":false,"pushed_at":"2019-09-29T09:12:14.000Z","size":612,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-14T08:11:31.476Z","etag":null,"topics":["detection","models","shape","tensorflow","tflite"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chayanforyou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-29T09:11:33.000Z","updated_at":"2022-11-10T04:31:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"19e48edb-9b44-43fa-b41b-62a799051fc0","html_url":"https://github.com/chayanforyou/shape_detection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chayanforyou%2Fshape_detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chayanforyou%2Fshape_detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chayanforyou%2Fshape_detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chayanforyou%2Fshape_detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chayanforyou","download_url":"https://codeload.github.com/chayanforyou/shape_detection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241780465,"owners_count":20019058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["detection","models","shape","tensorflow","tflite"],"created_at":"2024-11-14T14:23:07.642Z","updated_at":"2026-05-10T13:02:59.080Z","avatar_url":"https://github.com/chayanforyou.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [How to train an object detection model\n\n## How to Run\n\nEasy way: run [this Colab Notebook](https://colab.research.google.com/github/Tony607/object_detection_demo/blob/master/tensorflow_object_detection_training_colab.ipynb).\n\nAlternatively, if you want to use your images instead of ones comes with this repo.\n\nRequire [Python 3.5+](https://www.python.org/ftp/python/3.6.4/python-3.6.4.exe) installed.\n### Fork and clone this repository to your local machine.\n```\nhttps://github.com/Tony607/object_detection_demo\n```\n### Install required libraries\n`pip3 install -r requirements.txt`\n\n\n### Step 1: Annotate some images\n- Save some photos with your custom object(s), ideally with `jpg` extension to `./data/raw` directory. (If your objects are simple like ones come with this repo, 20 images can be enough.)\n- Resize those photo to uniformed size. e.g. `(800, 600)` with\n```\npython resize_images.py --raw-dir ./data/raw --save-dir ./data/images --ext jpg --target-size \"(800, 600)\"\n```\nResized images locate in `./data/images/`\n- Train/test split those files into two directories, `./data/images/train` and `./data/images/test`\n\n- Annotate resized images with [labelImg](https://tzutalin.github.io/labelImg/), generate `xml` files inside `./data/images/train` and `./data/images/test` folders. \n\n*Tips: use shortcuts (`w`: draw box, `d`: next file, `a`: previous file, etc.) to accelerate the annotation.*\n\n- Commit and push your annotated images and xml files (`./data/images/train` and `./data/images/test`) to your forked repository.\n\n\n### Step 2: Open [Colab notebook](https://colab.research.google.com/github/Tony607/object_detection_demo/blob/master/tensorflow_object_detection_training_colab.ipynb)\n- Replace the repository's url to yours and run it.\n\n\n## How to run inference on frozen TensorFlow graph\n\nRequirements:\n- `frozen_inference_graph.pb` Frozen TensorFlow object detection model downloaded from Colab after training. \n- `label_map.pbtxt` File used to map correct name for predicted class index downloaded from Colab after training.\n\n## How to deploy the trained custom object detection model with OpenVINO\n\nRequirements:\n- Frozen TensorFlow object detection model. i.e. `frozen_inference_graph.pb` downloaded from Colab after training.\n- The modified pipeline config file used for training. Also downloaded from Colab after training.\n\nRun the following Jupyter notebook locally and follow the instructions in side.\n```\ndeploy/openvino_convert_tf_object_detection.ipynb\n```\n## Run the benchmark\n\nExamples\n\nBenchmark SSD mobileNet V2 on GPU with FP16 quantized weights.\n```\ncd ./deploy\npython openvino_inference_benchmark.py\\\n     --model-dir ./models/ssd_mobilenet_v2_custom_trained/FP16\\\n     --device GPU\\\n     --data-type FP16\\\n     --img ../test/15.jpg\n```\nTensorFlow benchmark on cpu\n```\npython local_inference_test.py\\\n     --model ./models/frozen_inference_graph.pb\\\n     --img ./test/15.jpg\\\n     --cpu\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchayanforyou%2Fshape_detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchayanforyou%2Fshape_detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchayanforyou%2Fshape_detection/lists"}