{"id":15654356,"url":"https://github.com/philipperemy/vision-api","last_synced_at":"2025-04-30T22:50:09.642Z","repository":{"id":70249882,"uuid":"149221839","full_name":"philipperemy/vision-api","owner":"philipperemy","description":"Google Vision API made easy!","archived":false,"fork":false,"pushed_at":"2021-02-10T01:56:36.000Z","size":294,"stargazers_count":31,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-30T22:50:02.342Z","etag":null,"topics":["api","google","vision"],"latest_commit_sha":null,"homepage":null,"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/philipperemy.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":"2018-09-18T03:13:09.000Z","updated_at":"2025-02-27T15:44:05.000Z","dependencies_parsed_at":"2023-02-27T02:15:53.671Z","dependency_job_id":null,"html_url":"https://github.com/philipperemy/vision-api","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/philipperemy%2Fvision-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fvision-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fvision-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fvision-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philipperemy","download_url":"https://codeload.github.com/philipperemy/vision-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251795387,"owners_count":21645019,"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":["api","google","vision"],"created_at":"2024-10-03T12:51:07.083Z","updated_at":"2025-04-30T22:50:09.617Z","avatar_url":"https://github.com/philipperemy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Vision API\n*Made easy! Cloud Vision API enables developers to understand the content of an image by encapsulating powerful machine learning models in an easy-to-use REST API. It quickly classifies images into thousands of categories (such as, “sailboat”), detects individual objects and faces within images, and reads printed words contained within images.*\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://cdn.iphoneincanada.ca/wp-content/uploads/2019/06/vnanimaldetector.jpg\" width=\"400\"\u003e\n\u003c/p\u003e\n\n## Get started in 2 min!\n\n### Get the API key\n\n- Browse here: [https://cloud.google.com/vision/](https://cloud.google.com/vision/)\n- Create a Google account. You might be lucky and get $300 of free usage.\n- Activate the Vision API with the free trial.\n- Browse here: [https://console.cloud.google.com/apis/credentials](https://console.cloud.google.com/apis/credentials)\n- Go to credentials tab and create a new one (cf. screenshot below). **Create Credentials \u003e API Key**.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/vision_1.png\" width=\"400\"\u003e\n\u003c/p\u003e\n\n\n### Run those commands to install the lib\n\n```bash\ngit clone git@github.com:philipperemy/vision-api.git \u0026\u0026 cd vision-api\nvirtualenv -p python3 venv\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\n## Inference\n\nLet's run one inference on a cat's picture:\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/cat.jpg\" width=\"300\"\u003e\n\u003c/p\u003e\n\n### Command\n\n```\nexport GOOGLE_API_KEY=\u003cAPI_KEY\u003e; python vision.py images/cat.jpg\n```\n\n### Output\n\nYou should get something like:\n\n\u003cdetails\u003e\n \u003csummary\u003eShow details\u003c/summary\u003e\n\n```\n{\n    \"responses\": [\n        {\n            \"labelAnnotations\": [\n                {\n                    \"mid\": \"/m/01yrx\",\n                    \"description\": \"cat\",\n                    \"score\": 0.99459696,\n                    \"topicality\": 0.99459696\n                },\n                {\n                    \"mid\": \"/m/01l7qd\",\n                    \"description\": \"whiskers\",\n                    \"score\": 0.9477582,\n                    \"topicality\": 0.9477582\n                },\n                {\n                    \"mid\": \"/m/04rky\",\n                    \"description\": \"mammal\",\n                    \"score\": 0.92298394,\n                    \"topicality\": 0.92298394\n                },\n                {\n                    \"mid\": \"/m/07k6w8\",\n                    \"description\": \"small to medium sized cats\",\n                    \"score\": 0.9217613,\n                    \"topicality\": 0.9217613\n                },\n                {\n                    \"mid\": \"/m/0307l\",\n                    \"description\": \"cat like mammal\",\n                    \"score\": 0.89394915,\n                    \"topicality\": 0.89394915\n                },\n                {\n                    \"mid\": \"/m/035qhg\",\n                    \"description\": \"fauna\",\n                    \"score\": 0.89245945,\n                    \"topicality\": 0.89245945\n                },\n                {\n                    \"mid\": \"/m/012c9l\",\n                    \"description\": \"domestic short haired cat\",\n                    \"score\": 0.777281,\n                    \"topicality\": 0.777281\n                },\n                {\n                    \"mid\": \"/m/014sv8\",\n                    \"description\": \"eye\",\n                    \"score\": 0.7664183,\n                    \"topicality\": 0.7664183\n                },\n                {\n                    \"mid\": \"/m/05mqq3\",\n                    \"description\": \"snout\",\n                    \"score\": 0.741837,\n                    \"topicality\": 0.741837\n                },\n                {\n                    \"mid\": \"/m/0cnmr\",\n                    \"description\": \"fur\",\n                    \"score\": 0.6560444,\n                    \"topicality\": 0.6560444\n                }\n            ],\n            \"safeSearchAnnotation\": {\n                \"adult\": \"VERY_UNLIKELY\",\n                \"spoof\": \"UNLIKELY\",\n                \"medical\": \"VERY_UNLIKELY\",\n                \"violence\": \"VERY_UNLIKELY\",\n                \"racy\": \"VERY_UNLIKELY\"\n            }\n        }\n    ]\n}\n```\n\u003c/details\u003e\n\n\n## Server mode\n\nStart the server by running this command in a terminal tab:\n\n```bash\nexport GOOGLE_API_KEY=\u003cAPI_KEY\u003e; python vision_server.py\n```\n\nIn another tab, run this command to query the server:\n\n```bash\npython query.py images/cat.jpg 0.0.0.0\n```\n\nThe first argument is the image. The second argument is the server IP. If you run everything locally, then it's 0.0.0.0. \n\nYou can also host the server on Amazon AWS. In that case, you will have to change the IP to the one Amazon gives you.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipperemy%2Fvision-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilipperemy%2Fvision-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipperemy%2Fvision-api/lists"}