qformer - Pytorch
Project description
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
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
@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}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qformer-0.0.5.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file qformer-0.0.5.tar.gz
.
File metadata
- Download URL: qformer-0.0.5.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b2ff92ca5a318aac912c71767558a561e7df97d37426e0a66fb6c712515d9e9 |
|
MD5 | aeb9245e344cde743b3cd8ae4a88b217 |
|
BLAKE2b-256 | 9fe56a63ab668a01846d5af7197c3b144c33fcafa748ca62c1710e81e5875658 |
File details
Details for the file qformer-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: qformer-0.0.5-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb0f49ad349b6a97e3b9c39f077fb2a0328ec0c33979c2a6c5fcef96aa1b5aef |
|
MD5 | ab0a2fd28126f8ad35f75bbf0f9f1f0d |
|
BLAKE2b-256 | c2a0bd247c1200e1bf5bcb4e0c7878577f103eccffe2cdffcc5178f28c45f2d8 |