|
@ -1,34 +1,9 @@ |
|
|
// eslint-disable-next-line import/no-unassigned-import
|
|
|
// eslint-disable-next-line import/no-unassigned-import
|
|
|
import * as tf from '@tensorflow/tfjs' |
|
|
import * as tf from '@tensorflow/tfjs' |
|
|
|
|
|
|
|
|
const charset = [ |
|
|
|
|
|
'', |
|
|
|
|
|
'0', |
|
|
|
|
|
'2', |
|
|
|
|
|
'4', |
|
|
|
|
|
'8', |
|
|
|
|
|
'A', |
|
|
|
|
|
'D', |
|
|
|
|
|
'G', |
|
|
|
|
|
'H', |
|
|
|
|
|
'J', |
|
|
|
|
|
'K', |
|
|
|
|
|
'M', |
|
|
|
|
|
'N', |
|
|
|
|
|
'P', |
|
|
|
|
|
'Q', |
|
|
|
|
|
'R', |
|
|
|
|
|
'S', |
|
|
|
|
|
'T', |
|
|
|
|
|
'V', |
|
|
|
|
|
'W', |
|
|
|
|
|
'X', |
|
|
|
|
|
'Y' |
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
let model |
|
|
let model |
|
|
|
|
|
|
|
|
tf.setBackend('cpu') // takes too long with webgl backend
|
|
|
tf.setBackend('cpu') |
|
|
|
|
|
|
|
|
function toggle (obj, v) { |
|
|
function toggle (obj, v) { |
|
|
if (v) obj.style.display = '' |
|
|
if (v) obj.style.display = '' |
|
|