{"id":23894365,"url":"https://github.com/princep/legendary-octo-goggles","last_synced_at":"2026-05-06T19:07:21.417Z","repository":{"id":88666135,"uuid":"408012203","full_name":"PrinceP/legendary-octo-goggles","owner":"PrinceP","description":"AR app for counting","archived":false,"fork":false,"pushed_at":"2021-10-05T12:25:31.000Z","size":12041,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T14:26:48.566Z","etag":null,"topics":["android","artificial-intelligence","augmented-reality-applications","mediapipe","tensorflow"],"latest_commit_sha":null,"homepage":"https://princep.github.io/legendary-octo-goggles/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PrinceP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-09-19T02:21:38.000Z","updated_at":"2023-03-04T08:23:03.000Z","dependencies_parsed_at":"2023-03-13T18:19:41.205Z","dependency_job_id":null,"html_url":"https://github.com/PrinceP/legendary-octo-goggles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PrinceP/legendary-octo-goggles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinceP%2Flegendary-octo-goggles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinceP%2Flegendary-octo-goggles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinceP%2Flegendary-octo-goggles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinceP%2Flegendary-octo-goggles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrinceP","download_url":"https://codeload.github.com/PrinceP/legendary-octo-goggles/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinceP%2Flegendary-octo-goggles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32707874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["android","artificial-intelligence","augmented-reality-applications","mediapipe","tensorflow"],"created_at":"2025-01-04T14:57:15.895Z","updated_at":"2026-05-06T19:07:21.410Z","avatar_url":"https://github.com/PrinceP.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Princep/legendary-octo-goggles\"\u003e\n    \u003cimg src=\"images/logo.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003eCount them\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    AR application for counting stack of pipes\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/PrinceP/legendary-octo-goggles/demo.mov\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/PrinceP/legendary-octo-goggles/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/PrinceP/legendary-octo-goggles/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003e\u003ch2 style=\"display: inline-block\"\u003eTable of Contents\u003c/h2\u003e\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#design-solution\"\u003eDesign Solution\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#workflow\"\u003eWork Flow\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#template-development\"\u003eTemplate development\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#ai-model-development\"\u003eModel development\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#deployment\"\u003eDeployment\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#roadmap\"\u003eRoadmap\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#acknowledgements\"\u003eAcknowledgements\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\n\u003c!-- [[Demo]](./images/demo.gif) --\u003e\n#### Won 3rd Place in [Rally to Tally Hackathon](https://www.hackerearth.com/challenges/hackathon/mitsubishi-americas-hackathon/#overview)\n\n\u003cimg src=\"images/hackathon.png\" alt=\"Winner\"\u003e\n\n### **Design Solution**\n\n\u003cimg src=\"images/water_pipes_cover1.jpg\" alt=\"Demo\"\u003e\n\n\n*Given :*\n\n1. 1.66 - 48 inch in diameter\n2. 30-60 feet long\n3. Stacked in 3 - 20 layers depending on Outside Diameter size (but not higher than approx. 10Feet)\n4. More than 1 thousand pipes in 1 acre\n5. A tag and/or cap may be attached to the end of the tube\n6. In the case of large diameter pipes, the pipe stacks are often several hundred meters long and the distance between the stacks is often so narrow that it can be difficult to take a picture from the front.\n7. Since each pipe weighs up to several tons, it is difficult to calculate the number of pipes by weighing them all at once.\n\n*Actions :*\n\n1. Variable diameter is taken in solution for feature detection\n2. Side view will be not be the best view\n3. Stacks are not too high, so view will be landscape\n4. Manual collection of images is not possible\n5. Extra features need to be considered in solution\n6. Considered at 3.\n7. Weighing them is not considered.\n\n\n\n\u003cimg src=\"images/Architecture.png\" alt=\"Demo\"\u003e\n\n\n### **Workflow**\n\n1. Land vehicle bot to collect recordings of a particular stack in the field.\n2. Recording to done in one direction, only front of stack will be necessary.\n3. Only one stack of pipes should be taken for each recording. This ensures that the type of pipe is different for different templates.\n4. Take the key frames from each part of recording.(Where the pipe front is visible, we need to cover all possible types of covering on pipes here)\n5. Develop templates of each pipe: Circular region template - with tag or cap or normal.\n6. Identify each count of each image in the scene by putting a number on each template.\n7. For new recording if, the old templates can be used then the accuracy of model increases over time\n\nDeployment is made on an android app. Now we can just walk around the pipe field in a given direction and it will detect the stack with the given count. The idea is that we are given with list of detections in one direction, and the app should keep a track of detections.\n\nFinal count = Number of detections * Template count\n\n\n\n### **TEMPLATE DEVELOPMENT**\n\n\u003cimg src=\"images/Unknown.png\" alt=\"Demo\" width=\"850\" height=\"300\"\u003e\n\n1. Hough Circles are taken to identify pipe circular structure and templates are saved.\n\n2. Manual crops of pipe with tags and caps should taken by human in loop.\n\n3. Choose a template according to a part of image (very important)\n\n\n### **AI MODEL DEVELOPMENT**\n\n1. Use the templates to train a feature generation model\n\n2. Use the old database created from other videos, if type of pipes are same.\n\n2. Once trained, model is tested on validation data for more images\n\n3. If validation accuracy is good, then pass the model to deployment module\n\n\n### **DEPLOYMENT**\n\n1. Android app will be used\n2. The template used earlier will be detected multiple times in the view\n2. The app will keep a count of current view, and keep adding it as the phone moves in a single direction\n3. Use of the app in the land robot in future for more ease of use. \n\n\n\n\u003cimg src=\"images/demo.gif\" alt=\"Demo\" width=\"600\" height=\"250\"\u003e\n\n\n### Built With\n\n* mediapipe\n* Colab\n\n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\nTo get a local copy up and running follow these simple steps.\n\n### Prerequisites\n\n* mediapipe\n* Colab\n\n### Installation\n\n1. Clone the repo\n   ```sh\n   git clone https://github.com/Princep/legendary-octo-goggles.git\n   ```\n2. Develop the template\n\n\n[Colab](Count_them_up.ipynb) offers customizable solutions for images.\n\n![Auto.png](images/autocrop.png)                                                               | ![Result.png](images/Unknown.png)\n:------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------:\n***OpenCV***: *Built-in fast Hough transform inference for processing. Modify radius for size* | ***Result***: *Each circle is properly detected, Easy front view can be taken*\n![manual.png](images/manualcrop.png)                                                             | ![Result.png](images/Unknown1.png)\n***Manual***: *Select a area which seems to be repeatable area*            | ***Area count = 4***: *Can be an area which contains tags or atleast 3 pipes*\n\n\n\n3. Save the template image with the decided count\n\n\n4. Matching Your Own Template Images\n\n*  Put all template images in a single directory called templates\n\n![Folder.png](images/folder.png)\n\n*  To build the index file for all templates in the directory, run\n\n    ```bash\n    bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 \\\n    mediapipe/examples/desktop/template_matching:template_matching_tflite\n    ```\n\n    ```bash\n    bazel-bin/mediapipe/examples/desktop/template_matching/template_matching_tflite \\\n    --calculator_graph_config_file=mediapipe/graphs/template_matching/index_building.pbtxt \\\n    --input_side_packets=\"file_directory=\u003ctemplate image directory\u003e,file_suffix=png,output_index_filename=\u003coutput index filename\u003e\"\n    ```\n\n    The output index file includes the extracted KNIFT features.\n\n\n5. Use mediapipe\n\n\n*   Replace\n    [mediapipe/models/knift_index.pb](https://github.com/google/mediapipe/tree/master/mediapipe/models/knift_index.pb)\n    with the index file you generated, and update\n    [mediapipe/models/knift_labelmap.txt](https://github.com/google/mediapipe/tree/master/mediapipe/models/knift_labelmap.txt)\n    with your own template names with count for the tempate.\n\n\n```bash\ncd mediapipe\n# Switch to OpenCV 4\nsed -i -e 's:3.4.3/opencv-3.4.3:4.0.1/opencv-4.0.1:g' WORKSPACE\nsed -i -e 's:libopencv_java3:libopencv_java4:g' third_party/opencv_android.BUILD\n\n# Build and install app\nbazel build -c opt --config=android_arm64 mediapipe/examples/android/src/java/com/google/mediapipe/apps/templatematchingcpu\nadb install -r bazel-bin/mediapipe/examples/android/src/java/com/google/mediapipe/apps/templatematchingcpu/templatematchingcpu.apk\n```   \n\n*   Build and run the app\n\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\n* Install the [apk](https://he-s3.s3.ap-southeast-1.amazonaws.com/media/sprint/mitsubishi-americas-hackathon/team/1217605/1f918b4templatematchingcpu.apk)\n* Point it at the site\n\n\n\u003c!-- ROADMAP --\u003e\n## Roadmap\n\nSee the [open issues](https://github.com/Princep/legendary-octo-goggles/issues) for a list of proposed features (and known issues).\n\n\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nYour Name - [@pp_spector](https://twitter.com/pp_spector) - prince.patel.14@gmail.com\n\nProject Link: [https://github.com/Princep/legendary-octo-goggles](https://github.com/Princep/legendary-octo-goggles)\n\n\n\n\u003c!-- ACKNOWLEDGEMENTS --\u003e\n## Acknowledgements\n\n* [mediapipe](https://github.com/google/mediapipe)\n\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/Princep/repo.svg?style=for-the-badge\n[contributors-url]: https://github.com/Princep/legendary-octo-goggles/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/Princep/repo.svg?style=for-the-badge\n[forks-url]: https://github.com/Princep/legendary-octo-goggles/network/members\n[stars-shield]: https://img.shields.io/github/stars/Princep/repo.svg?style=for-the-badge\n[stars-url]: https://github.com/Princep/legendary-octo-goggles/stargazers\n[issues-shield]: https://img.shields.io/github/issues/Princep/repo.svg?style=for-the-badge\n[issues-url]: https://github.com/Princep/legendary-octo-goggles/issues\n[license-shield]: https://img.shields.io/github/license/Princep/repo.svg?style=for-the-badge\n[license-url]: https://github.com/PrinceP/legendary-octo-goggles/blob/main/LICENSE\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://linkedin.com/in/princecv","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincep%2Flegendary-octo-goggles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprincep%2Flegendary-octo-goggles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincep%2Flegendary-octo-goggles/lists"}