DaKanji-Desktop icon indicating copy to clipboard operation
DaKanji-Desktop copied to clipboard

A Qt and Tensorflow app that recognizes kanji characters which the user can hand draw.

Important!

I reimplmented DaKanji in dart and flutter therefore this repository will not be updated anymore. All new releases for DaKanji will be published in this repo which merges the desktop and the mobile version.

DaKanji-Desktop

English badge

What is this?

A simple app which can predict Japanese kanji characters which were drawn by hand. The predictions can than be copied and used elsewhere.
Currently ~3000 kanji characters are supported.
The mobile version can be found here.

What the users say:

  • "Your program is like magic! Thank you so much!" - saszai2
  • "Well thank you for this software! It seems to try and guess in a more "guess-y" way than jisho and even Google which is usually pretty good at guessing, and it just saved me today!" - princess_daphie
  • "... I tried the program for the same kanji [some kanji], not only did all of them work but it was able to guess what I was going for before I finished too." - swolenkamel

Getting started

Running / installing the app

This is the recommended way of using the application.

Windows

The easiest way of using the app is from the Microsoft Store. It is easy to install and has a fast startup.

But you can also use the DaKanji_win_vx.x_portable.zip it is only one file and can be executed directly. But it has a much slower startup.

Ubuntu 20.04

Download the latest release here and just run it.

MacOS

Download the latest release here and put it in you applications-folder.

Running from source

Note: Windows (10), Linux (Ubuntu 20.4) and MacOS are currently supported.

You can install all packages from the 'requirements.txt' (it is recommended to do this in a separate environment):

python -m pip install -r requirements.txt

Now the tensorflow lite models need to be downloaded and placed in the data folder. They are available in the DaKanji-ML repo.
Finally you should be able to run the application with:

python .\src\main.py

Usage

Draw a character and the app tries to classify it. The predictions can be copied to the system clipboard by clicking on the buttons.

A long press will open the predited character in a web dictionary. On the settings page the URL of a dictionary can be entered (default is jisho).

How to set the URL: The app will replace a placeholder in the URL with the predicted character.
This placeholder is: %X%

Example:
The predicted character is: '口' and you want to open it on 'jisho.org'. First you have to get the URL of the website for searching. In this case: 'https://jisho.org/search/口'. Now only the character in the URL has to be replaced with the placeholder. This leads to 'https://jisho.org/search/%X%'.
When long pressing a button the prediction will be opened in this dictionary.

Development Notes

Python 3.8 with Qt (PySide2) was used for development. See "running from source" for setting up the environment.
The Machine learning part of this project can be found in this repository.

Packaging the application

PyInstaller

For freezing the app with PyInstaller you have to run the 'build'-script in the main folder (make sure PyInstaller is installed because it is not included in the requirements.txt):

.venv_rel\Scripts\python.exe build.py

The script automatically detects the platform and outputs an executable for the system.

Windows Specific

To publish the application to the Microsoft store it needs to be in the .msix format. To do this first the app needs to be converted from the PyInstaller executable to an .exe installer (see PyInstaller section).
After this a setup-exe needs to be created. For this Inno Setup Compiler was used. The create_windows_installer.iss contains all definitions for Inno to create build\Windows\DaKanji-setup.exe.
Now with the MSIX packaging tool a .msix can be created.

Next steps and ideas

If you want to suggest a new feature feel free to open a new issue.

Common issues

  • on Ubuntu 20.04 LTS exists a bug in PySide2 and the following command needs to be run to install dependencies:
sudo apt-get install -y libxcb-xinerama0

Credits

  • design, UI and MacOS version: Massive shout out to nurellina Without your help the app would not look and feel half as good as it does now.
  • Icons were taken from the material icon set.
  • icon/banner:
    • Thanks "Buddha, with kudos to 2ch/fl/ and HatNyan" for helping with the icon design and making the banner. Also thank you Adrian Jordanov for the banner font.