{"id":22479723,"url":"https://github.com/zeroact/scenetextremover-pytorch","last_synced_at":"2026-04-06T00:02:22.746Z","repository":{"id":51120082,"uuid":"369756694","full_name":"ZeroAct/SceneTextRemover-pytorch","owner":"ZeroAct","description":"This is a minimal implementation of Scene text removal via cascaded text stroke detection and erasing. This github repository is for studying on image in-painting for scene text erasing. Thank you :)","archived":false,"fork":false,"pushed_at":"2021-05-24T12:59:37.000Z","size":1775,"stargazers_count":46,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-15T04:04:58.726Z","etag":null,"topics":["detection","erasing","inpainting","stroke","text"],"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/ZeroAct.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}},"created_at":"2021-05-22T08:31:32.000Z","updated_at":"2025-01-06T09:19:03.000Z","dependencies_parsed_at":"2022-08-31T22:31:09.866Z","dependency_job_id":null,"html_url":"https://github.com/ZeroAct/SceneTextRemover-pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ZeroAct/SceneTextRemover-pytorch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeroAct%2FSceneTextRemover-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeroAct%2FSceneTextRemover-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeroAct%2FSceneTextRemover-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeroAct%2FSceneTextRemover-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZeroAct","download_url":"https://codeload.github.com/ZeroAct/SceneTextRemover-pytorch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeroAct%2FSceneTextRemover-pytorch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275926198,"owners_count":25553969,"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","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"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":["detection","erasing","inpainting","stroke","text"],"created_at":"2024-12-06T15:16:46.675Z","updated_at":"2025-09-19T10:58:55.651Z","avatar_url":"https://github.com/ZeroAct.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scene Text Remover Pytorch Implementation\n\nThis is a minimal implementation of [Scene text removal via cascaded text stroke detection and erasing](https://arxiv.org/pdf/2011.09768.pdf). This   github repository is for studying on image in-painting for scene text erasing. Thank you :)\n\n\n\n## Requirements\n\nPython 3.7 or later with all [requirements.txt](./requirements.txt) dependencies installed, including `torch\u003e=1.6`. To install run:\n\n```\n$ pip install -r requirements.txt\n```\n\n\n\n## Model Summary\n\n![model architecture](./doc/model.png)\n\n This model has u-net sub modules. \n`Gd` detects text stroke image `Ms` with `I` and `M`. `G'd` detects more precise text stroke `M's`.\nSimilarly,  `Gr` generates text erased image `Ite`, and `G'r` generates more precise output `I'te`.\n\n\n\n## Custom Dictionary\n\nNot to be confused, I renamed the names.\n\n`I` : Input Image (with text)\u003cbr\u003e\n`Mm` : Text area mask (`M` in the model)\u003cbr\u003e\n`Ms` : Text stroke mask; output of `Gd`\u003cbr\u003e\n`Ms_` : Text stroke mask; output of `G'd`\u003cbr\u003e\n`Msgt` : Text stroke mask ; ground truth\u003cbr\u003e\n`Ite` : Text erased image; output of `Gr`\u003cbr\u003e\n`Ite_` : Text erased image; output of `G'r`\u003cbr\u003e\n`Itegt`: Text erased image; ground truth\u003cbr\u003e\n\n\n\n## Prepare Dataset\n\nYou need to prepare background images in `backs` directory and text binary images in `font_mask` directory. \n\n![background image, text image example](./doc/back.png)\n[part of background image sample, text binary image sample]\n\nExecuting `python create_dataset.py` will automatically generate `I`, `Itegt`, `Mm`, `Msgt` data.\n(If you already have `I`, `Itegt`, `Mm`, `Msgt`, you can skip this section)\n\n```\n├─dataset\n│  ├─backs\n│  │  # background images\n│  └─font_mask\n│  │  # text binary images\n│  └─train\n│  │  └─I\n│  │  └─Itegt\n│  │  └─Mm\n│  │  └─Msgt  \n│  └─val\n│     └─I\n│     └─Itegt\n│     └─Mm\n│     └─Msgt\n```\n\nI generated my dataset with 709 background images and 2410 font mask.\nI used 17040 pairs for training and 4260 pairs for validation.\n\n![](./doc/dataset_example.png)\n\nThanks for helping me gathering background images [sina-Kim]([sina-Kim (github.com)](https://github.com/sina-Kim)).\n\n\n\n## Train\n\nAll you need to do is:\n\n``` python\npython train.py\n```\n\n\n\n## Result\n\nFrom the left\n`I`, `Itegt`, `Ite`, `Ite_`, `Msgt`, `Ms`, `Ms_`\n\n* Epoch 2\u003cbr\u003e\n  ![](./doc/epoch1.PNG)\n* Epoch 5\u003cbr\u003e\n  ![](./doc/epoch5.PNG)\n* Epoch 10\u003cbr\u003e\n  ![](./doc/epoch10.PNG)\n* Epoch 30\u003cbr\u003e\n  ![](./doc/epoch30.PNG)\n* Epoch 50\u003cbr\u003e\n  ![](./doc/epoch50.PNG)\n* Epoch 120\u003cbr\u003e\n  ![](./doc/epoch120.PNG)\n\nThese are not good enough for real task. I think the reason is lack of dataset and simplicity. \nBut, it was a good experience for me to implement the paper.\n\n\n\n## Issue\n\nIf you are having a trouble to run this code, please use issue tab. Thank you.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroact%2Fscenetextremover-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeroact%2Fscenetextremover-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroact%2Fscenetextremover-pytorch/lists"}