Instructions to use keras/parseq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/parseq with KerasHub:
import keras_hub # Load CausalLM model (optional: use half precision for inference) causal_lm = keras_hub.models.CausalLM.from_preset("hf://keras/parseq", dtype="bfloat16") causal_lm.compile(sampler="greedy") # (optional) specify a sampler # Generate text causal_lm.generate("Keras: deep learning for", max_length=64)import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/parseq") - Keras
How to use keras/parseq with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://keras/parseq") - Notebooks
- Google Colab
- Kaggle
| library_name: keras-hub | |
| pipeline_tag: text-generation | |
| ### Model Overview | |
| Permuted autoregressive sequence (PARSeq) model for Scene Text Recognition (STR) | |
| This model is designed for Scene Text Recognition (STR), which involves reading text from images. You can load and use the pre-trained PARSeq model with the following Python code snippet. The model takes an image as input and outputs the recognized text. | |
| ## Links | |
| * [PARSeq Quickstart Notebook]() | |
| * [PARSeq API Documentation](https://keras.io/api/keras_hub/models/parseq/) | |
| * [PARSeq Model Card](https://www.kaggle.com/models/keras/parseq) | |
| * [KerasHub Beginner Guide](https://keras.io/guides/keras_hub/getting_started/) | |
| * [KerasHub Model Publishing Guide](https://keras.io/guides/keras_hub/upload/) | |
| ## Installation | |
| Keras and KerasHub can be installed with: | |
| ``` | |
| pip install -U -q keras-hub | |
| pip install -U -q keras>=3 | |
| ``` | |
| Jax, TensorFlow, and Torch come preinstalled in Kaggle Notebooks. For instructions on installing them in another environment see the [Keras Getting Started](https://keras.io/getting_started/) page. | |
| ## Presets | |
| The following model checkpoints are provided by the Keras team. Full code examples for each are available below. | |
| | Preset name | Parameters | Description | | |
| |----------------------------------------|------------|----------------------------------------------| | |
| | `parseq` | 23.8M | 23 million parameter base model. | | |