Skip to main content

Multi-Modality

Screen AI

Implementation of the ScreenAI model from the paper: "A Vision-Language Model for UI and Infographics Understanding". The flow is: img + text -> patch sizes -> vit -> embed + concat -> attn + ffn -> cross attn + ffn + self attn -> to out. PAPER LINK:

Install

pip3 install screenai

Usage

import torch
from screenai.main import ScreenAI

# Create a tensor for the image
image = torch.rand(1, 3, 224, 224)

# Create a tensor for the text
text = torch.randn(1, 1, 512)

# Create an instance of the ScreenAI model with specified parameters
model = ScreenAI(
    patch_size=16,
    image_size=224,
    dim=512,
    depth=6,
    heads=8,
    vit_depth=4,
    multi_modal_encoder_depth=4,
    llm_decoder_depth=4,
    mm_encoder_ff_mult=4,
)

# Perform forward pass of the model with the given text and image tensors
out = model(text, image)

# Print the shape of the output tensor
print(out)

License

MIT

Citation

@misc{baechler2024screenai,
    title={ScreenAI: A Vision-Language Model for UI and Infographics Understanding}, 
    author={Gilles Baechler and Srinivas Sunkara and Maria Wang and Fedir Zubach and Hassan Mansoor and Vincent Etter and Victor Cărbune and Jason Lin and Jindong Chen and Abhanshu Sharma},
    year={2024},
    eprint={2402.04615},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

Todo

  • Implement the nn.ModuleList([]) in the encoder and decoder

Metadata

Release files for screenai 0.0.8

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

Source distribution (sdist)

Source distribution for screenai 0.0.8
File Size Uploaded Provenance Actions
screenai-0.0.8.tar.gz 6.9 kB Without provenance Details for screenai-0.0.8.tar.gz

Built distribution (wheel)

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

Total release size: 13.6 kB

Release files / screenai-0.0.8.tar.gz

Download URL screenai-0.0.8.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
88bfa0d00baa0c01cb8bca8010f679d1034ac13c0b4918763bb0e3121151169d
BLAKE2b-256 checksum
How to use checksums
d8c0a9e62577833c187bf32933aa338d288ddada1e8420b273857cc3f6b3e075
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 / screenai-0.0.8-py3-none-any.whl

Download URL screenai-0.0.8-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83728637490180adb0c2d8eabc359d82a4f70cea79f53e960a7daed2e0056ef6
BLAKE2b-256 checksum
How to use checksums
842a14fc880153ea6fcd779d30188c46061260c5624f6b6284493ea1b0a4fc3d
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

Security for screenai 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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