{"id":20763989,"url":"https://github.com/mylesagray/anpr-knative","last_synced_at":"2025-08-08T06:18:16.642Z","repository":{"id":39723014,"uuid":"377815323","full_name":"mylesagray/anpr-knative","owner":"mylesagray","description":"A research project on running ML inferencing on KNative","archived":false,"fork":false,"pushed_at":"2025-04-12T11:33:38.000Z","size":26901,"stargazers_count":18,"open_issues_count":19,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T07:53:01.952Z","etag":null,"topics":["anpr","knative","knative-eventing","knative-serving","tensorflow"],"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/mylesagray.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,"zenodo":null}},"created_at":"2021-06-17T12:00:44.000Z","updated_at":"2024-04-29T16:38:07.000Z","dependencies_parsed_at":"2023-01-25T12:00:41.887Z","dependency_job_id":"49e424af-9452-430a-85c4-1b19fd3a8ef5","html_url":"https://github.com/mylesagray/anpr-knative","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/mylesagray%2Fanpr-knative","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mylesagray%2Fanpr-knative/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mylesagray%2Fanpr-knative/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mylesagray%2Fanpr-knative/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mylesagray","download_url":"https://codeload.github.com/mylesagray/anpr-knative/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251666246,"owners_count":21624292,"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":["anpr","knative","knative-eventing","knative-serving","tensorflow"],"created_at":"2024-11-17T10:48:15.551Z","updated_at":"2025-04-30T07:53:28.101Z","avatar_url":"https://github.com/mylesagray.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automatic Number Plate Recognition based on Knative\n\nAn auto-scaling ML-based number plate recognition system, running on Knative.\n\n![Demo of app inferring a number plate](img/demo.gif)\n\nThis repo takes the Automatic Number Plate Recognition (ANPR) TensorFlow container detailed here: \u003chttps://github.com/mylesagray/docker-tensorflow-s3\u003e, packages the TensorFlow Python client built to interact with the model and adds a \"tensformation\" component to deploy an event-based auto-scaling ANPR system on Knative.\n\n## Overview\n\n![Architecture Overview](./img/overview.png)\n\nThis bridge starts with an event propagated by the s3 source.\n\nThis event is then consumed by `tensformation`, this service then performs the following actions:\n\n* Downloads the file.\n* Base64 encodes it.\n* Creates a request to the `Tensorflow Server`.\n* Returns an event containing the `Tensorflow Server` ANPR model's raw response.\n\nThe found plate event is then consumed by the `label_analyser`, this service then performs the following actions:\n\n* Performs the Tensorflow response analysis on the output from the model.\n* Updates the provided Google Sheet with the found plate info.\n* Returns an event back to the broker with the found plate.\n\n## Deploying the application\n\n### Prerequisites\n\n#### Google\n\nYou need to set up a Google Cloud Project and service user to use the Google Sheets output, please follow the following two sections of documentation:\n\n* \u003chttps://docs.triggermesh.io/targets/googlesheets/#google-api-credentials\u003e\n* \u003chttps://docs.triggermesh.io/targets/googlesheets/#googlesheets-sheet-id\u003e\n\nYou will need both the JSON key output and the Google Sheet ID for this app to run, additionally - don't forget to share the Google Sheet you want to use as the target for this app with the service account email address created above.\n\n#### Amazon\n\nYou will need to create an S3 bucket with public access enabled and get its ARN (take particular note in the below docs on where and how to add your region and account ID to the ARN provided by AWS):\n\n* \u003chttps://docs.triggermesh.io/sources/awss3/#amazon-resource-name-arn\u003e\n\nAdditionally, you will need to create or get your AWS Access Key and Secret:\n\n* \u003chttps://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey\u003e\n\n#### Knative and TriggerMesh\n\nIt is required to run Knative and the TriggerMesh sources for this demo, you can find details on how to do that below:\n\n* \u003chttps://docs.vmware.com/en/Cloud-Native-Runtimes-for-VMware-Tanzu/1.0/tanzu-cloud-native-runtimes-1-0/GUID-cnr-overview.html\u003e\n\nYou will need a Knative broker, we don't include one in the manifest as these are generally quite opinionated, so if you just want to get it up and running use the default broker:\n\n```sh\nkn broker create default\n```\n\nIf you list the brokers, you'll find the URL for the broker you just created - just plug this into `manifest.yaml` under `K_SINK`:\n\n```sh\n$ kn broker list\nNAME      URL                                                                        AGE     CONDITIONS   READY   REASON\ndefault   http://broker-ingress.knative-eventing.svc.cluster.local/default/default   7d22h   5 OK / 5     True    \n```\n\n### Deploy the app\n\n1: Update the `manifest.yaml` file, replacing the placeholder `\"\"` marks with your information.\n\n2: Deploy the app.\n\n```sh\nkubectl -n default apply -f manifest.yaml\n```\n\n## Running the app\n\nDrop an image of a car or vehicle with a US number plate into the S3 bucket targeted in the deployment above and watch the Google Sheet as a row containing the number plate, image URL and timestamp are populated.\n## Building the containers\n\n### Building `tensformation`\n\n1: Move to the `tensformation` directory.\n\n```sh\ncd tensformation\n```\n\n2: Create the go.mod file.\n\n```sh\ngo mod init tensformation\n```\n\n3: Build \u0026 submit the dockerfile.\n\n```sh\ndocker build . -t harbor-repo.vmware.com/vspheretmm/tensformation:latest -t tensformation:latest\ndocker push harbor-repo.vmware.com/vspheretmm/tensformation:latest\n\n## OR\n\ngcloud builds submit --tag gcr.io/\u003cproject\u003e/tensformation .\n```\n\n### Building `label_analyser`\n\n1: Move to the `label_analyser` directory.\n\n```sh\ncd label_analyser\n```\n\n2: Build \u0026 submit the dockerfile.\n\n```sh\ndocker build . -t harbor-repo.vmware.com/vspheretmm/tfclient:latest -t tfclient:latest\ndocker push harbor-repo.vmware.com/vspheretmm/tfclient:latest\n\n## OR\n\ngcloud builds submit --tag gcr.io/\u003cproject\u003e/tfclient .\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmylesagray%2Fanpr-knative","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmylesagray%2Fanpr-knative","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmylesagray%2Fanpr-knative/lists"}