Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

33
LINES

< > BotCompany Repo | #1013257 // Waifu v1 [Detect person in front of webcam & play sounds when coming/going]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 206K of libraries. Click here for Pure Java version (6918L/49K).

!7

static File yoloPath;
static S imagePath;
static int nn;

p {
  startBot("WebCam.", #1010735);
  
  repeat with sleep 1 {
    S s = sendOpt("WebCam.", "latest file");
    new Matches m;
    if "ok *" {
      if (neq(imagePath, $1)) {
        imagePath = $1;
        L<Pair<S, Int>> results = runYolo(imagePath);
        print(results);
        int newNN = countOccurrences(firstOfPairs(results), "person");
        if (newNN != nn) {
          nn = newNN;
          consoleTitle(nn + " people");
          onNNChange();
        }
      }
    }
  }
}

svoid onNNChange() {
  playWAVSnippet(
    nn > 0 ? #1013260 : #1013261
  );
}

Author comment

Began life as a copy of #1013253

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1013257
Snippet name: Waifu v1 [Detect person in front of webcam & play sounds when coming/going]
Eternal ID of this version: #1013257/11
Text MD5: 723a4d8c0ef59b678e937f8377e48a2a
Transpilation MD5: 889b01cadf59ebdd86631fd2f77b264a
Author: stefan
Category: javax / image recognition
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-01 09:07:07
Source code size: 667 bytes / 33 lines
Pitched / IR pitched: No / No
Views / Downloads: 585 / 1236
Version history: 10 change(s)
Referenced in: [show references]