Installation Guide
The following installation guide is for Debian-based and Ubuntu-based Linux system with GPU enabled.

Step 1: Install Software Prerequisite via terminal

1
sudo apt-get update && sudo apt-get install curl nano htop unzip -y
Copied!

Step 2: Turn-off Swap Memory

We will enter the super user mode, command to turn off the swap memory, and exit the super user mode. Finally we launch htop command to confirm that that the swap memory is already turned off.
1
sudo su -
2
swapoff -a
3
exit
4
htop
Copied!
Swp = 0K/0K at the last line of this image means the swap memory is successfully turned off.
Control-c to go back to terminal

Step 3: Docker-CE Installation

If you already have docker engine installed, you can skip this step.
1
curl -fsSL https://get.docker.com -o get-docker.sh
2
sudo sh get-docker.sh
Copied!
You can run the following command to check if the docker is successfully installed.
1
sudo docker run hello-world
Copied!

Step 4: Docker-Compose Installation

If you already have docker compose installed, you can skip this step.
1
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
2
sudo chmod +x /usr/local/bin/docker-compose
Copied!

Step 5: Nvidia GPU Driver Installation

To install Nvidia GPU driver use the command below.
1
sudo ubuntu-drivers devices
2
sudo ubuntu-drivers autoinstall
3
sudo shutdown -r now
Copied!

Step 6: Nvidia-Docker Installation

You can install nvidia-docker with the following command.
1
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
2
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
3
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
4
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit nvidia-docker2
5
sudo systemctl restart docker
Copied!

Step 7: Enable Nvidia-Docker

Edit the daemon.json file to support nvidia-docker.
1
sudo nano /etc/docker/daemon.json
Copied!
Add the following text below. If there are existing text replace it with the provided text below.
1
{
2
"runtimes": {
3
"nvidia": {
4
"path": "nvidia-container-runtime",
5
"runtimeArgs": []
6
}
7
},
8
"default-runtime": "nvidia"
9
}
Copied!
Press CTRL+x to exit editor, and then y to save the file.
Then run the following line.
1
sudo systemctl restart docker
2
docker run --rm nvidia/cuda:9.0-base nvidia-smi
Copied!
In the printed out table there must be the name of the graphic card installed in the server
Example Results from nvidia-smi

Step 8: Deploy Thai National ID Card OCR Docker image

You can purchase our on-premise license by contacting us at [email protected] or call +6686-322-5858. Once you purchase our On-Premise license, You will received the Thai National ID Card Docker image from us in the zip file. It contains two files.
1
unzip thai_id_ocr_op_v3.4.3.zip
2
Archive: thai_id_ocr_op_v3.4.3.zip
3
inflating: docker-compose.yml
4
inflating: thai_id_ocr_op_v3.4.3.docker_image.tar
Copied!
Enter the extracted directory. You can easily install it by typing the following command
1
docker load -i thai_id_ocr_op_v3.4.3.docker_image.tar
2
nano docker-compose.yml
Copied!
1
mkdir config
Copied!
Open website to start using the service at http://localhost:8000
Last modified 2mo ago