This README provides instructions on how to set up and run a Flask application for the Khmer Alphabet CNN project, as well as information on training the model.
- Python 3.9
- pip
- Docker (optional, if you choose to run via Docker)
First, clone the repository to your local machine:
git clone git@github.com:vvvey/khmer-alphabet-cnn.git
cd khmer-alphabet-cnnTo install the required Python packages, run:
pip install -r requirements.txtYou can run the Flask application in one of two ways:
Start the Flask application using the following command:
python app.pyThe application should be running on http://localhost:5000
If you prefer to run the application using Docker, you can build and run it with the following commands:
- Build the Docker image
docker build -t khmer-cnn .- Run the Docker container:
docker run -d -p 5000:80 --name khmer-cnn khmer-cnnIn this case, the application will also be available at http://localhost:5000
To train the model, use the model.pynb Jupyter notebook. This notebook will save the trained model to my_model.h5 and the label encoder to label_encoder.pkl.
You can run the notebook using Jupyter Notebook:
model.ipynbThe pretrained model has achieved a test accuracy of 95% .
- Ensure the necessary system dependencies for running Flask and Docker are installed.
- If you make any changes to the model or requirements, remember to rebuild the Docker image.
This project is licensed under the MIT License - see the LICENSE file for details.