-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstructions.txt
58 lines (35 loc) · 1.66 KB
/
instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#Python-3.7.5
pip install -r requirements.txt
To generate annotations for image dir (saves "<image_filename> <predicted_text>" into the output file):
./my_run.sh <Image_Dir> <Output_File_Path>
To run the web app
1. Using default model:
python app.py ./exported-model/default-model
2. Using modified model:
python app.py ./exported-model/custom-model
=================================================
TO TEST ALL FILES AND PROCEDURES
--------------------------------
pip install -r requirements.txt
pip install -r ./text_renderer/requirements.txt
pip install ./attention-ocr/
To test model-checkpoints:
--------------------------
1. To test default model:
1.1. Add the checkpoint file path to the "checkpoint" file in model-path
eg. model_checkpoint_path: "model.ckpt-8200"
must be present in checkpoint file in <checkpoints_dir>
1.2. aocr test --target-embedding-size 20 --use-gru --model-dir <default_model_checkpoints_dir> <test_filename>.tfrecords
2. To test custom model:
2.1. Add the checkpoint file path to the "checkpoint" file in model-path
eg. model_checkpoint_path: "model.ckpt-24960"
2.2. aocr test --target-embedding-size 20 --custom-cnn --model-dir <xustom_model_checkpoints_dir> <test_filename>
eg. aocr test --target-embedding-size 20 --custom-cnn --model-dir ./checkpoints ./datasets/new-test.tfrecords
To generate images
------------------
1. Make changes to text_renderer/generate_images.sh according to number of images to generate.
2. Run text_renderer/generate_images.sh
3. The images will be saved in text_renderer/output/default
To generate tfrecords
---------------------
aocr dataset <annotations_file_path> <dataset_filename_to_save.tfrecords>