News for hackers. Stuff that matters.
Re:Pico.js, a face-detection library in 200 lines of JavaScript by charcircuit on Tuesday October 11, 2022 @11:47AM (#33164796)
200 LOC is misleading since it requires you to download a model separately to use it.
Re:Pico.js, a face-detection library in 200 lines of JavaScript by sbf501 on Tuesday October 11, 2022 @12:31PM (#33165409)
Here are the models it downloads (in webcam.html)

    var cascadeurl = 'https://raw.githubusercontent.com/nenadmarkus/pico/c2e81f9d23cc11d1a612fd21e4f9de0921a5d0d9/rnt/cascades/facefinder';
    var puplocurl = 'https://drone.nenadmarkus.com/data/blog-stuff/puploc.bin'
The former is 234 KB, the latter is 1.4 MB
Re:Pico.js, a face-detection library in 200 lines of JavaScript by elteto on Tuesday October 11, 2022 @02:29PM (#33167124)
Is the model code? Or just data? Because if it’s just data and the library truly only needs 200 LOC to work with that model then it’s fair to say that it is a 200 LOC only library.

I can write a naive spell checker in a few dozen lines of Python, say 100 lines. I’ll need a dictionary file for it to be useful though. Would you claim my code is 100 lines or 50100 (assuming dict file has 50k words) lines?

Re:Pico.js, a face-detection library in 200 lines of JavaScript by userbinator on Tuesday October 11, 2022 @06:43PM (#33170217)
The latter, because in this case the bulk of the "what is a face" function is determined by that data.
Re:Pico.js, a face-detection library in 200 lines of JavaScript by liuliu on Tuesday October 11, 2022 @07:56PM (#33170860)
HAAR Cascading based face detectors are subpar to neural-network based ones. It is better to just use TF.js and related face detector. These are faster and much more accurate.

(I wrote JS-based face detector a decade ago: https://liuliu.me/eyes/javascript-face-detection-explained/)

Re:Pico.js, a face-detection library in 200 lines of JavaScript by rsrsrs86 on Tuesday October 11, 2022 @11:25PM (#33172426)
While reading the post, it didn’t strike me as odd. I worked with small services wrapping ML models and 200 lines looks very slick and I don’t recall anyone considering weights as part of the code, and even the model training code is treated differently that the cliente code. Seems legit