Download Jar. Uses 206K of libraries. Click here for Pure Java version (6918L/49K).
1 | !7 |
2 | |
3 | static File yoloPath; |
4 | static S imagePath; |
5 | static int nn; |
6 | |
7 | p {
|
8 | startBot("WebCam.", #1010735);
|
9 | |
10 | repeat with sleep 1 {
|
11 | S s = sendOpt("WebCam.", "latest file");
|
12 | new Matches m; |
13 | if "ok *" {
|
14 | if (neq(imagePath, $1)) {
|
15 | imagePath = $1; |
16 | L<Pair<S, Int>> results = runYolo(imagePath); |
17 | print(results); |
18 | int newNN = countOccurrences(firstOfPairs(results), "person"); |
19 | if (newNN != nn) {
|
20 | nn = newNN; |
21 | consoleTitle(nn + " people"); |
22 | onNNChange(); |
23 | } |
24 | } |
25 | } |
26 | } |
27 | } |
28 | |
29 | svoid onNNChange() {
|
30 | playWAVSnippet( |
31 | nn > 0 ? #1013260 : #1013261 |
32 | ); |
33 | } |
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: | 962 / 1859 |
| Version history: | 10 change(s) |
| Referenced in: | [show references] |