This is a Flask server that extracts data from Bangladeshi National ID cards using computer vision and OCR.
- Python 3.8 or higher
- Required Python packages (see requirements.txt)
- Create a virtual environment:
# Create a virtual environment
python -m venv venvActivate the virtual environment
# On Windows
venv\Scripts\activate# On macOS/Linux
source venv/bin/activate- Install setuptools (required for package installation):
pip install setuptools- Install the required Python packages:
pip install ultralytics
pip install opencv-python
pip install pandas
pip install numpy
pip install easyocr
pip install Pillow
pip install flaskStart the server by running:
python app.pyThe server will start on port 5001 by default. You can change the port by setting the PORT environment variable.
Returns the status of the server.
POST /extract
Parameters:
image: The NID image file (multipart/form-data)save_output: Whether to save the output image with bounding boxes (optional, default: false)
Returns:
- JSON object containing the extracted data from the NID