Instructions to use keras/basnet_duts with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/basnet_duts with KerasHub:
import keras_hub # Create a ImageSegmenter model task = keras_hub.models.ImageSegmenter.from_preset("hf://keras/basnet_duts")import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/basnet_duts") - Keras
How to use keras/basnet_duts 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/basnet_duts") - Notebooks
- Google Colab
- Kaggle
Model Overview
Model Summary
Deep semantic segmentation algorithms have improved a lot recently, but still fails to correctly predict pixels around object boundaries.We implement Boundary-Aware Segmentation Network (BASNet), using two stage predict and refine architecture, and a hybrid loss it can predict highly accurate boundaries and fine structures for image segmentation. This model is supported in both KerasCV and KerasHub. KerasCV will no longer be actively developed, so please try to use KerasHub. Weights are released under the MIT License . Keras model code is released under the Apache 2 License.
Links
- BASNet Quickstart Notebook
- BASNet API Documentation
- BASNet Model Card
- KerasHub Beginner Guide
- KerasHub Model Publishing Guide
Installation
Keras and KerasHub can be installed with:
pip install -U -q keras-hub
pip install -U -q keras
Jax, TensorFlow, and Torch come preinstalled in Kaggle Notebooks. For instructions on installing them in another environment see the Keras 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 |
|---|---|---|
| basnet_duts | 108.89M | BASNet model with a 34-layer ResNet backbone, pre-trained on the DUTS image dataset at a 288x288 resolution. |
- Downloads last month
- 2