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

16
LINES

< > BotCompany Repo | #1013256 // runYolo

JavaX fragment (include)

1  
static L<Pair<S, Int>> runYolo(File image) {
2  
  ret runYolo(f2s(image));
3  
}
4  
5  
static L<Pair<S, Int>> runYolo(S imagePath) {
6  
  File yoloPath = homeFile("dev/darknet");
7  
  //set backtick_keepScript;
8  
  S result = backtick_raw(print("cd " + bashQuote(yoloPath) + " && ./darknet detector test cfg/voc.data cfg/tiny-yolo-voc.cfg tiny-yolo-voc.weights " + bashQuote(imagePath)));
9  
  //pnl(result);
10  
  new L<Pair<S, Int>> out;
11  
  new Matches m;
12  
  for (S line : lines(result))
13  
    if (regexpMatchGroups("(\\w+):\\s*(\\d+)%", line, m))
14  
      out.add(pair(m.get(0), parseInt(m.get(1))));
15  
  ret out;
16  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1013256
Snippet name: runYolo
Eternal ID of this version: #1013256/4
Text MD5: 908dae69d3ce0d86b6fd6f36231ff957
Author: stefan
Category: javax / image recognition
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-02 23:16:36
Source code size: 597 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 451 / 479
Version history: 3 change(s)
Referenced in: [show references]