Browse Source

Transition from CPU backend to WASM backend

v1
Araragi 2 years ago
parent
commit
64171fd26d
  1. 45299
      chrome/dist/main.js
  2. 2
      chrome/manifest.json
  3. 45299
      firefox/dist/main.js
  4. 2
      firefox/manifest.json
  5. 2
      firefox_update.json
  6. 3
      jkcs-0.21.xpi
  7. 3
      package.json
  8. 22
      pnpm-lock.yaml
  9. 8
      src/main.js

45299
chrome/dist/main.js

File diff suppressed because one or more lines are too long

2
chrome/manifest.json

@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "JannySkillersCaptchaSolver",
"description": "The Janny Skillers Captcha Solver of choice.",
"version": "0.19",
"version": "0.21",
"icons": {
"64": "1449696017588.png"
},

45299
firefox/dist/main.js

File diff suppressed because one or more lines are too long

2
firefox/manifest.json

@ -8,7 +8,7 @@
},
"name": "JannySkillersCaptchaSolver",
"description": "The Janny Skillers Captcha Solver of choice.",
"version": "0.20",
"version": "0.21",
"icons": {
"64": "1449696017588.png"
},

2
firefox_update.json

@ -1 +1 @@
{"addons":{"{[email protected]}":{"updates":[{"version":"0.20","update_link":"https://git.coom.tech/araragi/JKCS/raw/branch/master/jkcs-0.20.xpi"}]}}}
{"addons":{"{[email protected]}":{"updates":[{"version":"0.21","update_link":"https://git.coom.tech/araragi/JKCS/raw/branch/master/jkcs-0.21.xpi"}]}}}

3
jkcs-0.21.xpi

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d5b5485e33288022641d781f4d910995e83339637745734c3d9a336668f7ed77
size 9545480

3
package.json

@ -16,7 +16,8 @@
"author": "/cumg/, formerly AUTOMATIC",
"license": "ISC",
"dependencies": {
"@tensorflow/tfjs": "^3.19.0"
"@tensorflow/tfjs": "^3.19.0",
"@tensorflow/tfjs-backend-wasm": "^3.19.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.32.0",

22
pnpm-lock.yaml

@ -2,7 +2,7 @@ lockfileVersion: 5.4
specifiers:
'@tensorflow/tfjs': ^3.19.0
'@types/tampermonkey': ^4.0.5
'@tensorflow/tfjs-backend-wasm': ^3.19.0
'@typescript-eslint/eslint-plugin': ^5.32.0
crx: ^5.0.1
esbuild: ^0.14.53
@ -17,9 +17,9 @@ specifiers:
dependencies:
'@tensorflow/tfjs': 3.19[email protected]
'@tensorflow/tfjs-backend-wasm': 3.19.0_hek32lflchivueqv5i4vgonghu
devDependencies:
'@types/tampermonkey': 4.0.5
'@typescript-eslint/eslint-plugin': 5.32.0_iosr3hrei2tubxveewluhu5lhy
crx: 5.0.1
esbuild: 0.14.53
@ -295,6 +295,16 @@ packages:
seedrandom: 3.0.5
dev: false
/@tensorflow/tfjs-backend-wasm/3.19.0_hek32lflchivueqv5i4vgonghu:
resolution: {integrity: sha512-qNvFi77BSvQiFxHFgWl6B3GJ8IbGVUn6jLfiHibqKI9dEmbVIN1dBiOJdbJT+lJZPlJv+vKyW9jgpVUM7QtfnQ==}
peerDependencies:
'@tensorflow/tfjs-core': 3.19.0
dependencies:
'@tensorflow/tfjs-backend-cpu': 3.19.0_hek32lflchivueqv5i4vgonghu
'@tensorflow/tfjs-core': 3.19.0
'@types/emscripten': 0.0.34
dev: false
/@tensorflow/tfjs-backend-webgl/3.19.0_hek32lflchivueqv5i4vgonghu:
resolution: {integrity: sha512-2HTkAE21t3WQTt8P6iK80ni03AzC8UNZmbIB7/pBDYBbhDwZwe/C5fXrJWnP9m6u4hvCdMAJ3o+OP3NeaEL1pw==}
engines: {yarn: '>= 1.3.2'}
@ -386,6 +396,10 @@ packages:
'@types/responselike': 1.0.0
dev: true
/@types/emscripten/0.0.34:
resolution: {integrity: sha512-QSb9ojDincskc+uKMI0KXp8e1NALFINCrMlp8VGKGcTSxeEyRTTKyjWw75NYrCZHUsVEEEpr1tYHpbtaC++/sQ==}
dev: false
/@types/http-cache-semantics/4.0.1:
resolution: {integrity: sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==}
dev: true
@ -440,10 +454,6 @@ packages:
resolution: {integrity: sha512-AnxLHewubLVzoF/A4qdxBGHCKifw8cY32iro3DQX9TPcetE95zBeVt3jnsvtvAUf1vwzMfwzp4t/L2yqPlnjkQ==}
dev: false
/@types/tampermonkey/4.0.5:
resolution: {integrity: sha512-FGPo7d+qZkDF7vyrwY1WNhcUnfDyVpt2uyL7krAu3WKCUMCfIUzOuvt8aSk8N2axHT8XPr9stAEDGVHLvag6Pw==}
dev: true
/@types/webgl-ext/0.0.30:
resolution: {integrity: sha512-LKVgNmBxN0BbljJrVUwkxwRYqzsAEPcZOe6S2T6ZaBDIrFp0qu4FNlpc5sM1tGbXUYFgdVQIoeLk1Y1UoblyEg==}
dev: false

8
src/main.js

@ -1,11 +1,15 @@
import * as tf from '@tensorflow/tfjs'
import modelJSON from './model.json'
import { setWasmPaths } from '@tensorflow/tfjs-backend-wasm'
import charsetJSON from './charset.json'
import modelJSON from './model.json'
import weightsData from './model.weights.bin'
let model
tf.setBackend('cpu')
tf.enableProdMode()
// tf.enableDebugMode()
setWasmPaths('https://unpkg.com/@tensorflow/[email protected]/dist/') // TODO: Figure out how the fuck to load the WASM modules locally from the extension.
tf.setBackend('wasm')
function toggle (obj, v) {
if (v) obj.style.display = ''

Loading…
Cancel
Save