{"id":17573783,"url":"https://github.com/zxdong262/tf-captcha-reader","last_synced_at":"2025-04-28T13:22:36.624Z","repository":{"id":69414858,"uuid":"141967809","full_name":"zxdong262/tf-captcha-reader","owner":"zxdong262","description":"Read captcha image with TensorFlow","archived":false,"fork":false,"pushed_at":"2018-11-19T09:12:23.000Z","size":21,"stargazers_count":7,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T02:07:11.532Z","etag":null,"topics":["captcha","demo","image","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","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/zxdong262.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":"2018-07-23T05:55:58.000Z","updated_at":"2022-06-14T00:13:37.000Z","dependencies_parsed_at":"2023-07-09T22:45:18.833Z","dependency_job_id":null,"html_url":"https://github.com/zxdong262/tf-captcha-reader","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/zxdong262%2Ftf-captcha-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxdong262%2Ftf-captcha-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxdong262%2Ftf-captcha-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxdong262%2Ftf-captcha-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zxdong262","download_url":"https://codeload.github.com/zxdong262/tf-captcha-reader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242487509,"owners_count":20136651,"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":["captcha","demo","image","tensorflow"],"created_at":"2024-10-21T21:04:47.543Z","updated_at":"2025-03-08T01:31:46.334Z","avatar_url":"https://github.com/zxdong262.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# tf-captcha-reader\n\nRead captcha image with TensorFlow. [Tutorial](https://html5beta.com/page/tutorial-reading-captcha-with-tensorflow.html)\n\n## Work flow\n\nImage generated:(4 or 5 random en char or digit, multi-color, random roate 0 ~ 4 degree)\n\n![example-captcha.png](example-images/example-captcha.png)\n\nMake it binary:\n\n![example-binary.png](example-images/example-binary.png)\n\nGet shapes with opencv.findContours:\n\n![example-findContours.png](example-images/example-findContours.png)\n\nSplit it:\n![example-split-0.png](example-images/example-split-0.png)\n![example-split-1.png](example-images/example-split-1.png)\n![example-split-2.png](example-images/example-split-2.png)\n![example-split-3.png](example-images/example-split-3.png)\n\nThen feed to tensorflow.keras\n\nResult:\n```bash\n# (trainData, trainLabels) = createData(8000)\n# (testData, testLabels) = createData(2000)\n\nEpoch 25/25\n36029/36029 [==============================] - 2s 54us/step - loss: 0.0752 - acc: 0.9669\n8970/8970 [==============================] - 0s 29us/step\nevaluate test data set:\ntest_loss: 0.28423821404674937\ntest_acc: 0.9385730211817168\npredict example-image(example-images/example-captcha.png):\n['l', '8', 'V', 'T']\n```\n\nIt can be improved by add more train data or add more epochs.\n\n## Run\n```bash\n\n# install Helper libraries, for ubuntu 16.04 only\nsudo apt-get install python3-pip python3-tk\npip3 install tensorflow numpy Pillow scipy opencv-python --user\n\n# clone the repo\ngit clone git@github.com:zxdong262/tf-captcha-reader.git\ncd tf-captcha-reader\nnpm i\npython3 main.py\n\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxdong262%2Ftf-captcha-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzxdong262%2Ftf-captcha-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxdong262%2Ftf-captcha-reader/lists"}