Instructions to use nzIng/unet-manuscripts-segmentation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use nzIng/unet-manuscripts-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://nzIng/unet-manuscripts-segmentation") - Notebooks
- Google Colab
- Kaggle
U-Net Manuscript Line Segmentation
TensorFlow/Keras U-Net model for line segmentation on medieval manuscript page images.
Files
unet-segmentation.keras: trained U-Net checkpoint.inference.py: simple local inference script.
Usage
python inference.py --input-path path/to/page.jpg
Outputs are created automatically:
results_json_inference/inference_<image_name>.jsoncrops_line/inference_<image_name>/line_XXXX.png
To process a folder:
python inference.py --input-path path/to/images_dir
Output
The JSON contains page metadata and detected text lines with:
bboxpolygonscorereading_order- optional crop metadata
Notes
The model input size is 256 x 256 x 3. The predicted mask is post-processed into line bounding boxes and line crops.
- Downloads last month
- 9