{"id":34640292,"url":"https://github.com/robu3/haikoo","last_synced_at":"2026-05-27T11:32:42.295Z","repository":{"id":43246299,"uuid":"206988030","full_name":"robu3/haikoo","owner":"robu3","description":"Haiku generator -- generates a haiku poem from an image!","archived":false,"fork":false,"pushed_at":"2022-12-08T06:08:35.000Z","size":6075,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T06:22:05.904Z","etag":null,"topics":["computer-vision","haiku","markov-chains"],"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/robu3.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}},"created_at":"2019-09-07T15:31:26.000Z","updated_at":"2023-01-06T16:08:08.000Z","dependencies_parsed_at":"2023-01-24T15:15:55.949Z","dependency_job_id":null,"html_url":"https://github.com/robu3/haikoo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robu3/haikoo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robu3%2Fhaikoo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robu3%2Fhaikoo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robu3%2Fhaikoo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robu3%2Fhaikoo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robu3","download_url":"https://codeload.github.com/robu3/haikoo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robu3%2Fhaikoo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33564838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["computer-vision","haiku","markov-chains"],"created_at":"2025-12-24T17:16:21.730Z","updated_at":"2026-05-27T11:32:42.276Z","avatar_url":"https://github.com/robu3.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# haikoo 🖋\n\n[日本語はこちら](#日本語版)\n\nHaikoo is a fun little haiku generator. It uses [Azure Congnitive Services](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/), Markov chains (leveraging [Markovify](https://github.com/jsvine/markovify)), and word syllable counts to create haiku from an image. The text is then overlaid on a cropped version of the original picture to create a consolidated image ready for social media.\n\nGiven an image like this:\n\n![Input](/sample_input.jpeg?raw=true)\n\nIt produces something like this:\n\n![Output](/sample_output.png?raw=true)\n\n## Basic Usage\n\nHaikoo can be used as module or as a command line utility.\n\nAs a module:\n\n```python\nfrom haikoo.haikoo import Haikoo, ImageDescriber\n\n# instantiate image describer and haikoo\n# the markov model can be: fusion (recommended), shakespeare, frost, or classic\ndescriber = ImageDescriber(\"azure_cv_key\", \"azure_cv_region\")\nhaikoo = Haikoo(describer, \"fusion\")\n\n# then create your haiku!\nhaiku = haikoo.create_image(file_path=args.image, out_file_path=args.out, text=args.text)\n```\n\nFrom the terminal:\n\n```\npython app.py /path/to/image.png\n```\n\nWhen using the terminal application, you will need to copy config.json.default to config.json and update the file with your Azure CV key and region before beginning.\nLet the programmatically generated poetry begin!\n\n## Technical Details\n\nHaikoo extends/subclasses a couple of Markovify's classes in order to create Markov chain models that also take syllable count into consideration when selecting words, i.e., `HaikuChain` and `HaikuText`. `HaikuChain` counts the number of syllables in a word when tokenizing text; the result can be serialized for reuse later, negating the need to count syllables at runtime (a performance win).\n\n## Advanced Usage\n\nThe Azure Computer Vision-based `ImageDescriber` can swapped out with another implementation by passing it into the constructor; see the `MockImageDescriber` for an example.\n\n```python\nfrom haikoo.haikoo import Haikoo, MyCustomImageDescriber\n\ndescriber = MyCustomImageDescriber()\nhaikoo = Haikoo(describer, \"fusion\")\n```\n\n# 日本語版\n# haikoo 🖋\n\n「Haikoo」というのは楽しい俳句ジェネレータです。[Azure Congnitive Services](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/)、 マルコフ連鎖 ([Markovify](https://github.com/jsvine/markovify)を生かして)、 と言葉の音節数を使って絵から俳句を作ります。その俳句は元の絵の上に重なって出来上がり、ソーシャルメディアにもピッタリ！\n\nこういう絵にすれば：\n\n![Input](/sample_input.jpeg?raw=true)\n\nこんなんが出て来る：\n\n![Output](/sample_output.png?raw=true)\n\n## 基本の使い方\n\n「Haikoo」はモジュールかコマンドライン・インタフェースとして使えます。\n\nモジュールとして：\n\n```python\nfrom haikoo.haikoo import Haikoo, ImageDescriber\n\n# instantiate image describer and haikoo\n# the markov model can be: fusion (recommended), shakespeare, frost, or classic\ndescriber = ImageDescriber(\"azure_cv_key\", \"azure_cv_region\")\nhaikoo = Haikoo(describer, \"fusion\")\n\n# then create your haiku!\nhaiku = haikoo.create_image(file_path=args.image, out_file_path=args.out, text=args.text)\n```\n\nCLIとして:\n\n```\npython app.py /path/to/image.png\n```\n\nコマンドライン・インタフェースを使う時は始める前に`config.json.default`を`config.json`にコピーして、Azureのキーと地域を更新しなければなりません。\n\nさぁ、俳句ジェネレータ開始！\n\n## 技術詳細 \n\n「Haikoo」は言葉の選ばれる時に音節数を考えるマルコフ連鎖を作るため、Markovifyのクラスを建て増します。例えば、`HaikuChain`と`HaikuText`。 `HaikuChain`はトークン化しながら音節数を数え、その結果はシリアライズする事も可能。ランタイムにしなくてもいいので性能アップ！\n\n## 高度な使い方\n\n「Azure Computer Vision」に基づいている`Image Describer`は他のインプリメンテーションをコンストラクタに入れて変えられます。例については`MockImageDescriber`を参照してください。\n\n```python\nfrom haikoo.haikoo import Haikoo, MyCustomImageDescriber\n\ndescriber = MyCustomImageDescriber()\nhaikoo = Haikoo(describer, \"fusion\")\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobu3%2Fhaikoo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobu3%2Fhaikoo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobu3%2Fhaikoo/lists"}