|
119 | 119 | "Before using PaliGemma for the first time, you must request access to the model through Kaggle by completing the following steps:\n", |
120 | 120 | "\n", |
121 | 121 | "1. Log in to [Kaggle](https://www.kaggle.com), or create a new Kaggle account if you don't already have one.\n", |
122 | | - "1. Go to the [PaliGemma model card](https://www.kaggle.com/models/google/paligemma/) and click **Request Access**.\n", |
| 122 | + "1. Go to the [PaliGemma model card](https://www.kaggle.com/models/google/paligemma-2/) and click **Request Access**.\n", |
123 | 123 | "1. Complete the consent form and accept the terms and conditions." |
124 | 124 | ] |
125 | 125 | }, |
|
200 | 200 | }, |
201 | 201 | "outputs": [], |
202 | 202 | "source": [ |
203 | | - "!pip install -U -q keras-nlp" |
| 203 | + "!pip install -U -q keras-nlp kagglehub" |
204 | 204 | ] |
205 | 205 | }, |
206 | 206 | { |
|
260 | 260 | }, |
261 | 261 | "outputs": [], |
262 | 262 | "source": [ |
263 | | - "paligemma = keras_hub.models.PaliGemmaCausalLM.from_preset(\"pali_gemma_3b_mix_224\")\n", |
| 263 | + "paligemma = keras_hub.models.PaliGemmaCausalLM.from_preset(\"kaggle://keras/paligemma2/keras/pali_gemma_2_mix_3b_224\")\n", |
264 | 264 | "paligemma.summary()" |
265 | 265 | ] |
266 | 266 | }, |
|
302 | 302 | " image = PIL.Image.open(contents)\n", |
303 | 303 | " image = crop_and_resize(image, target_size)\n", |
304 | 304 | " image = np.array(image)\n", |
305 | | - " # Remove alpha channel if neccessary.\n", |
| 305 | + " # Remove alpha channel if necessary.\n", |
306 | 306 | " if image.shape[2] == 4:\n", |
307 | 307 | " image = image[:, :, :3]\n", |
308 | 308 | " return image\n", |
|
492 | 492 | "source": [ |
493 | 493 | "### Use `segment` prompt\n", |
494 | 494 | "\n", |
495 | | - "The following example code uses the `segment` prompt syntax to locate the area of an image occupied by an object. It uses the Google `big_vision` library to interpret the model output and generate a mask for the segemented object.\n", |
| 495 | + "The following example code uses the `segment` prompt syntax to locate the area of an image occupied by an object. It uses the Google `big_vision` library to interpret the model output and generate a mask for the segmented object.\n", |
496 | 496 | "\n", |
497 | 497 | "Before getting started, install the `big_vision` library and its dependencies, as shown in this code example:\n" |
498 | 498 | ] |
|
0 commit comments