This file contains structured prompt templates for Gemini used to extract Arabic-language fields from various Saudi government document types. Each prompt is tailored for a specific class such as CR1–CR7 (Commercial Registration), B1–B4 (Municipal Licenses), and V1–V3 (Tax Certificates).
These prompts are designed to guide Gemini API responses for accurate field extraction, with consistent output formatting per document type. Ideal for use in automated OCR pipelines.
Flask API for YOLOv8 image classification (large class set)
This Flask server provides a lightweight HTTP API for classifying document images using a YOLOv8 classification model with a large number of classes.
- Endpoint: POST /classify
- Input: An image file (multipart/form-data with key 'file')
- Output: JSON response with the predicted class name (top-1)
Image is temporarily saved to disk, processed by the model, then deleted.
Ideal for automated document pipelines with many document types (e.g., cr1 to cr7, b1 to b4, v1 to v3, etc.).
Best trained classification model (200 epochs, batch size 16)
Best classification model trained for 200 epochs with the following configuration:
- Batch size: 64
- Image size: 224x224
- Optimizer: AdamW
- Initial learning rate (lr0): 0.01
- Final learning rate factor (lrf): 0.01
- Patience: 20
- Workers: 16
The model achieved the best performance and was selected as the final version.