@prosopo/datasets-fs 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -5
- package/dist/cjs/cli/cli.cjs +8 -5
- package/dist/cli/cli.d.ts +2 -2
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +18 -13
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/cliCommand.d.ts +3 -3
- package/dist/cli/cliCommand.d.ts.map +1 -1
- package/dist/cli/cliCommand.js +6 -6
- package/dist/cli/cliCommand.js.map +1 -1
- package/dist/cli/cliCommandComposite.d.ts +3 -3
- package/dist/cli/cliCommandComposite.d.ts.map +1 -1
- package/dist/cli/cliCommandComposite.js +1 -1
- package/dist/cli/cliCommandComposite.js.map +1 -1
- package/dist/cli.js +11 -11
- package/dist/cli.js.map +1 -1
- package/dist/commands/flatten.d.ts +2 -2
- package/dist/commands/flatten.d.ts.map +1 -1
- package/dist/commands/flatten.js +22 -22
- package/dist/commands/flatten.js.map +1 -1
- package/dist/commands/generate.d.ts +3 -3
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +32 -28
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/generateV1.d.ts +2 -2
- package/dist/commands/generateV1.d.ts.map +1 -1
- package/dist/commands/generateV1.js +27 -25
- package/dist/commands/generateV1.js.map +1 -1
- package/dist/commands/generateV2.d.ts +6 -6
- package/dist/commands/generateV2.d.ts.map +1 -1
- package/dist/commands/generateV2.js +34 -28
- package/dist/commands/generateV2.js.map +1 -1
- package/dist/commands/get.d.ts +2 -2
- package/dist/commands/get.d.ts.map +1 -1
- package/dist/commands/get.js +11 -11
- package/dist/commands/get.js.map +1 -1
- package/dist/commands/labels.d.ts +2 -2
- package/dist/commands/labels.d.ts.map +1 -1
- package/dist/commands/labels.js +14 -11
- package/dist/commands/labels.js.map +1 -1
- package/dist/commands/relocate.d.ts +2 -2
- package/dist/commands/relocate.d.ts.map +1 -1
- package/dist/commands/relocate.js +19 -17
- package/dist/commands/relocate.js.map +1 -1
- package/dist/commands/resize.d.ts +2 -2
- package/dist/commands/resize.d.ts.map +1 -1
- package/dist/commands/resize.js +26 -24
- package/dist/commands/resize.js.map +1 -1
- package/dist/dummy.js +5 -5
- package/dist/dummy.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tests/data/flat_resized/labels.json +11 -1
- package/dist/tests/lodash.test.js +10 -7
- package/dist/tests/lodash.test.js.map +1 -1
- package/dist/tests/mocked.test.js +51 -45
- package/dist/tests/mocked.test.js.map +1 -1
- package/dist/tests/utils.d.ts +1 -1
- package/dist/tests/utils.d.ts.map +1 -1
- package/dist/tests/utils.js +11 -11
- package/dist/tests/utils.js.map +1 -1
- package/dist/utils/input.d.ts +2 -2
- package/dist/utils/input.d.ts.map +1 -1
- package/dist/utils/input.js +10 -10
- package/dist/utils/input.js.map +1 -1
- package/dist/utils/inputOutput.d.ts +2 -2
- package/dist/utils/inputOutput.d.ts.map +1 -1
- package/dist/utils/inputOutput.js +3 -3
- package/dist/utils/inputOutput.js.map +1 -1
- package/dist/utils/output.d.ts +2 -2
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +14 -14
- package/dist/utils/output.js.map +1 -1
- package/package.json +63 -68
- package/vite.cjs.config.ts +3 -3
- package/vite.test.config.ts +12 -12
- package/typedoc.config.js +0 -19
package/README.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
# README
|
|
2
|
+
|
|
1
3
|
## How to produce captchas
|
|
2
4
|
|
|
3
5
|
You need 3 files:
|
|
4
6
|
|
|
5
7
|
1. a json file containing labelled data in the form:
|
|
8
|
+
|
|
6
9
|
```json
|
|
7
10
|
[
|
|
8
11
|
{
|
|
@@ -16,7 +19,9 @@ You need 3 files:
|
|
|
16
19
|
...
|
|
17
20
|
]
|
|
18
21
|
```
|
|
22
|
+
|
|
19
23
|
1. a json file containing unlabelled data in the form:
|
|
24
|
+
|
|
20
25
|
```json
|
|
21
26
|
[
|
|
22
27
|
{
|
|
@@ -28,6 +33,7 @@ You need 3 files:
|
|
|
28
33
|
...
|
|
29
34
|
]
|
|
30
35
|
```
|
|
36
|
+
|
|
31
37
|
1. (optional) a json file with an array of labels which unlabelled data can be categorised into. If not specified will default to the same labels as seen in the labelled data.
|
|
32
38
|
|
|
33
39
|
Then build and run the cli, passing appropriate parameters:
|
|
@@ -38,7 +44,8 @@ Use `node ./dist/js/cli.ts --help` to inspect other parameters.
|
|
|
38
44
|
Commands:
|
|
39
45
|
|
|
40
46
|
1. `flatten` converts a hierarchical directory structure into a single directory with corresponding map file, e.g.
|
|
41
|
-
|
|
47
|
+
|
|
48
|
+
```json
|
|
42
49
|
data/
|
|
43
50
|
dog/
|
|
44
51
|
a.png
|
|
@@ -47,16 +54,20 @@ Commands:
|
|
|
47
54
|
b.png
|
|
48
55
|
...
|
|
49
56
|
```
|
|
57
|
+
|
|
50
58
|
into
|
|
51
|
-
|
|
59
|
+
|
|
60
|
+
```json
|
|
52
61
|
data/
|
|
53
62
|
a.png
|
|
54
63
|
b.png
|
|
55
64
|
...
|
|
56
65
|
map.json
|
|
57
66
|
```
|
|
67
|
+
|
|
58
68
|
where `map.json` looks like:
|
|
59
|
-
|
|
69
|
+
|
|
70
|
+
```json
|
|
60
71
|
[
|
|
61
72
|
{
|
|
62
73
|
"label": "dog",
|
|
@@ -69,6 +80,7 @@ Commands:
|
|
|
69
80
|
...
|
|
70
81
|
]
|
|
71
82
|
```
|
|
83
|
+
|
|
72
84
|
e.g. `npm run -w @prosopo/datasets-fs build && node packages/datasets-fs/dist/cli.js flatten --in ~/bench/test/data --out ~/bench/test/flat --overwrite`
|
|
73
85
|
1. `generateDistinct` takes the 3 files described above and produces captcha challenges comprising 2 rounds, one labelled and one unlabelled.
|
|
74
86
|
e.g. `npm run -w @prosopo/datasets-fs build && node packages/datasets-fs/dist/cli.js generate distinct --out ~/bench/test/captchas.json --labelled ~/bench/test/flat/data.json --unlabelled ~/bench/test/flat/data.json --seed 0 --size 9 --allow-duplicates --solved 1 --unsolved 1 --overwrite --labels ~/bench/test/flat/labels.json`
|
|
@@ -83,11 +95,11 @@ Commands:
|
|
|
83
95
|
1. 'scale' rescales images in a flat directory structure to a given size.
|
|
84
96
|
e.g. `npm run -w @prosopo/datasets-fs build && node packages/datasets-fs/dist/cli.js scale --data ~/bench/test/flat/data.json --out ~/bench/test/flat/images2 --overwrite --size 128`
|
|
85
97
|
|
|
86
|
-
|
|
98
|
+
## Generating test data
|
|
87
99
|
|
|
88
100
|
The test data was generated using:
|
|
89
101
|
|
|
90
|
-
```
|
|
102
|
+
```bash
|
|
91
103
|
cli generate-v1 --min-correct 1 --max-correct 6 --labelled $PWD/src/tests/data/flat_resized/data.json --unlabelled $PWD/src/tests/data/flat_resized/data.json --out $PWD/src/tests/data/flat_resized/captchas_v1.json --solved 50 --unsolved 50 --seed 0 --allowDuplicates --seed 0
|
|
92
104
|
|
|
93
105
|
cli generate-v2 --count 100 --min-correct 1 --min-incorrect 1 --min-labelled 2 --max-labelled 7 --labelled $PWD/src/tests/data/flat_resized/data.json --unlabelled $PWD/src/tests/data/flat_resized/data.json --out $PWD/src/tests/data/flat_resized/captchas_v2.json --seed 0 --allowDuplicates --seed 0
|
package/dist/cjs/cli/cli.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const common = require("@prosopo/common");
|
|
4
|
-
const helpers = require("yargs/helpers");
|
|
5
4
|
const yargs = require("yargs");
|
|
5
|
+
const helpers = require("yargs/helpers");
|
|
6
6
|
const dirname = process.cwd();
|
|
7
7
|
const logger = common.getLogger(common.LogLevel.enum.info, `${dirname}`);
|
|
8
8
|
class Cli extends common.Loggable {
|
|
@@ -21,25 +21,28 @@ class Cli extends common.Loggable {
|
|
|
21
21
|
}).middleware((argv) => {
|
|
22
22
|
this.logger.setLogLevel(argv.logLevel);
|
|
23
23
|
}, true);
|
|
24
|
-
this.#commands
|
|
24
|
+
for (const command of this.#commands) {
|
|
25
25
|
y = y.command({
|
|
26
26
|
command: command.getCommandName(),
|
|
27
27
|
describe: command.getDescription(),
|
|
28
28
|
builder: command.getOptions(),
|
|
29
|
+
// biome-ignore lint/suspicious/noExplicitAny: TODO fix
|
|
29
30
|
handler: async (argv) => {
|
|
30
31
|
this.logger.debug(`running ${command.getCommandName()}}`);
|
|
31
32
|
const args = await command.parse(argv);
|
|
32
33
|
await command.exec(args);
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
|
-
}
|
|
36
|
+
}
|
|
36
37
|
if (!this.#commands.find((c) => c.getCommandName() === "$0")) {
|
|
37
38
|
y = y.command(
|
|
38
39
|
"$0",
|
|
39
40
|
"default command",
|
|
40
41
|
(y2) => y2,
|
|
41
|
-
(
|
|
42
|
-
throw new common.ProsopoCliError("CLI.PARAMETER_ERROR", {
|
|
42
|
+
() => {
|
|
43
|
+
throw new common.ProsopoCliError("CLI.PARAMETER_ERROR", {
|
|
44
|
+
context: { error: "no command specified" }
|
|
45
|
+
});
|
|
43
46
|
}
|
|
44
47
|
);
|
|
45
48
|
}
|
package/dist/cli/cli.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Loggable } from "@prosopo/common";
|
|
2
|
+
import type { CliCommandAny } from "./cliCommand.js";
|
|
3
3
|
export declare class Cli extends Loggable {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(commands: CliCommandAny[]);
|
package/dist/cli/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,QAAQ,EAGR,MAAM,iBAAiB,CAAC;AAgBzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKrD,qBAAa,GAAI,SAAQ,QAAQ;;gBAGpB,QAAQ,EAAE,aAAa,EAAE;IAMrC,OAAO,CAAC,MAAM;IA+CD,IAAI,CAAC,IAAI,GAAE,MAAM,EAA0B;CAKxD"}
|
package/dist/cli/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _Cli_commands;
|
|
2
2
|
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
3
|
-
import { LogLevel, Loggable, ProsopoCliError, getLogger } from
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { LogLevel, Loggable, ProsopoCliError, getLogger, } from "@prosopo/common";
|
|
4
|
+
import yargs from "yargs";
|
|
5
|
+
import { hideBin } from "yargs/helpers";
|
|
6
6
|
const dirname = process.cwd();
|
|
7
7
|
const logger = getLogger(LogLevel.enum.info, `${dirname}`);
|
|
8
8
|
export class Cli extends Loggable {
|
|
@@ -14,16 +14,16 @@ export class Cli extends Loggable {
|
|
|
14
14
|
}
|
|
15
15
|
config() {
|
|
16
16
|
let y = yargs(hideBin(process.argv))
|
|
17
|
-
.option(
|
|
18
|
-
type:
|
|
17
|
+
.option("log-level", {
|
|
18
|
+
type: "string",
|
|
19
19
|
choices: Object.values(LogLevel.options),
|
|
20
20
|
default: LogLevel.enum.info,
|
|
21
|
-
description:
|
|
21
|
+
description: "The log level",
|
|
22
22
|
})
|
|
23
23
|
.middleware((argv) => {
|
|
24
24
|
this.logger.setLogLevel(argv.logLevel);
|
|
25
25
|
}, true);
|
|
26
|
-
__classPrivateFieldGet(this, _Cli_commands, "f")
|
|
26
|
+
for (const command of __classPrivateFieldGet(this, _Cli_commands, "f")) {
|
|
27
27
|
y = y.command({
|
|
28
28
|
command: command.getCommandName(),
|
|
29
29
|
describe: command.getDescription(),
|
|
@@ -34,18 +34,23 @@ export class Cli extends Loggable {
|
|
|
34
34
|
await command.exec(args);
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
|
-
}
|
|
38
|
-
if (!__classPrivateFieldGet(this, _Cli_commands, "f").find((c) => c.getCommandName() ===
|
|
39
|
-
y = y.command(
|
|
40
|
-
throw new ProsopoCliError(
|
|
37
|
+
}
|
|
38
|
+
if (!__classPrivateFieldGet(this, _Cli_commands, "f").find((c) => c.getCommandName() === "$0")) {
|
|
39
|
+
y = y.command("$0", "default command", (y) => y, () => {
|
|
40
|
+
throw new ProsopoCliError("CLI.PARAMETER_ERROR", {
|
|
41
|
+
context: { error: "no command specified" },
|
|
42
|
+
});
|
|
41
43
|
});
|
|
42
44
|
}
|
|
43
|
-
y = y
|
|
45
|
+
y = y
|
|
46
|
+
.demandCommand()
|
|
47
|
+
.strict()
|
|
48
|
+
.showHelpOnFail(false, "Specify --help for available options");
|
|
44
49
|
return y;
|
|
45
50
|
}
|
|
46
51
|
async exec(args = process.argv.slice(2)) {
|
|
47
52
|
const config = this.config();
|
|
48
|
-
this.logger.debug(
|
|
53
|
+
this.logger.debug("parsing", args);
|
|
49
54
|
await config.parse(args);
|
|
50
55
|
}
|
|
51
56
|
}
|
package/dist/cli/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";;AAAA,OAAO,EACN,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,SAAS,GACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAgBxC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAC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C,IAAI,CAAC,CAAC;gBAC1B,CAAC;aACD,CAAC,CAAC;SACH;QAED,IAAI,CAAC,uBAAA,IAAI,qBAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,KAAK,IAAI,CAAC,EAAE;YAE7D,CAAC,GAAG,CAAC,CAAC,OAAO,CACZ,IAAI,EACJ,iBAAiB,EACjB,CAAC,CAAO,EAAE,EAAE,CAAC,CAAC,EACd,GAAG,EAAE;gBACJ,MAAM,IAAI,eAAe,CAAC,qBAAqB,EAAE;oBAChD,OAAO,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE;iBAC1C,CAAC,CAAC;YACJ,CAAC,CACD,CAAC;SACF;QACD,CAAC,GAAG,CAAC;aACH,aAAa,EAAE;aACf,MAAM,EAAE;aACR,cAAc,CAAC,KAAK,EAAE,sCAAsC,CAAC,CAAC;QAChE,OAAO,CAAC,CAAC;IACV,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,OAAiB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACnC,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACD"}
|
package/dist/cli/cliCommand.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { Loggable } from "@prosopo/common";
|
|
2
|
+
import type { Options } from "yargs";
|
|
3
|
+
import type * as z from "zod";
|
|
4
4
|
export declare abstract class CliCommand<T extends z.ZodTypeAny> extends Loggable {
|
|
5
5
|
getOptions(): {
|
|
6
6
|
[key: string]: Options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliCommand.d.ts","sourceRoot":"","sources":["../../src/cli/cliCommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cliCommand.d.ts","sourceRoot":"","sources":["../../src/cli/cliCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAcrC,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,CAAC;AAE9B,8BAAsB,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,CAAE,SAAQ,QAAQ;IAEjE,UAAU,IAAI;QACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACvB;aAKe,YAAY,IAAI,CAAC;IAIpB,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAQzC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAKvB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAKrB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAQ3B,cAAc;aAIL,cAAc,IAAI,MAAM;CACxC;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC"}
|
package/dist/cli/cliCommand.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Loggable } from
|
|
2
|
-
import { kebabCase } from
|
|
1
|
+
import { Loggable } from "@prosopo/common";
|
|
2
|
+
import { kebabCase } from "@prosopo/util";
|
|
3
3
|
export class CliCommand extends Loggable {
|
|
4
4
|
getOptions() {
|
|
5
5
|
return {};
|
|
@@ -7,17 +7,17 @@ export class CliCommand extends Loggable {
|
|
|
7
7
|
async parse(args) {
|
|
8
8
|
const argsSchema = this.getArgSchema();
|
|
9
9
|
const parsed = await argsSchema.parse(args);
|
|
10
|
-
this.logger.debug(
|
|
10
|
+
this.logger.debug("parsed args:", parsed);
|
|
11
11
|
return parsed;
|
|
12
12
|
}
|
|
13
13
|
async _check(args) {
|
|
14
|
-
this.logger.debug(
|
|
14
|
+
this.logger.debug("runChecks");
|
|
15
15
|
}
|
|
16
16
|
async _run(args) {
|
|
17
|
-
this.logger.debug(
|
|
17
|
+
this.logger.debug("run");
|
|
18
18
|
}
|
|
19
19
|
async exec(args) {
|
|
20
|
-
this.logger.debug(
|
|
20
|
+
this.logger.debug("exec");
|
|
21
21
|
await this._check(args);
|
|
22
22
|
await this._run(args);
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliCommand.js","sourceRoot":"","sources":["../../src/cli/cliCommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cliCommand.js","sourceRoot":"","sources":["../../src/cli/cliCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAiB1C,MAAM,OAAgB,UAAmC,SAAQ,QAAQ;IAEjE,UAAU;QAGhB,OAAO,EAAE,CAAC;IACX,CAAC;IAOM,KAAK,CAAC,KAAK,CAAC,IAAa;QAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAC1C,OAAO,MAAM,CAAC;IACf,CAAC;IAGM,KAAK,CAAC,MAAM,CAAC,IAAgB;QACnC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAChC,CAAC;IAGM,KAAK,CAAC,IAAI,CAAC,IAAgB;QACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAGM,KAAK,CAAC,IAAI,CAAC,IAAgB;QACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAE1B,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAExB,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAEM,cAAc;QACpB,OAAO,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CAGD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import type { Options } from "yargs";
|
|
2
|
+
import type * as z from "zod";
|
|
3
|
+
import { CliCommand, type CliCommandAny } from "./cliCommand.js";
|
|
4
4
|
export declare abstract class CliCommandComposite<T extends z.ZodTypeAny> extends CliCommand<T> {
|
|
5
5
|
#private;
|
|
6
6
|
getCommands(): CliCommandAny[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliCommandComposite.d.ts","sourceRoot":"","sources":["../../src/cli/cliCommandComposite.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cliCommandComposite.d.ts","sourceRoot":"","sources":["../../src/cli/cliCommandComposite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAcrC,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEjE,8BAAsB,mBAAmB,CACxC,CAAC,SAAS,CAAC,CAAC,UAAU,CACrB,SAAQ,UAAU,CAAC,CAAC,CAAC;;IAGf,WAAW;gBAIN,QAAQ,EAAE,aAAa,EAAE;IAMrB,UAAU,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE;IAQxC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAOtC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAMxD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _CliCommandComposite_commands;
|
|
2
2
|
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
3
|
-
import { CliCommand } from
|
|
3
|
+
import { CliCommand } from "./cliCommand.js";
|
|
4
4
|
export class CliCommandComposite extends CliCommand {
|
|
5
5
|
getCommands() {
|
|
6
6
|
return __classPrivateFieldGet(this, _CliCommandComposite_commands, "f");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliCommandComposite.js","sourceRoot":"","sources":["../../src/cli/cliCommandComposite.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"cliCommandComposite.js","sourceRoot":"","sources":["../../src/cli/cliCommandComposite.ts"],"names":[],"mappings":";;AAeA,OAAO,EAAE,UAAU,EAAsB,MAAM,iBAAiB,CAAC;AAEjE,MAAM,OAAgB,mBAEpB,SAAQ,UAAa;IAGf,WAAW;QACjB,OAAO,uBAAA,IAAI,qCAAU,CAAC;IACvB,CAAC;IAED,YAAY,QAAyB;QACpC,KAAK,EAAE,CAAC;QAPT,wCAA6B,EAAE,EAAC;QAS/B,uBAAA,IAAI,iCAAa,CAAC,GAAG,QAAQ,CAAC,MAAA,CAAC;IAChC,CAAC;IAEe,UAAU;QAEzB,OAAO,uBAAA,IAAI,qCAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;YAE9C,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;QAC7C,CAAC,EAAE,EAAE,CAAC,CAAC;IACR,CAAC;IAEe,IAAI,CAAC,IAAiB;QACrC,OAAO,uBAAA,IAAI,qCAAU,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;YACpD,MAAM,IAAI,CAAC;YACX,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACvB,CAAC;IAEe,MAAM,CAAC,IAAiB;QACvC,OAAO,uBAAA,IAAI,qCAAU,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;YACpD,MAAM,IAAI,CAAC;YACX,MAAM,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACvB,CAAC;CACD"}
|
package/dist/cli.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Flatten } from
|
|
3
|
-
import { GenerateV1 } from
|
|
4
|
-
import { GenerateV2 } from
|
|
5
|
-
import { Get } from
|
|
6
|
-
import { Labels } from
|
|
7
|
-
import { Relocate } from
|
|
8
|
-
import { Resize } from
|
|
9
|
-
import {
|
|
1
|
+
import { isMain } from "@prosopo/util";
|
|
2
|
+
import { Flatten } from "./commands/flatten.js";
|
|
3
|
+
import { GenerateV1 } from "./commands/generateV1.js";
|
|
4
|
+
import { GenerateV2 } from "./commands/generateV2.js";
|
|
5
|
+
import { Get } from "./commands/get.js";
|
|
6
|
+
import { Labels } from "./commands/labels.js";
|
|
7
|
+
import { Relocate } from "./commands/relocate.js";
|
|
8
|
+
import { Resize } from "./commands/resize.js";
|
|
9
|
+
import { Cli } from "./index.js";
|
|
10
10
|
const main = async () => {
|
|
11
11
|
const commands = [
|
|
12
12
|
new Flatten(),
|
|
@@ -18,7 +18,7 @@ const main = async () => {
|
|
|
18
18
|
new Resize(),
|
|
19
19
|
];
|
|
20
20
|
const cli = new Cli(commands);
|
|
21
|
-
cli.logger.setLogLevel(
|
|
21
|
+
cli.logger.setLogLevel("debug");
|
|
22
22
|
await cli.exec();
|
|
23
23
|
};
|
|
24
24
|
if (isMain(import.meta.url)) {
|
|
@@ -27,7 +27,7 @@ if (isMain(import.meta.url)) {
|
|
|
27
27
|
process.exit(0);
|
|
28
28
|
})
|
|
29
29
|
.catch((err) => {
|
|
30
|
-
console.log(
|
|
30
|
+
console.log("error", err);
|
|
31
31
|
process.exit(1);
|
|
32
32
|
});
|
|
33
33
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAc9C,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE;IACvB,MAAM,QAAQ,GAAoB;QACjC,IAAI,OAAO,EAAE;QACb,IAAI,UAAU,EAAE;QAChB,IAAI,UAAU,EAAE;QAChB,IAAI,GAAG,EAAE;QACT,IAAI,MAAM,EAAE;QACZ,IAAI,QAAQ,EAAE;QACd,IAAI,MAAM,EAAE;KACZ,CAAC;IACF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC9B,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAChC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;AAClB,CAAC,CAAC;AAGF,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;IAC5B,IAAI,EAAE;SACJ,IAAI,CAAC,GAAG,EAAE;QACV,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACd,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC1B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;CACJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
import * as z from
|
|
3
|
-
import { InputOutputCliCommand } from
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
import { InputOutputCliCommand } from "../utils/inputOutput.js";
|
|
4
4
|
export declare const ArgsSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
5
5
|
input: z.ZodString;
|
|
6
6
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../src/commands/flatten.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../src/commands/flatten.ts"],"names":[],"mappings":";AA0BA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAEN,qBAAqB,EACrB,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;EAErB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,UAAU,CAAC;AAC/C,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAE3C,qBAAa,OAAQ,SAAQ,qBAAqB,CAAC,cAAc,CAAC;IACjD,YAAY;;;;;;;;;;;;;;;;;;IAIZ,cAAc,IAAI,MAAM;IAIxB,UAAU;;;;;;;;;;;;;;IAiBJ,IAAI,CAAC,IAAI,EAAE,IAAI;CAuFrC"}
|
package/dist/commands/flatten.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ProsopoDatasetError } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { lodash } from
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { blake2b } from "@noble/hashes/blake2b";
|
|
3
|
+
import { u8aToHex } from "@polkadot/util/u8a";
|
|
4
|
+
import { ProsopoDatasetError } from "@prosopo/common";
|
|
5
|
+
import { CaptchaItemTypes, DataSchema, } from "@prosopo/types";
|
|
6
|
+
import { at } from "@prosopo/util";
|
|
7
|
+
import { lodash } from "@prosopo/util/lodash";
|
|
8
|
+
import cliProgress from "cli-progress";
|
|
9
|
+
import * as z from "zod";
|
|
10
|
+
import { InputOutputArgsSchema, InputOutputCliCommand, } from "../utils/inputOutput.js";
|
|
11
11
|
export const ArgsSchema = InputOutputArgsSchema.extend({
|
|
12
12
|
allowDuplicates: z.boolean().optional(),
|
|
13
13
|
});
|
|
@@ -16,28 +16,28 @@ export class Flatten extends InputOutputCliCommand {
|
|
|
16
16
|
return ArgsSchema;
|
|
17
17
|
}
|
|
18
18
|
getDescription() {
|
|
19
|
-
return
|
|
19
|
+
return "Restructure a directory containing directories for each image classification into a single directory with a file containing the labels";
|
|
20
20
|
}
|
|
21
21
|
getOptions() {
|
|
22
22
|
return lodash().merge(super.getOptions(), {
|
|
23
23
|
input: {
|
|
24
|
-
description:
|
|
24
|
+
description: "Path to the data directory containing subdirectories for each image classification",
|
|
25
25
|
},
|
|
26
26
|
output: {
|
|
27
|
-
description:
|
|
27
|
+
description: "Where to put the output file containing the labels and single directory of images",
|
|
28
28
|
},
|
|
29
29
|
allowDuplicates: {
|
|
30
30
|
boolean: true,
|
|
31
|
-
description:
|
|
31
|
+
description: "If true, allow duplicates in the data",
|
|
32
32
|
},
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
async _run(args) {
|
|
36
|
-
this.logger.debug(
|
|
36
|
+
this.logger.debug("flatten run");
|
|
37
37
|
await super._run(args);
|
|
38
38
|
const dataDir = args.input;
|
|
39
39
|
const outDir = args.output;
|
|
40
|
-
this.logger.info(
|
|
40
|
+
this.logger.info("reading data");
|
|
41
41
|
const labels = fs
|
|
42
42
|
.readdirSync(dataDir, { withFileTypes: true })
|
|
43
43
|
.filter((dirent) => dirent.isDirectory())
|
|
@@ -53,7 +53,7 @@ export class Flatten extends InputOutputCliCommand {
|
|
|
53
53
|
const images = at(imagesByLabel, i);
|
|
54
54
|
for (const image of images) {
|
|
55
55
|
bar.increment();
|
|
56
|
-
const extension = image.split(
|
|
56
|
+
const extension = image.split(".").pop();
|
|
57
57
|
const content = fs.readFileSync(`${dataDir}/${label}/${image}`);
|
|
58
58
|
const hash = blake2b(content);
|
|
59
59
|
const hex = u8aToHex(hash);
|
|
@@ -62,12 +62,12 @@ export class Flatten extends InputOutputCliCommand {
|
|
|
62
62
|
for (const item of items) {
|
|
63
63
|
if (item.hash === hex) {
|
|
64
64
|
this.logger.log(`\ndupe: ${label}/${image}`);
|
|
65
|
-
this.logger.log(
|
|
66
|
-
this.logger.log(
|
|
65
|
+
this.logger.log("item hash", item.hash);
|
|
66
|
+
this.logger.log("item label", item.label);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
if (!args.allowDuplicates) {
|
|
70
|
-
throw new ProsopoDatasetError(
|
|
70
|
+
throw new ProsopoDatasetError("DATASET.DUPLICATE_IMAGE", {
|
|
71
71
|
context: { image: `${label}/${image}` },
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -87,9 +87,9 @@ export class Flatten extends InputOutputCliCommand {
|
|
|
87
87
|
const data = {
|
|
88
88
|
items,
|
|
89
89
|
};
|
|
90
|
-
this.logger.info(
|
|
90
|
+
this.logger.info("verifying data");
|
|
91
91
|
DataSchema.parse(data);
|
|
92
|
-
this.logger.info(
|
|
92
|
+
this.logger.info("writing data");
|
|
93
93
|
fs.writeFileSync(`${outDir}/data.json`, JSON.stringify(data, null, 4));
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatten.js","sourceRoot":"","sources":["../../src/commands/flatten.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flatten.js","sourceRoot":"","sources":["../../src/commands/flatten.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,gBAAgB,EAEhB,UAAU,GAEV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,WAAW,MAAM,cAAc,CAAC;AAcvC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EACN,qBAAqB,EACrB,qBAAqB,GACrB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,UAAU,GAAG,qBAAqB,CAAC,MAAM,CAAC;IACtD,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAIH,MAAM,OAAO,OAAQ,SAAQ,qBAAq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
|
|
3
|
-
import
|
|
4
|
-
import { OutputCliCommand } from
|
|
2
|
+
import { type Item, type LabelledItem } from "@prosopo/types";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
import { OutputCliCommand } from "../utils/output.js";
|
|
5
5
|
export declare const ArgsSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
6
6
|
output: z.ZodString;
|
|
7
7
|
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":";AAEA,OAAO,EAEN,KAAK,IAAI,EAET,KAAK,YAAY,EAEjB,MAAM,gBAAgB,CAAC;AAexB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAoB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAExE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUrB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,UAAU,CAAC;AAC/C,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAE3C,8BAAsB,QAAQ,CAC7B,CAAC,SAAS,cAAc,CACvB,SAAQ,gBAAgB,CAAC,CAAC,CAAC;IACZ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6CJ,MAAM,CAAC,IAAI,EAAE,IAAI;IAwBvC,QAAQ,EAAE,YAAY,EAAE,CAAM;IAC9B,UAAU,EAAE,IAAI,EAAE,CAAM;IACxB,MAAM,EAAE,MAAM,EAAE,CAAM;IACtB,eAAe,SAAM;IACrB,iBAAiB,SAAM;IACvB,aAAa,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,CAAA;KAAE,CAAM;IAChD,OAAO,EAAE,MAAM,EAAE,CAAM;IACvB,UAAU,SAAM;IAEhB,OAAO,CAAC,QAAQ;IAkChB,OAAO,CAAC,UAAU;IAmBI,IAAI,CAAC,IAAI,EAAE,IAAI;CAWrC;AAED,eAAO,MAAM,eAAe,aACjB,YAAY,EAAE,cACZ,IAAI,EAAE,WACT;IACR,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACpC,SAOD,CAAC"}
|