一則手寫漢字識別應用介紹

項目

https://github.com/fanqingsong/cnn_handwritten_chinese_recognitionjavascript

    使用python+flask搭建的一個網站,而後從網頁的寫字板上獲取鼠標手寫的漢字通過轉碼後傳回後臺,並通過圖片裁剪處理以後傳入CNN手寫中文識別的模型中進行識別,最後經過PIL將識別結果生成圖片,最後異步回傳給web端進行識別結果展現。中文總共50,000多漢字,經常使用的有3,755個。這裏主要對常見的3755個漢字進行識別。java

 

使用技術

前臺:python

一、 drawingboard.js 在canvas上手寫漢字git

      並能夠獲取canvas手寫漢字的圖片編碼 base64github

二、 手寫過程監控事件,實時收集canvas圖片數據,經過ajax發日後臺進行識別。web

 

後臺:ajax

一、 flask -- web服務器框架flask

二、 tensorflow --- 加載漢字識別模型, 並根據輸入的圖片數據給出預測結果, 取最可能的前三個發往前臺。canvas

 

drawingboard

http://leimi.github.io/drawingboard.js/服務器

This is a canvas based drawing app that you can integrate easily on your website.

drawingboard.js consists of a blank canvas surrounded by a few UI elements that control it: a color picker, a pencil, a paint can, an eraser, a pencil size chooser, navigations and reset buttons.

You can draw with mouse or touch on pretty much every browser that supports <canvas>. Didn't test that much on IE but hey, WIP.

local and session storage are supported: your last drawing is restored when you come back on the website.

You can set a background image at initialization, or let the user drop one on the canvas.

The drawingboard is really lightweight, but also really simple: if you want something more complete, go look at similar projects at the bottom of this doc.

相關文章
相關標籤/搜索