mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-04-16 08:58:01 -04:00
use tesseract instead of gocr
Signed-off-by: hrj <harshad.rj@gmail.com>
This commit is contained in:
parent
b765399f68
commit
1ff4a30da7
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -21,4 +21,4 @@ jobs:
|
|||||||
- name: Run linter
|
- name: Run linter
|
||||||
run: sbt "scalafixAll --check"
|
run: sbt "scalafixAll --check"
|
||||||
- name: Run locust tests
|
- 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
|
||||||
|
@ -54,7 +54,8 @@ class QuickStartUser(SequentialTaskSet):
|
|||||||
mediaFileName = "tests/test-%s.png" % uuid
|
mediaFileName = "tests/test-%s.png" % uuid
|
||||||
with open(mediaFileName, "wb") as f:
|
with open(mediaFileName, "wb") as f:
|
||||||
f.write(media)
|
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()
|
ocrAnswer = ocrResult.stdout.readlines()[0].strip().decode()
|
||||||
return ocrAnswer
|
return ocrAnswer
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user