{"id":21192531,"url":"https://github.com/luopeixiang/im2latex","last_synced_at":"2025-06-19T14:38:19.201Z","repository":{"id":37601994,"uuid":"177778222","full_name":"luopeixiang/im2latex","owner":"luopeixiang","description":"Pytorch implemention of Deep CNN Encoder + LSTM Decoder with Attention for Image to Latex","archived":false,"fork":false,"pushed_at":"2023-10-03T21:29:40.000Z","size":7565,"stargazers_count":193,"open_issues_count":24,"forks_count":53,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-01T12:39:42.257Z","etag":null,"topics":["encoder-decoder-model","im2latex","imagecaptioning","pytorch","seq2seq","show-and-tell"],"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/luopeixiang.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":"2019-03-26T11:51:02.000Z","updated_at":"2025-03-23T12:02:57.000Z","dependencies_parsed_at":"2025-01-09T19:43:04.124Z","dependency_job_id":"864fdb44-4dd2-4b93-981b-2c60153a9fa1","html_url":"https://github.com/luopeixiang/im2latex","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"cd80800b70621847315e09fc9b760b5281f1a9f7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luopeixiang/im2latex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luopeixiang%2Fim2latex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luopeixiang%2Fim2latex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luopeixiang%2Fim2latex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luopeixiang%2Fim2latex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luopeixiang","download_url":"https://codeload.github.com/luopeixiang/im2latex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luopeixiang%2Fim2latex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260769738,"owners_count":23060165,"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":["encoder-decoder-model","im2latex","imagecaptioning","pytorch","seq2seq","show-and-tell"],"created_at":"2024-11-20T19:09:59.749Z","updated_at":"2025-06-19T14:38:14.179Z","avatar_url":"https://github.com/luopeixiang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\n# Im2Latex\n\n![License](https://img.shields.io/apm/l/vim-mode.svg)\n\nDeep CNN Encoder + LSTM Decoder with Attention for Image to Latex, the pytorch implemention of the model architecture used by the [Seq2Seq for LaTeX generation](https://guillaumegenthial.github.io/image-to-latex.html)\n\n\n\n## Sample results from this implemention\n\n\n\n![sample_result](imgs/sample_result.png)\n\n\n\n\n\n## Experimental results on the IM2LATEX-100K  test dataset\n\n| BLUE-4 | Edit Distance | Exact Match |\n| ------ | ------------- | ----------- |\n| 40.80  | 44.23         | 0.27        |\n\n\n\n## Getting Started\n\n\n\n**Install dependency:**\n\n```bash\npip install -r requirement.txt\n```\n\n**Download the dataset for training:**\n\n```bash\ncd data\nwget http://lstm.seas.harvard.edu/latex/data/im2latex_validate_filter.lst\nwget http://lstm.seas.harvard.edu/latex/data/im2latex_train_filter.lst\nwget http://lstm.seas.harvard.edu/latex/data/im2latex_test_filter.lst\nwget http://lstm.seas.harvard.edu/latex/data/formula_images_processed.tar.gz\nwget http://lstm.seas.harvard.edu/latex/data/im2latex_formulas.norm.lst\ntar -zxvf formula_images_processed.tar.gz\n```\n\n**Preprocess:**\n\n```bash\npython preprocess.py\n```\n\n**Build vocab**\n```bash\npython build_vocab.py\n```\n\n**Train:**\n\n     python train.py \\\n          --data_path=[data dir] \\\n          --save_dir=[the dir for saving ckpts] \\\n          --dropout=0.2 --add_position_features \\\n          --epoches=25 --max_len=150\n**Evaluate:**\n\n```bash\npython evaluate.py --split=test \\\n     --model_path=[the path to model] \\\n     --data_path=[data dir] \\\n     --batch_size=32 \\\n     --ref_path=[the file to store reference] \\\n     --result_path=[the file to store decoding result]\n```\n\n\n\n## Features\n\n- [x] Schedule Sampling from [Scheduled Sampling for Sequence Prediction with Recurrent Neural Networks](https://arxiv.org/pdf/1506.03099.pdf)\n- [x] Positional Embedding from [Attention Is All You Need](https://arxiv.org/abs/1706.03762)\n- [x] Batch beam search\n- [x] Training from checkpoint \n- [ ] Improve the code of data loading for cpu/cuda memery efficiency \n- [ ] **Finetune hyper parameters for better performance**\n- [ ] A HTML Page allowing upload picture to decode\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluopeixiang%2Fim2latex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluopeixiang%2Fim2latex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluopeixiang%2Fim2latex/lists"}