Skip to main content

pytorch_clip_interrogator: Image-To-Promt.

Downloads Downloads Downloads

Install package

pip install pytorch_clip_interrogator

Install the latest version

pip install --upgrade git+https://github.com/bes-dev/pytorch_clip_interrogator.git

Features

  • Fully compatible with models from Huggingface.
  • Supports BLIP 1/2 model.
  • Support batch processing.

Usage

Simple code

import torch
import requests
from PIL import Image
from pytorch_clip_interrogator import PromptEngineer

# build pipeline
pipe = PromptEngineer(
    blip_model="Salesforce/blip2-opt-2.7b",
    clip_model="openai/clip-vit-base-patch32",
    device="cuda",
    torch_dtype=torch.float16
)

# load image
img_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg'
image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')


# generate caption
print(pipe(image))

Metadata

Release files for pytorch-clip-interrogator 2023.5.30.0

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

Built distribution (wheel)

Table of built distributions (wheels) for pytorch-clip-interrogator 2023.5.30.0
File Interpreter ABI Platform Actions
pytorch_clip_interrogator-2023.5.30.0-py3-none-any.whl Python 3 none any Details for pytorch_clip_interrogator-2023.5.30.0-py3-none-any.whl

Release files / pytorch_clip_interrogator-2023.5.30.0-py3-none-any.whl

Download URL pytorch_clip_interrogator-2023.5.30.0-py3-none-any.whl
Size 790.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37abf067006f2247680c8ceb167cb89dfae7950e2bf2c8387db1249d977330e9
BLAKE2b-256 checksum
How to use checksums
4133c157bcf6d83d9161ddba64b0cb2a8133659deb9c95daccc7d633e90e24df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Security for pytorch-clip-interrogator 2023.5.30.0

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