Skip to content

Commit ca411a1

Browse files
authored
Merge branch 'docs/dev-instructions'
Add dev setup instructions
2 parents 3a3c30d + 3b29461 commit ca411a1

File tree

4 files changed

+300
-203
lines changed

4 files changed

+300
-203
lines changed

README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<p align="center"> Snipping utility for the MangaOCR model </p>
99

10+
1011
## Contents
1112
- [About](#about)
1213
- [User Guide](#user_guide)
@@ -18,21 +19,25 @@ Inspired by [Capture2Text](http://capture2text.sourceforge.net/), Cloe is a snip
1819

1920
https://user-images.githubusercontent.com/45705751/166183555-ef11bf64-9cea-4c04-8a71-2293065d644c.mp4
2021

22+
2123
## User Guide <a name="user_guide"></a>
2224
Launch the application and wait for the model to load. Show the snipping window using shortcut `Alt+Q` and drag and hold the mouse cursor to start performing OCR.
2325

2426
### Installation <a name = "installation"></a>
2527
Download the latest zip file [here](https://github.com/bluaxees/Cloe/releases/latest/). Decompress the file in the desired directory. Make sure that the `app` folder is in the same folder as the shortcut `Cloe`.
2628

27-
For developers, clone this repo and install requirements: `pip install -r requirements.txt`. Run the app in the command line using `python main.py`.
28-
2929
### System Requirements
3030

3131
Recommended:
3232
- Hard drive: at least 700 MB HD space
3333
- RAM: at least 2 GB (recommended)
3434

35-
For developers, the following Python versions are supported: 3.7, 3.8, and 3.9.
35+
### Development Setup
36+
- Install [poetry](https://python-poetry.org/docs/#installation) on a supported Python version (3.8, 3.9).
37+
- Clone this repo and install dependencies by running: `poetry install --with dev`.
38+
- In the `app` directory, use `python main.py` to run the app.
39+
- If you want to build the app locally, run `pyinstaller main.spec` in the `build` directory.
40+
3641

3742
## Acknowledgements <a name = "acknowledgements"></a>
3843
This project will not be possible without the MangaOCR model by [Maciej Budyś](https://github.com/kha-white).

build/main.spec

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
from PyInstaller.utils.hooks import collect_data_files
3+
from PyInstaller.utils.hooks import copy_metadata
4+
5+
datas = []
6+
datas += collect_data_files('unidic_lite')
7+
datas += collect_data_files('manga_ocr')
8+
datas += copy_metadata('tqdm')
9+
datas += copy_metadata('regex')
10+
datas += copy_metadata('requests')
11+
datas += copy_metadata('packaging')
12+
datas += copy_metadata('filelock')
13+
datas += copy_metadata('numpy')
14+
datas += copy_metadata('tokenizers')
15+
16+
local_files = [
17+
('../app/assets', './assets')
18+
]
19+
20+
21+
block_cipher = None
22+
23+
24+
a = Analysis(['../app/main.py'],
25+
pathex=['../app'],
26+
binaries=[],
27+
datas=datas+local_files,
28+
hiddenimports=[
29+
'pynput.keyboard._xorg',
30+
'pynput.mouse._xorg',
31+
'pynput.keyboard._win32',
32+
'pynput.mouse._win32'
33+
],
34+
hookspath=[],
35+
hooksconfig={},
36+
runtime_hooks=[],
37+
excludes=[],
38+
win_no_prefer_redirects=False,
39+
win_private_assemblies=False,
40+
cipher=block_cipher,
41+
noarchive=False)
42+
pyz = PYZ(a.pure, a.zipped_data,
43+
cipher=block_cipher)
44+
45+
46+
PATH_TO_TORCH_LIB = "torch\\lib\\"
47+
excluded_files = [
48+
'asmjit.lib',
49+
'c10.lib',
50+
'clog.lib',
51+
'cpuinfo.lib',
52+
'dnnl.lib',
53+
'caffe2_detectron_ops.dll',
54+
'caffe2_detectron_ops.lib',
55+
'caffe2_module_test_dynamic.dll',
56+
'caffe2_module_test_dynamic.lib',
57+
'caffe2_observers.dll',
58+
'caffe2_observers.lib',
59+
'Caffe2_perfkernels_avx.lib',
60+
'Caffe2_perfkernels_avx2.lib',
61+
'Caffe2_perfkernels_avx512.lib',
62+
'fbgemm.lib',
63+
'kineto.lib',
64+
'libprotobuf-lite.lib',
65+
'libprotobuf.lib',
66+
'libprotoc.lib',
67+
'mkldnn.lib',
68+
'pthreadpool.lib',
69+
'shm.lib',
70+
'torch.lib',
71+
'torch_cpu.lib',
72+
'torch_python.lib',
73+
'XNNPACK.lib',
74+
'_C.lib'
75+
]
76+
excluded_files = [PATH_TO_TORCH_LIB + x for x in excluded_files]
77+
a.datas = [x for x in a.datas if not x[0] in excluded_files]
78+
79+
80+
exe = EXE(pyz,
81+
a.scripts,
82+
[],
83+
exclude_binaries=True,
84+
name='Cloe',
85+
debug=False,
86+
bootloader_ignore_signals=False,
87+
strip=False,
88+
upx=True,
89+
console=False,
90+
disable_windowed_traceback=False,
91+
target_arch=None,
92+
codesign_identity=None,
93+
entitlements_file=None,
94+
icon="../app/assets/images/icons/logo.ico")
95+
coll = COLLECT(exe,
96+
a.binaries,
97+
a.zipfiles,
98+
a.datas,
99+
strip=False,
100+
upx=True,
101+
upx_exclude=[],
102+
name='app')

0 commit comments

Comments
 (0)