« first day (4964 days earlier)   

6:52 AM
        "   the holy grail ‘neath Ancient roslin waits,

            adorned in masters’ loving art she lies,

            the blade and chalice Guarding o’er her gates,

            she rests at last beneath the starry skies.       "
i recently wrote a couple of utilities recently to take a video file from some source, cctv, webcam etc
and scan that file using ml5.js for people ( note not faces )
i post the code here becuase i always like to muse through some code just out of interest
<!-- serverless-local-file.html -->

<html style="height:100%">
    <head>
        <script src="https://unpkg.com/ml5@latest/dist/ml5.min.js"></script>
        <script>

        var detector;
        var process       = true;
        var abort         = false;
        var step          = 1;
        var btn;
        var video;
        var dur;
        var bar;
        var time;
        var results;
        var item;

        window.onload=async function(){
              $('#file').onclick            = select_file;
this next version uses a server to stream a video file to the browser
//server.js

        var file    = 'video.mp4';
        var port    = 4010;

        var fs      = require('fs');
        var size    = fs.statSync(file).size;

        require('http').createServer(request).listen(port);
        console.log(`localhost:${port}/`);

        function request(req,res){

              if(req.url=='/index.js'){
                    res.writeHead(200,{'content-type':'application/javascript'});
                    var fd    = fs.createReadStream('index.js');
                    fd.pipe(res);
<!-- index.html -->
<html>
    <head style="display: block;">
        <script style="display: block;" src="https://unpkg.com/ml5@latest/dist/ml5.min.js">
        </script>
        <script style="display: block;" src="index.js">
        </script>
    </head>
    <body style="font-family: arial; display: flex; flex-direction: column; height: calc(100% - 40px); margin: 20px; overflow: hidden;">
        <h3 style="margin: 0px 0px 20px; text-align: center;">
loading model, please wait ...
        </h3>
//  index.js
                                                                                console.clear();
        var detector;
        var process       = true;
        var abort         = false;
        var step          = 1;
        var btn;
        var video;
        var dur;
        var bar;
        var time;
        var results;
        var item;

        window.onload=async function(){
              btn                           = $('[value=start]')
              btn.onclick                   = click;
maybe in the future i'll update it to include face recognition
live stream with push notifications
multiple sources
some video sources :
Open Camera https://play.google.com/store/apps/details?id=net.sourceforge.opencamera
<!-- generate video.webm -->
<style>
      body {
            margin            : 30px;
            display           : flex;
            flex-direction    : column;
            align-items       : center;
            gap               : 20px;
            font-size         : 18px;
            font-family       : arial;
      }

      h3 {
            text-align        : center;
      }

      video {
            width             : 300px;
            border            : 3px solid green;
      }
github cctv/scan-video-file-with-ml5-person-detection github.com/javascript-2020/cctv/tree/main/…
this is like the main version, has added functionality for working with the video file after scanning : cctv/scan-video-file-with-ml5-person-detection/v1.0/ github.com/javascript-2020/cctv/tree/main/…
ml5js, ml5js.org
 
 
6 hours later…
12:40 PM
@ParkingMaster, in your question before about moving the circles, did you try asking an llm to produce the code
 
1:28 PM
@matt About the Future Prediction Model? No, I figured it out on my own. I attempted to ask AI to help a few times, but nonetheless, it was hopeless 😂
This is what I was planning to achieve.
 
1:53 PM
@ParkingMaster no i meant that one
not sure if it shows properly there's a link at the start of the previous message
 
2:15 PM
Yeah that's what the grid was for
I am detecting a specific atom's movement based on all other atoms around it, so I am using a 10x10 grid to simulate future prediction.
 
oh right
thats got to be some interesting code
 
Yeah, lots of math involved lol
I'm willing to do it though if it means I can learn how to predict the future :D
 
you could probably model something similar in say matter.js or some particle library that allows you to define particles connected by springs, then simlaute plucking one
 
Particle library? Never heard of it - Do you have any links to any?
 
heres matter.js brm.io/matter-js/docs
 
2:20 PM
That's pretty cool. Didin't know those existed
I could've just used one of these libraries lol
I'm going to post the code to my future prediction model if you want to take a look
(probably a little messy):
 
yeah i'll definitely take a look
i love a piece of code lol
 
Only 134 lines of code so far
 
does anyone actually want to read unhighlighted code on pastebin? :p
 
i never use highlighting in my editor anyway
i never understand the rules of the highlighter for a start lol
i tried to make my own rules, but didnt get so far with it, so i turn off all syntax highlighting, ive never really used syntax highlighting
 
wtf, are you kidding?
 
2:30 PM
nope
 
 
4 hours later…
6:47 PM
stahp
 
HAMMAHTIME!
 
stop James
stop
 
HAMMERTIME!
 
 
1 hour later…
7:57 PM
Serious question: Is it okay to use Electron.js as a screensaver for Mac and Linux?
Is the performance similar to using a regular screensaver?
 

« first day (4964 days earlier)