File tree Expand file tree Collapse file tree 6 files changed +12
-10
lines changed Expand file tree Collapse file tree 6 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ version: 2.1
77parameters :
88 node_version :
99 type : string
10- default : ' 16.15.0 '
10+ default : ' 18.18.2 '
1111
1212commands :
1313 install_deps :
Original file line number Diff line number Diff line change 11# Spin up and enter the docker container on your machine with the following command:
2- # docker run -it --entrypoint /bin/bash public.ecr.aws/lambda/nodejs:16-x86_64
2+ # docker run -it --entrypoint /bin/bash public.ecr.aws/lambda/nodejs:18-arm64
33
44
55# Then run the rest of the commands inside
@@ -23,7 +23,7 @@ make install
2323cd ~
2424git clone https://github.com/tesseract-ocr/tesseract.git
2525cd tesseract
26- git checkout 5.1.0
26+ git checkout 5.3.3
2727export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
2828./autogen.sh
2929./configure
@@ -61,6 +61,6 @@ strip ./tesseract-standalone/**/*
6161tar -zcvf tesseract.tar.gz tesseract-standalone
6262
6363# download from docker to local machine
64- # 22e97e0774a0 is docker container id, you can look it up by running "docker ps"
64+ # d1c431e8c85e is docker container id, you can look it up by running "docker ps"
6565# run this outside of the docker container
66- docker cp 22e97e0774a0 :/root/tesseract.tar.gz tt.tar.gz
66+ docker cp d1c431e8c85e :/root/tesseract.tar.gz tt.tar.gz
Original file line number Diff line number Diff line change 5757 "@shelf/eslint-config" : " 3.10.0" ,
5858 "@shelf/prettier-config" : " 1.0.0" ,
5959 "@types/jest" : " 29.5.7" ,
60- "@types/node" : " 16 " ,
60+ "@types/node" : " 18 " ,
6161 "@types/tar" : " 6.1.7" ,
6262 "eslint" : " 8.48.0" ,
6363 "husky" : " 8.0.3" ,
6767 "typescript" : " 5.2.2"
6868 },
6969 "engines" : {
70- "node" : " >=16 "
70+ "node" : " >=18 "
7171 },
7272 "publishConfig" : {
7373 "access" : " public"
Original file line number Diff line number Diff line change 11# aws-lambda-tesseract [ ![ CircleCI] ( https://circleci.com/gh/shelfio/aws-lambda-tesseract/tree/master.svg?style=svg )] ( https://circleci.com/gh/shelfio/aws-lambda-tesseract/tree/master ) ![ ] ( https://img.shields.io/badge/code_style-prettier-ff69b4.svg ) [ ![ Tesseract] ( https://img.shields.io/badge/tesserract-6_MB-brightgreen.svg )] ( bin/ )
22
3- > 6 MB Tesseract 5.1 (with English training data) to fit inside AWS Lambda
3+ > 6 MB Tesseract 5.3.3 (with English training data) to fit inside AWS Lambda
44
55Inspired by [ chrome-aws-lambda] ( https://github.com/alixaxel/chrome-aws-lambda ) & [ lambda-scanner-ocr] ( https://github.com/philippkeller/lambda-scanner-ocr )
66
@@ -18,9 +18,11 @@ $ yarn add @shelf/aws-lambda-tesseract
1818
1919` 4.x ` works for Node 16.x runtime and compiled with ** Tesseract 5.1.0** . It works with x86_64 CPUs for now only.
2020
21+ ` 5.x ` works for Node 18.x runtime and compiled with ** Tesseract 5.3.3** . It works with arm64 CPUs.
22+
2123## How does it work?
2224
23- This package contains an archive with [ Tesseract 5.1 ] ( https://github.com/tesseract-ocr/tesseract ) compiled for usage in AWS Lambda environment.
25+ This package contains an archive with [ Tesseract 5.3.3 ] ( https://github.com/tesseract-ocr/tesseract ) compiled for usage in AWS Lambda environment.
2426
2527When a Lambda starts, it unpacks an archive with a binary to the ` /tmp ` folder and makes sure it's done only once per Lambda cold start.
2628
Original file line number Diff line number Diff line change @@ -12,5 +12,5 @@ yarn babel test.ts --out-file test.js
1212docker run --rm \
1313 -v " $PWD " :/var/task \
1414 -p 9000:8080 \
15- public.ecr.aws/lambda/nodejs:16-x86_64 \
15+ public.ecr.aws/lambda/nodejs:18-arm64 \
1616 test.handler
You can’t perform that action at this time.
0 commit comments