{"id":19156207,"url":"https://github.com/kyegomez/qformer","last_synced_at":"2026-03-06T01:36:40.302Z","repository":{"id":214572640,"uuid":"736848054","full_name":"kyegomez/qformer","owner":"kyegomez","description":"Implementation of Qformer from BLIP2 in Zeta Lego blocks.","archived":false,"fork":false,"pushed_at":"2024-11-11T12:26:18.000Z","size":2297,"stargazers_count":42,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-18T07:32:08.908Z","etag":null,"topics":["ai","artificial-intelligence","attention-mechanism","blip2","machine","machine-learning","multi-modal","multi-modality"],"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,"publiccode":null,"codemeta":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":"2023-12-29T03:55:46.000Z","updated_at":"2025-07-28T08:22:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"c895b89e-4b74-4bb4-80c7-fe8f0092a216","html_url":"https://github.com/kyegomez/qformer","commit_stats":null,"previous_names":["kyegomez/qformer"],"tags_count":0,"template":false,"template_full_name":"kyegomez/Python-Package-Template","purl":"pkg:github/kyegomez/qformer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2Fqformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2Fqformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2Fqformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2Fqformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyegomez","download_url":"https://codeload.github.com/kyegomez/qformer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2Fqformer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273886152,"owners_count":25185504,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ai","artificial-intelligence","attention-mechanism","blip2","machine","machine-learning","multi-modal","multi-modality"],"created_at":"2024-11-09T08:33:35.277Z","updated_at":"2025-10-28T20:44:41.414Z","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\n# Qformer\nImplementation of Qformer from BLIP2 in Zeta Lego blocks. The implementation is here straight from Figure 2. In particular the image block and text block.\n\n## Install\n`pip3 install qformer`\n\n\n## Usage\n```python\nimport torch\nfrom qformer import QFormer\n\n# Create a random tensor of shape (1, 32, 512)\nx = torch.randn(1, 32, 512)\n\n# Create a random image tensor of shape (1, 3, 224, 224)\nimg = torch.randn(1, 3, 224, 224)\n\n# Create an instance of the QFormer model with the following parameters:\n# - input_size: 512\n# - num_heads: 8\n# - num_layers: 8\n# - dropout: 0.1\n# - num_classes: 2\n# - num_patches: 2\nqformer = QFormer(512, 8, 8, 0.1, 2, 2)\n\n# Apply the QFormer model to the input tensors x and img\ny = qformer(x, img)\n\n# Print the shape of the output tensor y\nprint(y.shape)\n\n\n```\n\n\n# License\nMIT\n\n\n\n# Citation\n```bibtext\n@misc{li2023blip2,\n    title={BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models}, \n    author={Junnan Li and Dongxu Li and Silvio Savarese and Steven Hoi},\n    year={2023},\n    eprint={2301.12597},\n    archivePrefix={arXiv},\n    primaryClass={cs.CV}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyegomez%2Fqformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyegomez%2Fqformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyegomez%2Fqformer/lists"}