{"id":19156351,"url":"https://github.com/kyegomez/visionmamba","last_synced_at":"2025-04-05T22:05:50.237Z","repository":{"id":218433892,"uuid":"746407045","full_name":"kyegomez/VisionMamba","owner":"kyegomez","description":"Implementation of Vision Mamba from the paper: \"Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model\" It's 2.8x faster than DeiT and saves 86.8% GPU memory when performing batch inference to extract features on high-res images","archived":false,"fork":false,"pushed_at":"2024-03-12T06:50:35.000Z","size":2295,"stargazers_count":198,"open_issues_count":12,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-14T03:24:18.919Z","etag":null,"topics":["ai","machine-learning","mamba","pytorch","recurrent-neural-network","ssm"],"latest_commit_sha":null,"homepage":"https://discord.gg/GYbXvDGevY","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/kyegomez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["kyegomez"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2024-01-21T23:05:13.000Z","updated_at":"2024-04-22T22:54:10.716Z","dependencies_parsed_at":"2024-04-22T22:54:09.805Z","dependency_job_id":"2efd4d97-8c8d-4b45-97e6-e6eeb5c1ccca","html_url":"https://github.com/kyegomez/VisionMamba","commit_stats":null,"previous_names":["kyegomez/visionmamba"],"tags_count":0,"template":false,"template_full_name":"kyegomez/Python-Package-Template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FVisionMamba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FVisionMamba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FVisionMamba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FVisionMamba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyegomez","download_url":"https://codeload.github.com/kyegomez/VisionMamba/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406085,"owners_count":20933803,"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":["ai","machine-learning","mamba","pytorch","recurrent-neural-network","ssm"],"created_at":"2024-11-09T08:34:12.204Z","updated_at":"2025-04-05T22:05:50.220Z","avatar_url":"https://github.com/kyegomez.png","language":"Python","funding_links":["https://github.com/sponsors/kyegomez"],"categories":[],"sub_categories":[],"readme":"[![Multi-Modality](agorabanner.png)](https://discord.gg/qUtxnK2NMf)\n\n# Vision Mamba\nImplementation of Vision Mamba from the paper: \"Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model\" It's 2.8x faster than DeiT and saves 86.8% GPU memory when performing batch inference to extract features on high-res images. \n\n[PAPER LINK](https://arxiv.org/abs/2401.09417)\n\n## Installation\n\n```bash\npip install vision-mamba\n```\n\n# Usage\n```python\nimport torch\nfrom vision_mamba import Vim\n\n# Forward pass\nx = torch.randn(1, 3, 224, 224)  # Input tensor with shape (batch_size, channels, height, width)\n\n# Model\nmodel = Vim(\n    dim=256,  # Dimension of the transformer model\n    heads=8,  # Number of attention heads\n    dt_rank=32,  # Rank of the dynamic routing matrix\n    dim_inner=256,  # Inner dimension of the transformer model\n    d_state=256,  # Dimension of the state vector\n    num_classes=1000,  # Number of output classes\n    image_size=224,  # Size of the input image\n    patch_size=16,  # Size of each image patch\n    channels=3,  # Number of input channels\n    dropout=0.1,  # Dropout rate\n    depth=12,  # Depth of the transformer model\n)\n\n# Forward pass\nout = model(x)  # Output tensor from the model\nprint(out.shape)  # Print the shape of the output tensor\nprint(out)  # Print the output tensor\n\n\n\n```\n\n\n\n## Citation\n```bibtex\n@misc{zhu2024vision,\n    title={Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model}, \n    author={Lianghui Zhu and Bencheng Liao and Qian Zhang and Xinlong Wang and Wenyu Liu and Xinggang Wang},\n    year={2024},\n    eprint={2401.09417},\n    archivePrefix={arXiv},\n    primaryClass={cs.CV}\n}\n```\n\n# License\nMIT\n\n\n\n# Todo\n- [ ] Create training script for imagenet\n- [ ] Create a visual mamba for facial recognition","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyegomez%2Fvisionmamba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyegomez%2Fvisionmamba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyegomez%2Fvisionmamba/lists"}