Skip to content

Tools for handling un-labeled training images for Angelina Braille Reader

License

Notifications You must be signed in to change notification settings

braille-systems/brl_data_tools

Repository files navigation

brl_data_tools

Actions Status Code Coverage CodeFactor License

Tools for handling un-labeled training images for Angelina Braille Reader

Requirements

  • Linux Ubuntu or CygWin (other: not tested)
  • Git + Git LFS
  • Python 3.8

setup

substitute python with your system's Python3.8 command (may be python3, py3, etc).

Get the source code and pre-trained weights for the neural net:

git clone --recursive https://github.com/braille-systems/brl_data_tools.git
cd brl_data_tools
wget -O AngelinaReader/weights/model.t7 http://angelina-reader.ovdv.ru/retina_chars_eced60.clr.008
mkdir data

Then download data from Kaggle (https://www.kaggle.com/valeryzuev/unlabeled-braille-photos) and unzip to data directory that you've just created.

Then set up Python virtual environment:

python -m pip install --upgrade pip
python -m pip install virtualenv
python -m venv env
source env/bin/activate # CygWin: source env/Scripts/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

processing data

renaming and cropping

export PYTHONPATH=.
source env/bin/activate # CygWin: source env/Scripts/activate
python scripts/rename.py
python scripts/crop.py

pseudolabeling

python AngelinaReader/run_local.py data/2_renamed data/3_pseudolabeled -l EN -o --save_dev

pre-processing text files for alignment

python scripts/preprocess_text.py
python scripts/find_regions_of_interest.py

performing alignment & calculating statistics

python scripts/needleman_wunsch.py
python scripts/postprocess_text.py

saving not corrected, but filtered pseudo-labeled samples

python scripts/split_test_train.py
python scripts/filter_by_freq.py
python scripts/split_test_train.py

semi-supervised learning

setup

cd AngelinaReader
git clone --recursive https://github.com/braille-systems/brl_ocr.git
cd ..

naive SSL

source env/bin/activate # CygWin: source env/Scripts/activate
python scripts/split_test_train.py
cd AngelinaReader
# you may want to tweak `batch_size` in model/params.py
python model/train.py

Releases

No releases published