Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocr stax #408

Merged
merged 21 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d9de8d3
Remove tesseract
dmorais-ledger Jul 6, 2023
2bf7889
Correctly initialize current_screen_size in FrameBuffer class
dmorais-ledger Jul 6, 2023
e39a136
Use correct background color for 4BPP
dmorais-ledger Jul 6, 2023
76413d5
Add hal_draw_image_rle in nbgl.py
dmorais-ledger Jul 6, 2023
ef0f648
Replace tesseract by fake OCR
dmorais-ledger Jul 6, 2023
2f91e00
Add API_LEVEL_11 JSON font files for Stax OCR
dmorais-ledger Jul 6, 2023
43c0982
Use instance properties instead of class properties for OCR class
dmorais-ledger Jul 25, 2023
e5da363
font_path can't be None and neither does model
dmorais-ledger Jul 25, 2023
f783e13
Convert api_level to an int in main.py
dmorais-ledger Jul 25, 2023
9825ac5
Use logging.warning instead of print
dmorais-ledger Jul 25, 2023
3044db4
Display a warning when XXgl_font_character is missing in JSON font file
dmorais-ledger Jul 25, 2023
35a792e
Add function return & variable type annotations
dmorais-ledger Jul 25, 2023
4b71c80
Merge analyze_bitmap_bagl and analyze_bitmap_nbgl into analyse_bitmap
dmorais-ledger Jul 26, 2023
4c627d0
Use imported rle_custom.py instead of pieces of it
dmorais-ledger Jul 26, 2023
86cf2ba
Fix CI issues (Linter on Python code & Type checking)
dmorais-ledger Jul 26, 2023
8a16cf8
Fix CI issues (Linter on C code)
dmorais-ledger Jul 26, 2023
f230520
Update API_LEVEL_11 related files for Stax OCR
dmorais-ledger Jul 26, 2023
5a5b543
Add API_LEVEL_12 support
dmorais-ledger Jul 6, 2023
d683d58
Tell codespell to not check speculos/fonts directory
dmorais-ledger Jul 28, 2023
8d5313b
stax-fonts-11.bin is identical to stax-fonts-9.bin => use a link
dmorais-ledger Jul 31, 2023
eb274c1
Remove --force-full-ocr parameter & update related documentation
dmorais-ledger Jul 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ __pycache__/
apps/*vault*
build/
core
TAGS
/speculos/resources/launcher
/speculos/resources/vnc_server

Expand Down
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,12 @@ COPY --from=builder /speculos/speculos/resources/ /speculos/speculos/resources/

RUN pip install --upgrade pip pipenv
RUN pipenv install --deploy --system
RUN pip install pytesseract


RUN apt-get update && apt-get install -qy \
qemu-user-static \
libvncserver-dev \
gdb-multiarch \
tesseract-ocr \
libtesseract-dev \
&& apt-get clean

RUN apt-get clean && rm -rf /var/lib/apt/lists/
Expand Down
4 changes: 1 addition & 3 deletions build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libvncserver-dev \
python3-pip \
qemu-user-static \
tesseract-ocr \
libtesseract-dev \
wget && \
apt-get clean && \
rm -rf /var/lib/apt/lists/

# There are issues with PYTHONHOME if using distro packages, use pip instead.
RUN pip3 install construct flake8 flask flask_restful jsonschema mnemonic pycrypto pyelftools pbkdf2 pytest Pillow requests pytesseract
RUN pip3 install construct flake8 flask flask_restful jsonschema mnemonic pycrypto pyelftools pbkdf2 pytest Pillow requests

# Create SHA256SUMS, download dependencies and verify their integrity
RUN \
Expand Down
3 changes: 1 addition & 2 deletions docs/installation/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ sudo apt install \
cmake gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gdb-multiarch \
python3-pyqt5 python3-construct python3-flask-restful python3-jsonschema \
python3-mnemonic python3-pil python3-pyelftools python3-requests \
qemu-user-static tesseract-ocr libtesseract-dev
qemu-user-static

pip install pytesseract
```

For optional VNC support, please also install `libvncserver-dev`:
Expand Down
3 changes: 2 additions & 1 deletion sdk/bolos_syscalls_unified_sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@
#define SYSCALL_nbgl_get_font_ID_IN 0x01fa000c
#define SYSCALL_nbgl_screen_reinit_ID_IN 0x00fa000d
#define SYSCALL_nbgl_front_draw_img_rle_legacy_ID_IN 0x00fa000e // API levels 7-8-9
#define SYSCALL_nbgl_front_draw_img_rle_ID_IN 0x04fa0010
#define SYSCALL_nbgl_front_draw_img_rle_10_ID_IN 0x04fa0010 // API level 10
#define SYSCALL_nbgl_front_draw_img_rle_ID_IN 0x05fa0010 // API level_12

#define SYSCALL_ox_bls12381_sign_ID_IN 0x05000103
#define SYSCALL_cx_hash_to_field_ID_IN 0x06000104
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def run(self):
"pyelftools>=0.27,<1.0",
"pyqt5>=5.15.2,<6.0.0",
"requests>=2.25.1,<3.0.0",
"pytesseract>=0.3.10,<0.4.0",
]
+ (["dataclasses>=0.8,<0.9"] if sys.version_info <= (3, 6) else []),
extras_require={
Expand Down
Binary file added speculos/cxlib/nanosp-api-level-cx-12.elf
Binary file not shown.
Binary file added speculos/cxlib/nanox-api-level-cx-12.elf
Binary file not shown.
Binary file added speculos/cxlib/stax-api-level-cx-12.elf
Binary file not shown.
Loading