Instructions to use samarthkumar/ultrasound-nerve-segmentation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use samarthkumar/ultrasound-nerve-segmentation with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://samarthkumar/ultrasound-nerve-segmentation") - Notebooks
- Google Colab
- Kaggle
Ultrasound Nerve Segmentation β U-Net
Binary segmentation of the Brachial Plexus nerve in ultrasound images.
Model: U-Net (TensorFlow/Keras) Dataset: Kaggle Ultrasound Nerve Segmentation Validation Accuracy: 98.47% Input: 128Γ128 grayscale ultrasound image Output: 128Γ128 binary segmentation mask
Usage
from huggingface_hub import hf_hub_download
from src.model import load_trained_model
import numpy as np
model_path = hf_hub_download(repo_id="samarthkumar/ultrasound-nerve-segmentation", filename="model_nerve.keras")
model = load_trained_model(model_path)
# image shape: (128, 128, 1), values in [0, 1]
mask = model.predict(np.expand_dims(image, 0))
- Downloads last month
- 11