-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.ts
More file actions
executable file
·34 lines (29 loc) · 1.04 KB
/
script.ts
File metadata and controls
executable file
·34 lines (29 loc) · 1.04 KB
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
27
28
29
30
31
32
33
34
#!/usr/bin/env -S npx ts-node
import { training } from './model/train';
import { dataset } from 'utils';
import yargs from 'yargs';
import { createDataset, getDrawingsFiles } from './imageProcessing';
yargs.command('download [files]', 'download quickdraw dataset files', (yargs) => {
yargs.positional('files', {
describe: 'first n files to be downloaded from the dataset',
type: 'number',
default: 10
})
}, (argv) => {
console.log(`downloading ${argv.files} files ...`)
getDrawingsFiles(argv.files as number);
})
.command('create <type>', 'generate labels files', yargs => {
yargs.positional('type', {
describe: 'type of dataset to create: "training", "validation" or "testing"',
default: 'training'
})
}, (argv) => {
console.log(`generating ${argv.type} labels files ...`);
createDataset(argv.type as dataset)
})
.command('train', 'train the model', {}, async (argv) => {
console.log(`training model ...`);
training();
})
.argv