Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you help implement on node.js #57

Open
tuer12033 opened this issue Sep 16, 2020 · 1 comment
Open

Can you help implement on node.js #57

tuer12033 opened this issue Sep 16, 2020 · 1 comment

Comments

@tuer12033
Copy link

a code example in repo use for HTML so,
I can use this code on node js?
or you can tell me about the way for use

var cbl = new CBL({
    preprocess: function(img) {
        img.binarize(220);
        img.colorRegions(50);
    },
    /* Load the model we saved during training. */
    model_file: './model.txt',
    character_set: "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
    blob_min_pixels: 50,
    blob_max_pixels: 400,
    pattern_width: 25,
    pattern_height: 25,
    perceptive_colorspace: true,
    /* Define a method that fires immediately after successfully loading a saved model. */
    model_loaded: function() {
        // Don't enable the solve button until the model is loaded.
        // document.getElementById('solve').style.display = "block";
    }
});    

cbl.solve("./captcha.png").done(function (solution) {
    // Upon finding a solution, fill the solution textbox with the answer.
    console.log('====================================');
    console.log(solution);
    console.log('====================================');
});
@skotz
Copy link
Owner

skotz commented Sep 16, 2020

CBL relies on several browser objects like XMLHttpRequest and document (among others) so I'm not sure how much work it would be to update the library to support this. It's possible, just not something I've tried to implement yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants