{"id":26911457,"url":"https://github.com/kimrass/craft","last_synced_at":"2026-04-28T09:35:44.417Z","repository":{"id":113500036,"uuid":"589385239","full_name":"KimRass/CRAFT","owner":"KimRass","description":"'CRAFT'","archived":false,"fork":false,"pushed_at":"2024-01-05T06:03:31.000Z","size":943377,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-02T13:52:20.858Z","etag":null,"topics":["craft","image-processing","pytorch","text-detection"],"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/KimRass.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":"2023-01-16T01:09:06.000Z","updated_at":"2024-01-05T06:02:18.000Z","dependencies_parsed_at":"2024-01-05T07:34:42.867Z","dependency_job_id":null,"html_url":"https://github.com/KimRass/CRAFT","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KimRass/CRAFT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KimRass%2FCRAFT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KimRass%2FCRAFT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KimRass%2FCRAFT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KimRass%2FCRAFT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KimRass","download_url":"https://codeload.github.com/KimRass/CRAFT/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KimRass%2FCRAFT/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32375615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T09:24:15.638Z","status":"ssl_error","status_checked_at":"2026-04-28T09:24:15.071Z","response_time":56,"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":["craft","image-processing","pytorch","text-detection"],"created_at":"2025-04-01T14:38:26.376Z","updated_at":"2026-04-28T09:35:44.398Z","avatar_url":"https://github.com/KimRass.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# References:\n- https://github.com/HCIILAB/Scene-Text-Detection#5-ocr-service\n\u003c!-- \n- Region score map predicted using pre-trained model\n    - \u003cimg src=\"https://i.imgur.com/tSjlj5b.jpg\" width=\"800\"\u003e\n- Region score map generated using annotated bounding boxes\n    - \u003cimg src=\"https://i.imgur.com/Lj0r973.jpg\" width=\"800\"\u003e --\u003e\n\n# Data\n## CIDAR2016 dataset\n```\nicdar2017/: config.DATA_DIR\n├── ch8_training_images_1\n├── ch8_training_images_2\n...\n└── ch8_training_localization_transcription_gt_v2\n```\n\n# Online Hard Example Mining\n- [Training Region-based Object Detectors with Online Hard Example Mining](https://arxiv.org/pdf/1604.03540.pdf)\n- Reference: https://sh-tsang.medium.com/review-ohem-training-region-based-object-detectors-with-online-hard-example-mining-object-ad791ad87612\n- It is assumed that regions with some overlap with the ground truth are more likely to be the confusing or hard ones.\n- Although this heuristic helps convergence and detection accuracy, it is suboptimal because it ignores some infrequent, but important, difficult background regions.\n- **To handle the data imbalance, heuristics is designed to rebalance the foreground-to-background ratio in each mini-batch to a target of $1 : 3$ by undersampling the background patches at random, thus ensuring that 25% of a mini-batch is fg RoIs.**\n- The loss of each RoI represents how well the current network performs on each RoI.\n- **Hard examples are selected by sorting the input RoIs by loss and taking the B/N examples for which the current network performs worst.**\n- And OHEM does not need a fg-bg ratio for data balancing. If any class were neglected, its loss would increase.\n- There can be images where the fg RoIs are easy (e.g. canonical view of a car), so the network is free to use only bg regions in a mini-batch; and vice versa when bg is trivial (e.g. sky, grass etc.), the mini-batch can be entirely fg regions.\n- The implementation maintains two copies of the RoI network, one of which is readonly.\n- The readonly RoI network performs a forward pass and computes loss for all input RoIs (R) (green arrows).\n- Then the hard RoI sampling module uses OHEM to select hard examples (Rhard-sel), which are input to the regular RoI network (red arrows).\nThis network computes forward and backward passes only for Rhard-sel.\n\n- Object detectors are often trained through a reduction that converts object detection into an image classification problem. *This reduction introduces a new challenge that is not found in natural image classification tasks: the training set is distinguished by a large imbalance between the number of annotated objects and the number of background examples (image regions not belonging to any object class of interest). In the case of sliding-window object detectors this imbalance may be as extreme as 100,000 background examples to every one object.*\n- Our motivation is the same as it has always been – detection datasets contain an overwhelming number of easy examples and a small number of hard examples. Automatic selection of these hard examples can make training more effective and efficient. OHEM is a simple and intuitive algorithm that eliminates several heuristics and hyperparameters in common use.\n- To handle the data imbalance, designed heuristics to rebalance the foreground-to-background ratio in each mini-batch to a target of $1 : 3$ by undersampling the background patches at random, thus ensuring that 25% of a mini-batch is $fg$ RoIs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimrass%2Fcraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimrass%2Fcraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimrass%2Fcraft/lists"}