54 lines
1.0 KiB
Markdown
54 lines
1.0 KiB
Markdown
# Init
|
|
## For dev
|
|
```bash
|
|
sudo apt install python2.7 python-pip
|
|
git clone http://gitea.beetai.com/sonnhh/engine-plate-v2-dev
|
|
cd engine-plate-v2-dev
|
|
|
|
sudo apt install -y libsm6 libxext6
|
|
pip install -r requirements.txt
|
|
python server.py
|
|
```
|
|
## For deployment
|
|
```bash
|
|
sudo apt install python2.7 python-pip libsm6 libxext6 git libxrender-dev
|
|
git clone http://gitea.beetai.com/sonnhh/engine-plate-v2-deploy
|
|
cd engine-plate-v2-deploy
|
|
pip install -r requirements.txt
|
|
python server.py
|
|
```
|
|
# API
|
|
## POST: http://localhost:8080/get-from-plate
|
|
Body (json):
|
|
```bash
|
|
{
|
|
"img64": "img-base64-string...",
|
|
"mode": "long" or "square"
|
|
"display": "full" or "row2"
|
|
}
|
|
```
|
|
Result (json):
|
|
```bash
|
|
{
|
|
"ocr": "51A-23445"
|
|
}
|
|
```
|
|
## POST: http://localhost:8080/get-from-frame
|
|
Body (json):
|
|
```bash
|
|
{
|
|
"img64": "img-base64-string...",
|
|
"mode": "long" or "square"
|
|
"display": "full" or "row2"
|
|
}
|
|
```
|
|
Result (json):
|
|
```bash
|
|
{
|
|
"ocr": "51A-23445",
|
|
"plate": "img-base64-string..."
|
|
}
|
|
```
|
|
# Config server
|
|
Config address and port in file server.py
|