drunohazarb / 4chan-captcha-solver

GNU General Public License v3.0
173 stars 3 forks source link

Solver as external process #23

Open trip54654 opened 8 months ago

trip54654 commented 8 months ago

Problem: the model is huge and uses a lot of memory. The model is probably duplicated for each tab.

Solution: create the option to use an external captcha solver server on localhost. The server could be a simple nodejs or python script that serves HTTP on localhost and gets accessed by the script.

Maybe this script is even responsible for the Firefox higher memory usage I'm observing:

5,698.52 MB (79.33%) -- string(length=8560525, copies=349, "try { (function scopeWrapper(){ function userScript() { // ==UserScript==/n// @name 4chan captcha solver

But I don't know how to debug this.

Kreijstal commented 8 months ago

this tbh

trip54654 commented 4 months ago

I made a quick & dirty port to node.js. The userscript is mostly the same, except that it doesn't load tensorflow and doesn't inline the weights. It talks to the nodejs server with HTTP requests. Hoping this will fix my firefox memory leak problems.

Does anyone know answers to these questions:

  1. Why the FUCK do tensorflow for Python and JS not have exactly the same API?
  2. Why the FUCK can tensorflow on Python not load models that were made for tensorflow on JS? There's even a damn external converter program for these.
  3. Why the FUCK can tensorflow for JS not load models made with an older tensorflow for JS release? I got a loading error until I tried downgrading from 4.20.0 to 4.10.0.
trip54654 commented 4 months ago

It's pretty clear that this solves my memory leak problems.

CharAznableLoNZ commented 2 months ago

This is why the extension version was popular. It was much lighter while also quicker. However it seems it was abandoned.