Instructions to use keras/sam3_pcs with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/sam3_pcs with KerasHub:
import keras_hub # Create a ImageSegmenter model task = keras_hub.models.ImageSegmenter.from_preset("hf://keras/sam3_pcs")import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/sam3_pcs") - Keras
How to use keras/sam3_pcs 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/sam3_pcs") - Notebooks
- Google Colab
- Kaggle
| { | |
| "module": "keras_hub.src.models.sam3.sam3_pc_image_segmenter_preprocessor", | |
| "class_name": "SAM3PromptableConceptImageSegmenterPreprocessor", | |
| "config": { | |
| "name": "sam3_promptable_concept_image_segmenter_preprocessor", | |
| "trainable": true, | |
| "dtype": { | |
| "module": "keras", | |
| "class_name": "DTypePolicy", | |
| "config": { | |
| "name": "float32" | |
| }, | |
| "registered_name": null | |
| }, | |
| "tokenizer": { | |
| "module": "keras_hub.src.models.sam3.sam3_tokenizer", | |
| "class_name": "SAM3Tokenizer", | |
| "config": { | |
| "name": "sam3_tokenizer", | |
| "trainable": true, | |
| "dtype": { | |
| "module": "keras", | |
| "class_name": "DTypePolicy", | |
| "config": { | |
| "name": "int32" | |
| }, | |
| "registered_name": null | |
| }, | |
| "config_file": "tokenizer.json", | |
| "sequence_length": null, | |
| "add_prefix_space": false | |
| }, | |
| "registered_name": "keras_hub>SAM3Tokenizer" | |
| }, | |
| "image_converter": { | |
| "module": "keras_hub.src.models.sam3.sam3_image_converter", | |
| "class_name": "SAM3ImageConverter", | |
| "config": { | |
| "name": "sam3_image_converter", | |
| "trainable": true, | |
| "dtype": { | |
| "module": "keras", | |
| "class_name": "DTypePolicy", | |
| "config": { | |
| "name": "float32" | |
| }, | |
| "registered_name": null | |
| }, | |
| "image_size": [ | |
| 1008, | |
| 1008 | |
| ], | |
| "scale": [ | |
| 0.00784313725490196, | |
| 0.00784313725490196, | |
| 0.00784313725490196 | |
| ], | |
| "offset": [ | |
| -1.0, | |
| -1.0, | |
| -1.0 | |
| ], | |
| "interpolation": "bilinear", | |
| "antialias": true, | |
| "crop_to_aspect_ratio": false, | |
| "pad_to_aspect_ratio": false, | |
| "bounding_box_format": "yxyx" | |
| }, | |
| "registered_name": "keras_hub>SAM3ImageConverter" | |
| }, | |
| "config_file": "preprocessor.json", | |
| "sequence_length": 32, | |
| "add_start_token": true, | |
| "add_end_token": true | |
| }, | |
| "registered_name": "keras_hub>SAM3PromptableConceptImageSegmenterPreprocessor" | |
| } |