Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
5.42.0
metadata
title: Kraken OCR on Samaritan Manuscripts
emoji: 📜
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 5.33.0
app_file: app.py
pinned: false
Kraken OCR on Samaritan Manuscripts - Gradio App
This is a Gradio web application for OCR on Samaritan Manuscripts.
Setup
- Install requirements:
pip install -r requirements.txt
- Place your models:
- Put segmentation models (
.mlmodel
files) inapp/models/seg/
- Put recognition models (
.mlmodel
files) inapp/models/rec/
- Put segmentation models (
Running the App
python app.py
Usage
- Select segmentation and recognition models from the dropdown menus
- Upload an image file (supported formats: PNG, JPG, JPEG, TIF, TIFF)
- Click "Process Image" to run OCR
- View the results and download the XML output
Features
- Dynamic model selection
- Image preview
- XML output display
- Download processed results
- Error handling and progress indicators
Hugging Face Space Configuration
To run this app on Hugging Face Spaces, you need to:
Create a new Space with Gradio SDK
Add the following files to your Space:
app.py
requirements.txt
models/
directory with your modelstemplates/
directory with your templates
Make sure your
requirements.txt
includes:
gradio>=4.0.0
kraken
Pillow
numpy
opencv-python
jinja2
The Space should be configured with:
- Python 3.10 runtime
- GPU if available
- At least 8GB RAM
Your Space's
app.py
should be in the root directory, not in anapp/
subdirectoryUpdate the model paths in
app.py
to use relative paths:
MODELS_DIR = Path("models")
SEG_MODELS_DIR = MODELS_DIR / "seg"
REC_MODELS_DIR = MODELS_DIR / "rec"
- Make sure all model files are included in your Space's repository
Troubleshooting
If you encounter issues on Hugging Face Spaces:
- Check the Space logs for errors
- Verify all model files are present
- Ensure all dependencies are in
requirements.txt
- Check file permissions and paths
- Make sure the app is running on the correct port (7860)