-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to run CLIP Model
using from_present
#2472
Comments
CLIP Model
using from_present CLIP Model
using from_present
You need to install the dependencies and load the clip model as below. !pip install -U keras-cv
!pip install -U keras-nlp
!pip install -U keras
import tensorflow as tf
from tensorflow.keras.layers import Input, Dense, Concatenate
from tensorflow.keras.models import Model
from keras_cv.models import CLIP
import numpy as np
# Load the pre-trained CLIP model from KerasCV
clip_model = CLIP.from_preset("clip-vit-base-patch16") for Image and Text encoder, you can use as below. # Define inputs
image_input = Input(shape=(224, 224, 3), name='image_input')
text_input = Input(shape=(77,), name='text_input', dtype=tf.int32)
# Process image through CLIP
image_embeds = clip_model.image_encoder(image_input)
# Process text through CLIP
text_embeds = clip_model.text_encoder(text_input) |
This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. |
thanks @sachinprasadhs , it's working but I guess it's not in docs |
Sure |
This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. |
This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further. |
Current Behavior:
Expected Behavior:
not able to load CLIP model even though I installed keras-nlp too
Steps To Reproduce:
Version:
Anything else:
This is my colab link
The text was updated successfully, but these errors were encountered: