{"id":19382849,"url":"https://github.com/locuslab/t-mars","last_synced_at":"2025-04-23T20:32:30.564Z","repository":{"id":177453129,"uuid":"660394978","full_name":"locuslab/T-MARS","owner":"locuslab","description":"Code for T-MARS data filtering ","archived":false,"fork":false,"pushed_at":"2023-08-23T05:29:47.000Z","size":55326,"stargazers_count":35,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-02T20:11:21.619Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tmars-clip.github.io","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/locuslab.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-06-29T23:14:10.000Z","updated_at":"2024-10-06T17:35:49.000Z","dependencies_parsed_at":"2024-11-10T09:25:32.930Z","dependency_job_id":"b7a8e2b8-907c-4c4f-b22f-5c48279f3995","html_url":"https://github.com/locuslab/T-MARS","commit_stats":null,"previous_names":["locuslab/t-mars"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2FT-MARS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2FT-MARS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2FT-MARS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2FT-MARS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/locuslab","download_url":"https://codeload.github.com/locuslab/T-MARS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250509865,"owners_count":21442514,"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":[],"created_at":"2024-11-10T09:23:34.550Z","updated_at":"2025-04-23T20:32:30.550Z","avatar_url":"https://github.com/locuslab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# T-MARS\nOfficial repository for the paper [T-MARS: Improving Visual Representations by Circumventing Text Feature Learning](https://arxiv.org/abs/2307.03132).  \nWebpage: https://tmars-clip.github.io/\n\n\n## T-MARS Text Masking Code\nWe use FAST (https://github.com/czczup/FAST) as the base algorithm for text detection and MMOCR (https://mmocr.readthedocs.io/en/dev-1.x/) for text recognition i.e. reading the text. This repository shares the combined implementation of FAST and MMOCR for running on web-scales (adapted from DataComp https://www.datacomp.ai/).\n\n\n## Installation\n\n```sh\ngit clone https://github.com/locuslab/T-MARS.git\ncd T-MARS\nconda create -n tmars python=3.10 -y\nconda activate tmars\npip install -e .\n```\n\nFor MMOCR installation (this is only needed if you want to do OCR detection, and is not needed for T-MARS):\n\n```sh\npip install -U openmim\nmim install mmengine\nmim install mmcv\nmim install mmdet\ncd dataset2metadata/text_detection\ngit clone https://github.com/open-mmlab/mmocr.git\ncd mmocr\npip install -e .\n```\n\n## Text detection and recognition\nPlease refer to [text_snake_wrapper.py](https://github.com/locuslab/T-MARS/blob/main/dataset2metadata/text_detection/text_snake_wrapper.py) for the main implementation of text detection (FAST) and text recognition (MMOCR). \nDownload the text detection model : \n```sh\ncd dataset2metadata/text_detection\nwget https://github.com/czczup/FAST/releases/download/release/fast_tiny_tt_512_finetune_ic17mlt.pth\n```\n\n## RUN\n\n```sh\ncd dataset2metadata/text_detection\ndataset2metadata --yml ../../examples/slurm/text_template.yml\n```\n\nPlease see the [examples/](https://github.com/locuslab/T-MARS/tree/main/examples/slurm) folder for ways in which dataset2metadata is to be used for running T-MARS on webscale. You can specify the tar file paths in [text_template.yml](https://github.com/locuslab/T-MARS/blob/main/examples/slurm/text_template.yml) and create multiple such template files using [prepare_jobs.py](https://github.com/locuslab/T-MARS/blob/main/examples/slurm/prepare_jobs.py)\n\n```\ncd dataset2metadata\ndataset2metadata --yml examples/text_template.yml\n```\n\n## Acknowlegements\nWe thank the authors of FAST, MMOCR and DataComp team for open sourcing their code bases. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocuslab%2Ft-mars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocuslab%2Ft-mars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocuslab%2Ft-mars/lists"}