Skip to main content

Multi-Modality

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}
}

Release files for qformer 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qformer 0.0.5
File Size Uploaded
qformer-0.0.5.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qformer 0.0.5
File Interpreter ABI Platform
qformer-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / qformer-0.0.5.tar.gz

Download URL qformer-0.0.5.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9b2ff92ca5a318aac912c71767558a561e7df97d37426e0a66fb6c712515d9e9
BLAKE2b-256 checksum
How to use checksums
9fe56a63ab668a01846d5af7197c3b144c33fcafa748ca62c1710e81e5875658
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0

Release files / qformer-0.0.5-py3-none-any.whl

Download URL qformer-0.0.5-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb0f49ad349b6a97e3b9c39f077fb2a0328ec0c33979c2a6c5fcef96aa1b5aef
BLAKE2b-256 checksum
How to use checksums
c2a0bd247c1200e1bf5bcb4e0c7878577f103eccffe2cdffcc5178f28c45f2d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page