{"id":37100683,"url":"https://github.com/zquestz/pigeon","last_synced_at":"2026-01-14T12:15:21.777Z","repository":{"id":57569667,"uuid":"71070620","full_name":"zquestz/pigeon","owner":"zquestz","description":"Google Cloud Vision API on Golang.","archived":false,"fork":true,"pushed_at":"2016-11-06T01:59:42.000Z","size":1700,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-30T10:07:50.381Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://kaneshin.github.io/pigeon/","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"kaneshin/pigeon","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zquestz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-16T18:59:02.000Z","updated_at":"2023-10-26T13:49:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zquestz/pigeon","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zquestz/pigeon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zquestz%2Fpigeon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zquestz%2Fpigeon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zquestz%2Fpigeon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zquestz%2Fpigeon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zquestz","download_url":"https://codeload.github.com/zquestz/pigeon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zquestz%2Fpigeon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"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":[],"created_at":"2026-01-14T12:15:20.984Z","updated_at":"2026-01-14T12:15:21.756Z","avatar_url":"https://github.com/zquestz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pigeon - Google Cloud Vision API on Golang\n\n`pigeon` is a service for the Google Cloud Vision API on Golang.\n\n## Badges\n\n[![GoDoc](https://godoc.org/github.com/zquestz/pigeon?status.svg)](https://godoc.org/github.com/zquestz/pigeon)\n[![wercker status](https://app.wercker.com/status/265bd30a85f806655926be3ded5eff13/s \"wercker status\")](https://app.wercker.com/project/bykey/265bd30a85f806655926be3ded5eff13)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n[![Code Climate](https://codeclimate.com/github/zquestz/pigeon/badges/gpa.svg)](https://codeclimate.com/github/zquestz/pigeon)\n\n\n## Prerequisite\n\nYou need to export a service account json file to `GOOGLE_APPLICATION_CREDENTIALS` variable.\n\n```\n$ export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account.json\n```\n\n\n## Installation\n\n### `pigeon` and `pigeon-app` commands\n\n`pigeon` provides the command-line tools.\n\n```shell\n$ go get github.com/zquestz/pigeon/tools/cmd/...\n```\n\nMake sure that `pigeon` was installed correctly:\n\n```shell\n$ pigeon -h\n$ pigeon-app -h\n```\n\n### `pigeon` package\n\nType the following line to install `pigeon` package.\n\n```shell\n$ go get github.com/zquestz/pigeon\n```\n\n\n## Usage\n\n### `pigeon` command\n\n`pigeon` is available to submit request with external image source (i.e. Google Cloud Storage image location).\n\n```shell\n# Default Detection is LabelDetection.\n$ pigeon assets/lenna.jpg\n$ pigeon -face gs://bucket_name/lenna.jpg\n$ pigeon -label https://httpbin.org/image/jpeg\n```\n\n![pigeon-cmd](https://raw.githubusercontent.com/zquestz/pigeon/master/assets/pigeon-cmd.gif)\n\n\n### `pigeon-app` command\n\n```shell\n# Default port is 8080.\n# Default Detection is LabelDetection.\n$ pigeon-app\n$ pigeon-app -port=8000 -- -face -label -safe-search\n$ curl -XGET localhost:8080/\n```\n\n![pigeon-app](https://raw.githubusercontent.com/zquestz/pigeon/master/assets/pigeon-app.gif)\n\n\n### `pigeon` package\n\n```go\nimport \"github.com/zquestz/pigeon\"\nimport \"github.com/zquestz/pigeon/credentials\"\n\nfunc main() {\n\t// Initialize vision service by a credentials json.\n\tcreds := credentials.NewApplicationCredentials(\"credentials.json\")\n\n\t// creds will set a pointer of credentials object using env value of\n\t// \"GOOGLE_APPLICATION_CREDENTIALS\" if pass empty string to argument.\n\t// creds := credentials.NewApplicationCredentials(\"\")\n\n\tconfig := NewConfig().WithCredentials(creds)\n\n\tclient, err := pigeon.New(config)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// To call multiple image annotation requests.\n\tfeature := pigeon.NewFeature(pigeon.LabelDetection)\n\tbatch, err := client.NewBatchAnnotateImageRequest([]string{\"lenna.jpg\"}, feature)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Execute the \"vision.images.annotate\".\n\tres, err := client.ImagesService().Annotate(batch).Do()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Marshal annotations from responses\n\tbody, _ := json.MarshalIndent(res.Responses, \"\", \"  \")\n\tfmt.Println(string(body))\n}\n```\n\n#### pigeon.Client\n\nThe `pigeon.Client` is wrapper of the `vision.Service`.\n\n```go\n// Initialize vision client by a credentials json.\ncreds := credentials.NewApplicationCredentials(\"credentials.json\")\nclient, err := pigeon.New(creds)\nif err != nil {\n\tpanic(err)\n}\n```\n\n#### vision.Feature\n\n`vision.Feature` will be applied to `vision.AnnotateImageRequest`.\n\n```go\n// DetectionType returns a value of detection type.\nfunc DetectionType(d int) string {\n\tswitch d {\n\tcase TypeUnspecified:\n\t\treturn \"TYPE_UNSPECIFIED\"\n\tcase FaceDetection:\n\t\treturn \"FACE_DETECTION\"\n\tcase LandmarkDetection:\n\t\treturn \"LANDMARK_DETECTION\"\n\tcase LogoDetection:\n\t\treturn \"LOGO_DETECTION\"\n\tcase LabelDetection:\n\t\treturn \"LABEL_DETECTION\"\n\tcase TextDetection:\n\t\treturn \"TEXT_DETECTION\"\n\tcase SafeSearchDetection:\n\t\treturn \"SAFE_SEARCH_DETECTION\"\n\tcase ImageProperties:\n\t\treturn \"IMAGE_PROPERTIES\"\n\t}\n\treturn \"\"\n}\n\n// Choose detection types\nfeatures := []*vision.Feature{\n\tpigeon.NewFeature(pigeon.FaceDetection),\n\tpigeon.NewFeature(pigeon.LabelDetection),\n\tpigeon.NewFeature(pigeon.ImageProperties),\n}\n```\n\n#### vision.AnnotateImageRequest\n\n`vision.AnnotateImageRequest` needs to set the uri of the form `\"gs://bucket_name/foo.png\"` or byte content of image.\n\n- Google Cloud Storage\n\n```go\nsrc := \"gs://bucket_name/lenna.jpg\"\nreq, err := pigeon.NewAnnotateImageSourceRequest(src, features...)\nif err != nil {\n\tpanic(err)\n}\n```\n\n- Base64 Encoded String\n\n```go\nb, err := ioutil.ReadFile(filename)\nif err != nil {\n\tpanic(err)\n}\nreq, err = pigeon.NewAnnotateImageContentRequest(b, features...)\nif err != nil {\n\tpanic(err)\n}\n```\n\n#### Submit the request to the Google Cloud Vision API\n\n```go\n// To call multiple image annotation requests.\nbatch, err := client.NewBatchAnnotateImageRequest(list, features()...)\nif err != nil {\n\tpanic(err)\n}\n\n// Execute the \"vision.images.annotate\".\nres, err := client.ImagesService().Annotate(batch).Do()\nif err != nil {\n\tpanic(err)\n}\n```\n\n\n## Example\n\n### Pigeon\n\n![pigeon](https://raw.githubusercontent.com/zquestz/pigeon/master/assets/pigeon.png)\n\n#### input\n\n```shell\n$ pigeon -label assets/pigeon.png\n```\n\n#### output\n\n```json\n[\n  {\n    \"labelAnnotations\": [\n      {\n        \"description\": \"bird\",\n        \"mid\": \"/m/015p6\",\n        \"score\": 0.825656\n      },\n      {\n        \"description\": \"anatidae\",\n        \"mid\": \"/m/01c_0l\",\n        \"score\": 0.58264238\n      }\n    ]\n  }\n]\n```\n\n\n### Lenna\n\n![lenna](https://raw.githubusercontent.com/zquestz/pigeon/master/assets/lenna.jpg)\n\n#### input\n\n```shell\n$ pigeon -safe-search assets/lenna.jpg\n```\n\n#### output\n\n```json\n[\n  {\n    \"safeSearchAnnotation\": {\n      \"adult\": \"POSSIBLE\",\n      \"medical\": \"UNLIKELY\",\n      \"spoof\": \"VERY_UNLIKELY\",\n      \"violence\": \"VERY_UNLIKELY\"\n    }\n  }\n]\n```\n\n\n## License\n\n[The MIT License (MIT)](http://zquestz.mit-license.org/)\n\n\n## Author\n\nShintaro Kaneko \u003ckaneshin0120@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzquestz%2Fpigeon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzquestz%2Fpigeon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzquestz%2Fpigeon/lists"}