[![Multi-Modality](agorabanner.png)](https://discord.gg/qUtxnK2NMf)
# Qformer
Implementation of Qformer from BLIP2 in Zeta Lego blocks. The implementation is here straight from Figure 2. In particular the image block and text block.
## Install
`pip3 install qformer`
## Usage
```python
import torch
from qformer import QFormer
x = torch.randn(
1, 32, 512
) # Create a random tensor of shape (1, 32, 512)
img = torch.randn(
1, 32, 512
) # Create another random tensor of shape (1, 32, 512)
qformer = QFormer(
512, 8, 8, 0.1, 2, 2
) # Create an instance of the QFormer model
y = qformer(
x, img
) # Apply the QFormer model to the input tensors x and img
print(y.shape) # Print the shape of the output tensor y
```
# License
MIT
# Citation
```bibtext
@misc{li2023blip2,
title={BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models},
author={Junnan Li and Dongxu Li and Silvio Savarese and Steven Hoi},
year={2023},
eprint={2301.12597},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/kyegomez/qformer",
"name": "qformer",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6,<4.0",
"maintainer_email": "",
"keywords": "artificial intelligence,deep learning,optimizers,Prompt Engineering",
"author": "Kye Gomez",
"author_email": "kye@apac.ai",
"download_url": "https://files.pythonhosted.org/packages/9f/e5/6a63ab668a01846d5af7197c3b144c33fcafa748ca62c1710e81e5875658/qformer-0.0.5.tar.gz",
"platform": null,
"description": "[![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\nx = torch.randn(\n 1, 32, 512\n) # Create a random tensor of shape (1, 32, 512)\n\nimg = torch.randn(\n 1, 32, 512\n) # Create another random tensor of shape (1, 32, 512)\n\nqformer = QFormer(\n 512, 8, 8, 0.1, 2, 2\n) # Create an instance of the QFormer model\n\ny = qformer(\n x, img\n) # Apply the QFormer model to the input tensors x and img\n\nprint(y.shape) # Print the shape of the output tensor y\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```",
"bugtrack_url": null,
"license": "MIT",
"summary": "qformer - Pytorch",
"version": "0.0.5",
"project_urls": {
"Documentation": "https://github.com/kyegomez/qformer",
"Homepage": "https://github.com/kyegomez/qformer",
"Repository": "https://github.com/kyegomez/qformer"
},
"split_keywords": [
"artificial intelligence",
"deep learning",
"optimizers",
"prompt engineering"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c2a0bd247c1200e1bf5bcb4e0c7878577f103eccffe2cdffcc5178f28c45f2d8",
"md5": "ab0a2fd28126f8ad35f75bbf0f9f1f0d",
"sha256": "eb0f49ad349b6a97e3b9c39f077fb2a0328ec0c33979c2a6c5fcef96aa1b5aef"
},
"downloads": -1,
"filename": "qformer-0.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ab0a2fd28126f8ad35f75bbf0f9f1f0d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6,<4.0",
"size": 5705,
"upload_time": "2024-02-01T17:21:41",
"upload_time_iso_8601": "2024-02-01T17:21:41.387253Z",
"url": "https://files.pythonhosted.org/packages/c2/a0/bd247c1200e1bf5bcb4e0c7878577f103eccffe2cdffcc5178f28c45f2d8/qformer-0.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9fe56a63ab668a01846d5af7197c3b144c33fcafa748ca62c1710e81e5875658",
"md5": "aeb9245e344cde743b3cd8ae4a88b217",
"sha256": "9b2ff92ca5a318aac912c71767558a561e7df97d37426e0a66fb6c712515d9e9"
},
"downloads": -1,
"filename": "qformer-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "aeb9245e344cde743b3cd8ae4a88b217",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6,<4.0",
"size": 5246,
"upload_time": "2024-02-01T17:21:46",
"upload_time_iso_8601": "2024-02-01T17:21:46.915339Z",
"url": "https://files.pythonhosted.org/packages/9f/e5/6a63ab668a01846d5af7197c3b144c33fcafa748ca62c1710e81e5875658/qformer-0.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-01 17:21:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kyegomez",
"github_project": "qformer",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "torch",
"specs": []
},
{
"name": "zetascale",
"specs": []
},
{
"name": "swarms",
"specs": []
},
{
"name": "einops",
"specs": []
}
],
"lcname": "qformer"
}