{"id":18727825,"url":"https://github.com/jdai-cv/image-captioning","last_synced_at":"2025-04-09T19:18:43.332Z","repository":{"id":49584658,"uuid":"250215411","full_name":"JDAI-CV/image-captioning","owner":"JDAI-CV","description":"Implementation of 'X-Linear Attention Networks for Image Captioning' [CVPR 2020]","archived":false,"fork":false,"pushed_at":"2021-07-27T06:06:31.000Z","size":751,"stargazers_count":273,"open_issues_count":7,"forks_count":54,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T19:18:38.707Z","etag":null,"topics":["image-captioning","vision-and-language"],"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/JDAI-CV.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}},"created_at":"2020-03-26T09:33:13.000Z","updated_at":"2025-01-05T15:21:41.000Z","dependencies_parsed_at":"2022-09-01T01:01:08.149Z","dependency_job_id":null,"html_url":"https://github.com/JDAI-CV/image-captioning","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/JDAI-CV%2Fimage-captioning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDAI-CV%2Fimage-captioning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDAI-CV%2Fimage-captioning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDAI-CV%2Fimage-captioning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JDAI-CV","download_url":"https://codeload.github.com/JDAI-CV/image-captioning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094990,"owners_count":21046770,"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":["image-captioning","vision-and-language"],"created_at":"2024-11-07T14:18:58.465Z","updated_at":"2025-04-09T19:18:43.305Z","avatar_url":"https://github.com/JDAI-CV.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\r\nThis repository is for **X-Linear Attention Networks for Image Captioning** (CVPR 2020). The original paper can be found [here](https://arxiv.org/pdf/2003.14080.pdf).\r\n\r\nPlease cite with the following BibTeX:\r\n\r\n```\r\n@inproceedings{xlinear2020cvpr,\r\n  title={X-Linear Attention Networks for Image Captioning},\r\n  author={Pan, Yingwei and Yao, Ting and Li, Yehao and Mei, Tao},\r\n  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},\r\n  year={2020}\r\n}\r\n```\r\n\r\n\u003cp align=\"center\"\u003e\r\n  \u003cimg src=\"images/framework.jpg\" width=\"800\"/\u003e\r\n\u003c/p\u003e\r\n\r\n\r\n## Requirements\r\n* Python 3\r\n* CUDA 10\r\n* numpy\r\n* tqdm\r\n* easydict\r\n* [PyTorch](http://pytorch.org/) (\u003e1.0)\r\n* [torchvision](http://pytorch.org/)\r\n* [coco-caption](https://github.com/ruotianluo/coco-caption)\r\n\r\n## Data preparation\r\n1. Download the [bottom up features](https://github.com/peteanderson80/bottom-up-attention) and convert them to npz files\r\n```\r\npython2 tools/create_feats.py --infeats bottom_up_tsv --outfolder ./mscoco/feature/up_down_10_100\r\n```\r\n\r\n2. Download the [annotations](https://drive.google.com/open?id=1i5YJRSZtpov0nOtRyfM0OS1n0tPCGiCS) into the mscoco folder. More details about data preparation can be referred to [self-critical.pytorch](https://github.com/ruotianluo/self-critical.pytorch)\r\n\r\n3. Download [coco-caption](https://github.com/ruotianluo/coco-caption) and setup the path of __C.INFERENCE.COCO_PATH in lib/config.py\r\n\r\n4. The pretrained models and results can be downloaded [here](https://drive.google.com/open?id=1a7aINHtpQbIw5JbAc4yvC7I1V-tQSdzb).\r\n\r\n5. The pretrained SENet-154 model can be downloaded [here](https://drive.google.com/file/d/1CrWJcdKLPmFYVdVNcQLviwKGtAREjarR/view?usp=sharing).\r\n\r\n## Training\r\n### Train X-LAN model\r\n```\r\nbash experiments/xlan/train.sh\r\n```\r\n\r\n### Train X-LAN model using self critical\r\nCopy the pretrained model into experiments/xlan_rl/snapshot and run the script\r\n```\r\nbash experiments/xlan_rl/train.sh\r\n```\r\n\r\n### Train X-LAN transformer model\r\n```\r\nbash experiments/xtransformer/train.sh\r\n```\r\n\r\n### Train X-LAN transformer model using self critical\r\nCopy the pretrained model into experiments/xtransformer_rl/snapshot and run the script\r\n```\r\nbash experiments/xtransformer_rl/train.sh\r\n```\r\n\r\n## Evaluation\r\n```\r\nCUDA_VISIBLE_DEVICES=0 python3 main_test.py --folder experiments/model_folder --resume model_epoch\r\n```\r\n\r\n## Acknowledgements\r\nThanks the contribution of [self-critical.pytorch](https://github.com/ruotianluo/self-critical.pytorch) and awesome PyTorch team.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdai-cv%2Fimage-captioning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdai-cv%2Fimage-captioning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdai-cv%2Fimage-captioning/lists"}