use tesseract instead of gocr

Signed-off-by: hrj <harshad.rj@gmail.com>
This commit is contained in:
hrj 2021-04-13 13:42:34 +05:30
parent b765399f68
commit 1ff4a30da7
2 changed files with 3 additions and 2 deletions

View File

@ -21,4 +21,4 @@ jobs:
- name: Run linter
run: sbt "scalafixAll --check"
- name: Run locust tests
run: sudo apt-get install -y gocr && ./tests/run.sh
run: sudo apt-get install -y tesseract-ocr && ./tests/run.sh

View File

@ -54,7 +54,8 @@ class QuickStartUser(SequentialTaskSet):
mediaFileName = "tests/test-%s.png" % uuid
with open(mediaFileName, "wb") as f:
f.write(media)
ocrResult = subprocess.Popen("gocr %s" % mediaFileName, shell=True, stdout=subprocess.PIPE)
#ocrResult = subprocess.Popen("gocr %s" % mediaFileName, shell=True, stdout=subprocess.PIPE)
ocrResult = subprocess.Popen("tesseract %s stdout -l eng" % mediaFileName, shell=True, stdout=subprocess.PIPE)
ocrAnswer = ocrResult.stdout.readlines()[0].strip().decode()
return ocrAnswer