Spaces:
Sleeping
Sleeping
Gemini CLI commited on
Commit ·
09c0606
1
Parent(s): b229e6f
Deploy to Hugging Face Space with Docker SDK and Trixie/Debian 13 updates
Browse files- Dockerfile +33 -0
- README.md +10 -0
- app.py +1 -2
- packages.txt +3 -1
Dockerfile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
# Set working directory
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# Install system dependencies
|
| 7 |
+
COPY packages.txt /tmp/packages.txt
|
| 8 |
+
RUN sed -i 's/main$/main contrib non-free/' /etc/apt/sources.list && \
|
| 9 |
+
apt-get update && \
|
| 10 |
+
xargs -r -a /tmp/packages.txt apt-get install -y || true && \
|
| 11 |
+
apt-get install -y \
|
| 12 |
+
curl \
|
| 13 |
+
libgl1-mesa-glx \
|
| 14 |
+
poppler-utils \
|
| 15 |
+
tesseract-ocr \
|
| 16 |
+
libtesseract-dev \
|
| 17 |
+
libleptonica-dev && \
|
| 18 |
+
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
| 19 |
+
apt-get install -y nodejs && \
|
| 20 |
+
rm -rf /var/lib/apt/lists/* && apt-get clean
|
| 21 |
+
|
| 22 |
+
# Copy requirements and install
|
| 23 |
+
COPY requirements.txt .
|
| 24 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
+
|
| 26 |
+
# Copy the rest of the application
|
| 27 |
+
COPY . .
|
| 28 |
+
|
| 29 |
+
# Expose port 7860 for Gradio
|
| 30 |
+
EXPOSE 7860
|
| 31 |
+
|
| 32 |
+
# Run the application
|
| 33 |
+
CMD ["python", "app.py"]
|
README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Passport OCR Tool
|
| 2 |
|
| 3 |
A robust tool to extract data from passport images (PNG, JPG) and PDFs using OCR. It extracts MRZ (Machine Readable Zone) data and exports it to Excel or CSV formats.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Passport Extractor
|
| 3 |
+
emoji: 🛂
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_file: app.py
|
| 8 |
+
pinned: false
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
# Passport OCR Tool
|
| 12 |
|
| 13 |
A robust tool to extract data from passport images (PNG, JPG) and PDFs using OCR. It extracts MRZ (Machine Readable Zone) data and exports it to Excel or CSV formats.
|
app.py
CHANGED
|
@@ -332,7 +332,6 @@ def build_app():
|
|
| 332 |
if __name__ == "__main__":
|
| 333 |
app = build_app()
|
| 334 |
app.launch(
|
| 335 |
-
server_name="
|
| 336 |
server_port=7860,
|
| 337 |
-
share=True,
|
| 338 |
)
|
|
|
|
| 332 |
if __name__ == "__main__":
|
| 333 |
app = build_app()
|
| 334 |
app.launch(
|
| 335 |
+
server_name="0.0.0.0",
|
| 336 |
server_port=7860,
|
|
|
|
| 337 |
)
|
packages.txt
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
-
libgl1
|
| 2 |
poppler-utils
|
| 3 |
tesseract-ocr
|
|
|
|
| 4 |
libtesseract-dev
|
|
|
|
|
|
| 1 |
+
libgl1-mesa-glx
|
| 2 |
poppler-utils
|
| 3 |
tesseract-ocr
|
| 4 |
+
tesseract-ocr-eng
|
| 5 |
libtesseract-dev
|
| 6 |
+
libleptonica-dev
|