-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-extractor-bot-nzsl.js
26 lines (24 loc) · 1.15 KB
/
run-extractor-bot-nzsl.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const ExtractorBot = require('./extractor-bot')
var NZSL = require('./nzsl').dataset("../NZSL-Dictionary")
async function main() {
let bot = new ExtractorBot({
outputFolder: "../extractor-bot-output-nzsl",
keypoints: ['fakeRightHand'],
//selector: (def)=> def.attributes.handshapes && def.attributes.handshapes.length > 0,
//labeler: (def)=> def.attributes.handshapes.map((fn)=> fn.split('-')[0]),
//videoPath: (def)=> def.videoPath,
selector: (def)=> !def.skip,
dataset: Promise.all(NZSL.entries().map((x)=> NZSL.lookup(x) )).map((def)=> {
if (!def.attributes.handshapes || def.attributes.handshapes.length < 1) return {skip: true}
return {videoPath: def.videoPath, labels: def.attributes.handshapes.map((fn)=> fn.split('-')[0])}
}),
log: true
})
let finalState = await bot.run()
console.log("Process complete! Final tally:")
console.log("Skipped Definitions: ", finalState.skippedTasks.length)
console.log("Extracted Definitions: ", finalState.completedTasks.length - finalState.skippedTasks.length)
console.log("Total images extracted: ", finalState.imagesExtracted)
console.log("And we're done!")
}
main()