Done for GeoAI Internship at GeoWorks, Singapore Land Authority.
Three Models used:
- OpenCV OCR
- EAST (Tensorflow Implementation)
- FOTS - Fast Oriented Text Spotting with a Unified Network
💻1️⃣💻
- Clone GitHub Repository / Download & unzip ZIP file named ‘OpenCV OCR’
- Activate Virtual Environment and go to the directory where the OpenCV OCR folder is
- Install the required dependencies (requirements.txt)
pip install -r requirements.txt
- Download the EAST text detection pb file and put it in the same folder as the py file.
Download the pb file from this link
- Initiate Xming (to enable SSH X11 Forwarding), if you are using WSL Ubuntu also.
- Run the command
python3 text_recognition_test.py --east frozen_east_text_detection.pb --image images/img6.jpg
💻2️⃣💻
- Clone GitHub Repository / Download & unzip ZIP file named ‘EAST’
- Activate Virtual Environment and go to the directory where the EAST is
- Install the required dependencies (requirements_venv.txt)
pip install -r requirements_venv.txt
- Download the pre-trained models and put it into a folder with the name of the checkpoint_path
- Run the command
python eval.py --test_data_path=images_test/ --gpu_list=0 --checkpoint_path=east_icdar2015_resnet_v1_50_rbox/ \--output_dir=result/
💻3️⃣💻
- Clone GitHub Repository / Download & unzip ZIP file named ‘FOTS’
- Activate Virtual Environment and go to the directory where the FOTS is
- Install the required dependencies (requirements_FOTS.txt)
pip install -r requirements_FOTS.txt
- Download the pre-trained model and put it into a folder with the name of the checkpoint_path
- Run the command
python3 main_test.py --gpu_list='0' --test_data_path=images_test/ --checkpoint_path=checkpoints/
Features of Flask Application:
- FOTS: Spot Scene Text in the picture
- Extract GeoTAGS (GPS Info/Coordinates) of the picture
- OneMap API: Reverse Geocoding to get Address of the picture
- OneMap API: Static Map of the Address of the picture
In the process of choosing the scene text recognition/spotting model (FOTS), I have chosen some criteria such as:
- Implementation uses Tensorflow and Python (familiarity)
- Able to produce rotated bounding boxes
- Able to SPOT scene text, meaning both detect and recognize scene text
- Model able to be trained using ICDAR Datasets
- Usage is the same as Usage of FOTS (Test)
- Run the command
python3 app_geo.py
Thank you to the team at GeoWorks, Singapore Land Authority!