Skip to content

Commit

Permalink
Merge branch 'docs/dev-instructions'
Browse files Browse the repository at this point in the history
Add dev setup instructions
  • Loading branch information
blueaxis authored Jan 7, 2023
2 parents 3a3c30d + 3b29461 commit ca411a1
Show file tree
Hide file tree
Showing 4 changed files with 300 additions and 203 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

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


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

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


## User Guide <a name="user_guide"></a>
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.

### Installation <a name = "installation"></a>
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`.

For developers, clone this repo and install requirements: `pip install -r requirements.txt`. Run the app in the command line using `python main.py`.

### System Requirements

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

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


## Acknowledgements <a name = "acknowledgements"></a>
This project will not be possible without the MangaOCR model by [Maciej Budyś](https://github.com/kha-white).
Expand Down
102 changes: 102 additions & 0 deletions build/main.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# -*- mode: python ; coding: utf-8 -*-
from PyInstaller.utils.hooks import collect_data_files
from PyInstaller.utils.hooks import copy_metadata

datas = []
datas += collect_data_files('unidic_lite')
datas += collect_data_files('manga_ocr')
datas += copy_metadata('tqdm')
datas += copy_metadata('regex')
datas += copy_metadata('requests')
datas += copy_metadata('packaging')
datas += copy_metadata('filelock')
datas += copy_metadata('numpy')
datas += copy_metadata('tokenizers')

local_files = [
('../app/assets', './assets')
]


block_cipher = None


a = Analysis(['../app/main.py'],
pathex=['../app'],
binaries=[],
datas=datas+local_files,
hiddenimports=[
'pynput.keyboard._xorg',
'pynput.mouse._xorg',
'pynput.keyboard._win32',
'pynput.mouse._win32'
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)


PATH_TO_TORCH_LIB = "torch\\lib\\"
excluded_files = [
'asmjit.lib',
'c10.lib',
'clog.lib',
'cpuinfo.lib',
'dnnl.lib',
'caffe2_detectron_ops.dll',
'caffe2_detectron_ops.lib',
'caffe2_module_test_dynamic.dll',
'caffe2_module_test_dynamic.lib',
'caffe2_observers.dll',
'caffe2_observers.lib',
'Caffe2_perfkernels_avx.lib',
'Caffe2_perfkernels_avx2.lib',
'Caffe2_perfkernels_avx512.lib',
'fbgemm.lib',
'kineto.lib',
'libprotobuf-lite.lib',
'libprotobuf.lib',
'libprotoc.lib',
'mkldnn.lib',
'pthreadpool.lib',
'shm.lib',
'torch.lib',
'torch_cpu.lib',
'torch_python.lib',
'XNNPACK.lib',
'_C.lib'
]
excluded_files = [PATH_TO_TORCH_LIB + x for x in excluded_files]
a.datas = [x for x in a.datas if not x[0] in excluded_files]


exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='Cloe',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon="../app/assets/images/icons/logo.ico")
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='app')
Loading

0 comments on commit ca411a1

Please sign in to comment.