Skip to content

Instantly share code, notes, and snippets.

@MahmoudMabrok
Created August 13, 2020 14:17
Show Gist options
  • Save MahmoudMabrok/81686affbeabaf21588ce7ec2dc14808 to your computer and use it in GitHub Desktop.
Save MahmoudMabrok/81686affbeabaf21588ce7ec2dc14808 to your computer and use it in GitHub Desktop.
prepare data to train OCR
for i in `seq 1001`;
do
text2image --text $i.gt.txt --outputbase /home/owner/Downloads/output/im$i --xsize 680 --ysize 200 --fonts_dir /usr/share/fonts/truetype/Amiri/ --font 'Amiri' --margin 0 --ptsize 30 --degrade_image --char_spacing 1;
done
@MahmoudMabrok
Copy link
Author

for i in `seq 100`;
 do
tesseract /home/owner/Downloads/output/$i.tif  /home/owner/Downloads/data/output$i  -l ara_number
 done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment