ocr / LOCAL_TESTING_ISSUE.md
jeyanthangj2004's picture
Upload 110 files
3f42a6f verified

A newer version of the Gradio SDK is available: 6.13.0

Upgrade

⚠️ Local Testing Issue - NumPy Compatibility

Problem

Your system has Python 3.13.5, which only supports NumPy 2.x. However, the eDOCr2 library and its dependencies (especially imgaug) require NumPy 1.x.

Error encountered:

AttributeError: `np.sctypes` was removed in the NumPy 2.0 release

Solutions

βœ… Option 1: Deploy Directly to Hugging Face (RECOMMENDED)

Hugging Face Spaces uses Python 3.10 which supports NumPy 1.26.4. Your app will work perfectly there!

Steps:

  1. Download model files (see HUGGINGFACE_CHECKLIST.md)
  2. Create Hugging Face Space
  3. Upload all files
  4. It will work automatically!

Advantages:

  • βœ… No local setup needed
  • βœ… Correct Python/NumPy versions
  • βœ… Free hosting
  • βœ… Share with anyone

βš™οΈ Option 2: Install Python 3.10 or 3.11 Locally

If you want to test locally, install an older Python version:

Windows:

  1. Download Python 3.10.11 from python.org
  2. Install (check "Add to PATH")
  3. Create virtual environment:
    py -3.10 -m venv venv
    venv\Scripts\activate
    pip install -r requirements.txt
    python app.py
    

Advantages:

  • βœ… Can test locally before deploying
  • βœ… Full compatibility

Disadvantages:

  • ❌ Need to install another Python version
  • ❌ More setup time

πŸ”§ Option 3: Use Docker (Advanced)

Create a Docker container with Python 3.10:

FROM python:3.10-slim

WORKDIR /app
COPY . .

RUN apt-get update && apt-get install -y tesseract-ocr poppler-utils
RUN pip install -r requirements.txt

CMD ["python", "app.py"]

Current Status

βœ… Files Created:

  • app.py (Gradio interface)
  • requirements.txt (dependencies)
  • packages.txt (system deps)
  • README.md (Hugging Face description)
  • .gitattributes (Git LFS config)
  • DEPLOYMENT.md (deployment guide)
  • HUGGINGFACE_CHECKLIST.md (quick reference)

βœ… Model Files:

  • All 4 model files are present in edocr2/models/

βœ… Ready for Deployment:

  • Everything is configured for Hugging Face Spaces
  • Just need to upload to Hugging Face

Recommendation

Skip local testing and deploy directly to Hugging Face!

Reasons:

  1. Hugging Face handles the environment automatically
  2. No Python version conflicts
  3. Free hosting
  4. Can test there just as easily
  5. Share with others immediately

Next Steps

  1. Create Hugging Face Account (if you don't have one)
  2. Create New Space (SDK: Gradio)
  3. Upload Files (see DEPLOYMENT.md for detailed steps)
  4. Wait for Build (5-10 minutes)
  5. Test Your App online!

Need help with deployment? Check DEPLOYMENT.md for step-by-step instructions!