Giter VIP home page Giter VIP logo

clip_trt's Introduction

clip_trt

CLIP and SigLIP models optimized with TensorRT with a Transformers-like API

Command-Line Example

python3 -m clip_trt \
  --inputs image_a.jpg image_b.jpg image_c.jpg \
  --inputs 'a dog' 'a cat' 'a bear' 'a lion'

Code Example

from clip_trt import CLIPModel

model = CLIPModel.from_pretrained(
    "openai/clip-vit-large-patch14-336",
    use_tensorrt=True,
    crop=False,
)

similarity = model(
    [
        'my_image.jpg',
        PIL.Image.open('image_2.jpg').convert('RGB'),
        np.ndarray((3,480,640), dtype=np.uint8),
        torch.ones((3,336,336), dtype=torch.uint8, device='cuda')
    ],
    [
        'a dog', 'a cat', 'a bear', 'a lion'
    ],
)

Embeddings

image_embed = model.embed('xyz.jpg')
text_embed = model.embed('an elephant in the jungle')

clip_trt's People

Contributors

dusty-nv avatar

Stargazers

Keyth M Citizen  avatar Ülkü Tuncer Küçüktaş avatar Guangze Zheng avatar 爱可可-爱生活 avatar Marcos Luciano avatar Felix Igelbrink avatar Vladislav Sorokin avatar Thanh  Nguyen avatar  avatar aaronrmm avatar  avatar Johnny avatar Daisuke Nishimatsu avatar

Watchers

 avatar  avatar Kostas Georgiou avatar

Forkers

d33pthinkers

clip_trt's Issues

About TensorRT version

Hi, I have an old Jetson Nano board and was trying to have clip_trt working on it. I couldn't run the sample due to the outdated TensorRT version (8.2.0.6). I would like to know if there's any way I can make this work. Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.