@prosopo/datasets-fs 3.0.38 → 3.0.43
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/.turbo/turbo-build$colon$cjs.log +38 -0
- package/.turbo/turbo-build$colon$tsc.log +32 -0
- package/.turbo/turbo-build.log +42 -0
- package/CHANGELOG.md +51 -0
- package/dist/cli/cli.d.ts +9 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/cliCommand.d.ts +17 -0
- package/dist/cli/cliCommand.d.ts.map +1 -0
- package/dist/cli/cliCommand.js +31 -0
- package/dist/cli/cliCommand.js.map +1 -0
- package/dist/cli/cliCommandComposite.d.ts +14 -0
- package/dist/cli/cliCommandComposite.d.ts.map +1 -0
- package/dist/cli/cliCommandComposite.js +32 -0
- package/dist/cli/cliCommandComposite.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +34 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/flatten.d.ts +59 -0
- package/dist/commands/flatten.d.ts.map +1 -0
- package/dist/commands/flatten.js +95 -0
- package/dist/commands/flatten.js.map +1 -0
- package/dist/commands/generate.d.ts +115 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +150 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/generateV1.d.ts +179 -0
- package/dist/commands/generateV1.d.ts.map +1 -0
- package/dist/commands/generateV1.js +169 -0
- package/dist/commands/generateV1.js.map +1 -0
- package/dist/commands/generateV2.d.ts +189 -0
- package/dist/commands/generateV2.d.ts.map +1 -0
- package/dist/commands/generateV2.js +204 -0
- package/dist/commands/generateV2.js.map +1 -0
- package/dist/commands/get.d.ts +35 -0
- package/dist/commands/get.d.ts.map +1 -0
- package/dist/commands/get.js +92 -0
- package/dist/commands/get.js.map +1 -0
- package/dist/commands/labels.d.ts +47 -0
- package/dist/commands/labels.d.ts.map +1 -0
- package/dist/commands/labels.js +48 -0
- package/dist/commands/labels.js.map +1 -0
- package/dist/commands/relocate.d.ts +71 -0
- package/dist/commands/relocate.d.ts.map +1 -0
- package/dist/commands/relocate.js +81 -0
- package/dist/commands/relocate.js.map +1 -0
- package/dist/commands/resize.d.ts +69 -0
- package/dist/commands/resize.d.ts.map +1 -0
- package/dist/commands/resize.js +112 -0
- package/dist/commands/resize.js.map +1 -0
- package/dist/dummy.d.ts +2 -0
- package/dist/dummy.d.ts.map +1 -0
- package/dist/dummy.js +28 -0
- package/dist/dummy.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/tests/lodash.unit.test.d.ts +2 -0
- package/dist/tests/lodash.unit.test.d.ts.map +1 -0
- package/dist/tests/lodash.unit.test.js +29 -0
- package/dist/tests/lodash.unit.test.js.map +1 -0
- package/dist/tests/mocked.unit.test.d.ts +2 -0
- package/dist/tests/mocked.unit.test.d.ts.map +1 -0
- package/dist/tests/mocked.unit.test.js +252 -0
- package/dist/tests/mocked.unit.test.js.map +1 -0
- package/dist/tests/utils.d.ts +35 -0
- package/dist/tests/utils.d.ts.map +1 -0
- package/dist/tests/utils.js +101 -0
- package/dist/tests/utils.js.map +1 -0
- package/dist/utils/input.d.ts +24 -0
- package/dist/utils/input.d.ts.map +1 -0
- package/dist/utils/input.js +35 -0
- package/dist/utils/input.js.map +1 -0
- package/dist/utils/inputOutput.d.ts +21 -0
- package/dist/utils/inputOutput.d.ts.map +1 -0
- package/dist/utils/inputOutput.js +10 -0
- package/dist/utils/inputOutput.js.map +1 -0
- package/dist/utils/output.d.ts +36 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +62 -0
- package/dist/utils/output.js.map +1 -0
- package/package.json +9 -8
- package/vite.cjs.config.ts +1 -1
- package/vite.esm.config.ts +1 -1
- package/vite.test.config.ts +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { InputOutputCliCommand } from "../utils/inputOutput.js";
|
|
3
|
+
export declare const ArgsSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
4
|
+
input: z.ZodString;
|
|
5
|
+
}, {
|
|
6
|
+
output: z.ZodString;
|
|
7
|
+
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
}>, {
|
|
9
|
+
from: z.ZodString;
|
|
10
|
+
to: z.ZodString;
|
|
11
|
+
}>, "strip", z.ZodTypeAny, {
|
|
12
|
+
input: string;
|
|
13
|
+
output: string;
|
|
14
|
+
from: string;
|
|
15
|
+
to: string;
|
|
16
|
+
overwrite?: boolean | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
input: string;
|
|
19
|
+
output: string;
|
|
20
|
+
from: string;
|
|
21
|
+
to: string;
|
|
22
|
+
overwrite?: boolean | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export type ArgsSchemaType = typeof ArgsSchema;
|
|
25
|
+
export type Args = z.infer<ArgsSchemaType>;
|
|
26
|
+
export declare class Relocate extends InputOutputCliCommand<ArgsSchemaType> {
|
|
27
|
+
getArgSchema(): z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
28
|
+
input: z.ZodString;
|
|
29
|
+
}, {
|
|
30
|
+
output: z.ZodString;
|
|
31
|
+
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
}>, {
|
|
33
|
+
from: z.ZodString;
|
|
34
|
+
to: z.ZodString;
|
|
35
|
+
}>, "strip", z.ZodTypeAny, {
|
|
36
|
+
input: string;
|
|
37
|
+
output: string;
|
|
38
|
+
from: string;
|
|
39
|
+
to: string;
|
|
40
|
+
overwrite?: boolean | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
input: string;
|
|
43
|
+
output: string;
|
|
44
|
+
from: string;
|
|
45
|
+
to: string;
|
|
46
|
+
overwrite?: boolean | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
getOptions(): {
|
|
49
|
+
[key: string]: import("yargs").Options;
|
|
50
|
+
} & {
|
|
51
|
+
input: {
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
output: {
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
from: {
|
|
58
|
+
string: boolean;
|
|
59
|
+
demand: boolean;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
to: {
|
|
63
|
+
description: string;
|
|
64
|
+
string: boolean;
|
|
65
|
+
demand: boolean;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
_run(args: Args): Promise<void>;
|
|
69
|
+
getDescription(): string;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=relocate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relocate.d.ts","sourceRoot":"","sources":["../../src/commands/relocate.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAEN,qBAAqB,EACrB,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;EAGrB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,UAAU,CAAC;AAC/C,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAE3C,qBAAa,QAAS,SAAQ,qBAAqB,CAAC,cAAc,CAAC;IAClD,YAAY;;;;;;;;;;;;;;;;;;;;;IAIZ,UAAU;;;;;;;;;;;;;;;;;;;;IAsBJ,IAAI,CAAC,IAAI,EAAE,IAAI;IAiDrB,cAAc,IAAI,MAAM;CAGxC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { get } from "@prosopo/util";
|
|
3
|
+
import { lodash } from "@prosopo/util/lodash";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
import { InputOutputArgsSchema, InputOutputCliCommand, } from "../utils/inputOutput.js";
|
|
6
|
+
export const ArgsSchema = InputOutputArgsSchema.extend({
|
|
7
|
+
from: z.string(),
|
|
8
|
+
to: z.string(),
|
|
9
|
+
});
|
|
10
|
+
export class Relocate extends InputOutputCliCommand {
|
|
11
|
+
getArgSchema() {
|
|
12
|
+
return ArgsSchema;
|
|
13
|
+
}
|
|
14
|
+
getOptions() {
|
|
15
|
+
return lodash().merge(super.getOptions(), {
|
|
16
|
+
input: {
|
|
17
|
+
description: "A json file containing a list of objects with (at least) a url",
|
|
18
|
+
},
|
|
19
|
+
output: {
|
|
20
|
+
description: "Where to write the new json file containing the new urls",
|
|
21
|
+
},
|
|
22
|
+
from: {
|
|
23
|
+
string: true,
|
|
24
|
+
demand: true,
|
|
25
|
+
description: "The string to replace in the urls",
|
|
26
|
+
},
|
|
27
|
+
to: {
|
|
28
|
+
description: "The string to substitute in the urls",
|
|
29
|
+
string: true,
|
|
30
|
+
demand: true,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
async _run(args) {
|
|
35
|
+
await super._run(args);
|
|
36
|
+
const replace = (data, from, to) => {
|
|
37
|
+
if (Array.isArray(data)) {
|
|
38
|
+
for (let i = 0; i < data.length; i++) {
|
|
39
|
+
data[i] = replace(data[i], from, to);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else if (typeof data === "object") {
|
|
43
|
+
const obj = data;
|
|
44
|
+
for (const key of Object.keys(obj)) {
|
|
45
|
+
if (key === "data") {
|
|
46
|
+
const value = get(obj, key);
|
|
47
|
+
if (typeof value === "string") {
|
|
48
|
+
if (value.startsWith(from)) {
|
|
49
|
+
this.logger.debug(() => ({
|
|
50
|
+
msg: "replacing",
|
|
51
|
+
data: { value },
|
|
52
|
+
}));
|
|
53
|
+
obj[key] = to + value.slice(from.length);
|
|
54
|
+
this.logger.debug(() => ({
|
|
55
|
+
msg: "replaced",
|
|
56
|
+
data: { value: obj[key] },
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
obj[key] = replace(obj[key], from, to);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return data;
|
|
67
|
+
};
|
|
68
|
+
const file = args.input;
|
|
69
|
+
this.logger.info(() => ({ data: args, msg: "relocate" }));
|
|
70
|
+
let data = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
71
|
+
data = replace(data, args.from, args.to);
|
|
72
|
+
fs.mkdirSync(args.output.split("/").slice(0, -1).join("/"), {
|
|
73
|
+
recursive: true,
|
|
74
|
+
});
|
|
75
|
+
fs.writeFileSync(args.output, JSON.stringify(data, null, 4));
|
|
76
|
+
}
|
|
77
|
+
getDescription() {
|
|
78
|
+
return "Relocate urls in a JSON file using string substitution";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=relocate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relocate.js","sourceRoot":"","sources":["../../src/commands/relocate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAc9C,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,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;CACd,CAAC,CAAC;AAIH,MAAM,OAAO,QAAS,SAAQ,qBAAqC;IAClD,YAAY;QAC3B,OAAO,UAAU,CAAC;IACnB,CAAC;IAEe,UAAU;QACzB,OAAO,MAAM,EAAE,CAAC,KAAK,CAAC,K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I;SACf,CAAC,CAAC;QACH,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC;IAEe,cAAc;QAC7B,OAAO,wDAAwD,CAAC;IACjE,CAAC;CACD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { InputOutputCliCommand } from "../utils/inputOutput.js";
|
|
3
|
+
export declare const ArgsSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
4
|
+
input: z.ZodString;
|
|
5
|
+
}, {
|
|
6
|
+
output: z.ZodString;
|
|
7
|
+
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
}>, {
|
|
9
|
+
size: z.ZodNumber;
|
|
10
|
+
square: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
}>, "strip", z.ZodTypeAny, {
|
|
12
|
+
input: string;
|
|
13
|
+
output: string;
|
|
14
|
+
size: number;
|
|
15
|
+
overwrite?: boolean | undefined;
|
|
16
|
+
square?: boolean | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
input: string;
|
|
19
|
+
output: string;
|
|
20
|
+
size: number;
|
|
21
|
+
overwrite?: boolean | undefined;
|
|
22
|
+
square?: boolean | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export type ArgsSchemaType = typeof ArgsSchema;
|
|
25
|
+
export type Args = z.infer<ArgsSchemaType>;
|
|
26
|
+
export declare class Resize extends InputOutputCliCommand<ArgsSchemaType> {
|
|
27
|
+
getArgSchema(): z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
28
|
+
input: z.ZodString;
|
|
29
|
+
}, {
|
|
30
|
+
output: z.ZodString;
|
|
31
|
+
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
}>, {
|
|
33
|
+
size: z.ZodNumber;
|
|
34
|
+
square: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
}>, "strip", z.ZodTypeAny, {
|
|
36
|
+
input: string;
|
|
37
|
+
output: string;
|
|
38
|
+
size: number;
|
|
39
|
+
overwrite?: boolean | undefined;
|
|
40
|
+
square?: boolean | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
input: string;
|
|
43
|
+
output: string;
|
|
44
|
+
size: number;
|
|
45
|
+
overwrite?: boolean | undefined;
|
|
46
|
+
square?: boolean | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
getOptions(): {
|
|
49
|
+
[key: string]: import("yargs").Options;
|
|
50
|
+
} & {
|
|
51
|
+
input: {
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
output: {
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
size: {
|
|
58
|
+
number: boolean;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
square: {
|
|
62
|
+
boolean: boolean;
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
_run(args: Args): Promise<void>;
|
|
67
|
+
getDescription(): string;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=resize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize.d.ts","sourceRoot":"","sources":["../../src/commands/resize.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAEN,qBAAqB,EACrB,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;EAGrB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,UAAU,CAAC;AAC/C,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAE3C,qBAAa,MAAO,SAAQ,qBAAqB,CAAC,cAAc,CAAC;IAChD,YAAY;;;;;;;;;;;;;;;;;;;;;IAIZ,UAAU;;;;;;;;;;;;;;;;;;IAuBJ,IAAI,CAAC,IAAI,EAAE,IAAI;IAyGrB,cAAc,IAAI,MAAM;CAGxC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { blake2b } from "@noble/hashes/blake2b";
|
|
3
|
+
import { ProsopoDatasetError, ProsopoEnvError } from "@prosopo/common";
|
|
4
|
+
import { DataSchema } from "@prosopo/types";
|
|
5
|
+
import { u8aToHex } from "@prosopo/util";
|
|
6
|
+
import { lodash } from "@prosopo/util/lodash";
|
|
7
|
+
import cliProgress from "cli-progress";
|
|
8
|
+
import sharp from "sharp";
|
|
9
|
+
import * as z from "zod";
|
|
10
|
+
import { InputOutputArgsSchema, InputOutputCliCommand, } from "../utils/inputOutput.js";
|
|
11
|
+
export const ArgsSchema = InputOutputArgsSchema.extend({
|
|
12
|
+
size: z.number(),
|
|
13
|
+
square: z.boolean().optional(),
|
|
14
|
+
});
|
|
15
|
+
export class Resize extends InputOutputCliCommand {
|
|
16
|
+
getArgSchema() {
|
|
17
|
+
return ArgsSchema;
|
|
18
|
+
}
|
|
19
|
+
getOptions() {
|
|
20
|
+
return lodash().merge(super.getOptions(), {
|
|
21
|
+
input: {
|
|
22
|
+
description: "JSON file containing a list of objects with (at least) a url",
|
|
23
|
+
},
|
|
24
|
+
output: {
|
|
25
|
+
description: "Where to put the output directory containing the map file and single directory of images. The map file will contain the new urls of the scaled images, new hashes and pass through any other information, e.g. labels.",
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
number: true,
|
|
29
|
+
description: "The dimension (height/width) of the scaled image. If the image is not square, the other dimension will be scaled to maintain the aspect ratio.",
|
|
30
|
+
},
|
|
31
|
+
square: {
|
|
32
|
+
boolean: true,
|
|
33
|
+
description: "If true, the image will be cropped to a square before scaling. If false, the image will be scaled to the given size, maintaining the aspect ratio.",
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async _run(args) {
|
|
38
|
+
await super._run(args);
|
|
39
|
+
const size = args.size;
|
|
40
|
+
const square = args.square ?? false;
|
|
41
|
+
const mapFile = args.input;
|
|
42
|
+
if (!fs.existsSync(mapFile)) {
|
|
43
|
+
throw new ProsopoDatasetError(new Error(`Map file does not exist: ${mapFile}`), {
|
|
44
|
+
translationKey: "FS.FILE_NOT_FOUND",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const outDir = args.output;
|
|
48
|
+
const overwrite = args.overwrite || false;
|
|
49
|
+
if (!overwrite && fs.existsSync(outDir)) {
|
|
50
|
+
throw new ProsopoEnvError(new Error(`Output directory already exists: ${outDir}`), {
|
|
51
|
+
translationKey: "FS.FILE_NOT_FOUND",
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const imgDir = `${outDir}/images`;
|
|
55
|
+
fs.mkdirSync(imgDir, { recursive: true });
|
|
56
|
+
const inputItems = DataSchema.parse(JSON.parse(fs.readFileSync(mapFile, "utf8"))).items;
|
|
57
|
+
const bar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
|
|
58
|
+
bar.start(inputItems.length, 0);
|
|
59
|
+
const outputItems = [];
|
|
60
|
+
for (const inputItem of inputItems) {
|
|
61
|
+
bar.increment();
|
|
62
|
+
const img = fs.readFileSync(inputItem.data);
|
|
63
|
+
const resized = await sharp(img)
|
|
64
|
+
.resize({
|
|
65
|
+
width: size,
|
|
66
|
+
height: size,
|
|
67
|
+
fit: square ? "cover" : "inside",
|
|
68
|
+
})
|
|
69
|
+
.removeAlpha()
|
|
70
|
+
.toColorspace("srgb")
|
|
71
|
+
.jpeg({
|
|
72
|
+
quality: 75,
|
|
73
|
+
chromaSubsampling: "4:2:0",
|
|
74
|
+
optimiseCoding: true,
|
|
75
|
+
trellisQuantisation: true,
|
|
76
|
+
overshootDeringing: true,
|
|
77
|
+
optimizeScans: true,
|
|
78
|
+
quantisationTable: 3,
|
|
79
|
+
force: true,
|
|
80
|
+
});
|
|
81
|
+
const tmpFilePath = `${imgDir}/tmp.jpg`;
|
|
82
|
+
await resized.toFile(tmpFilePath);
|
|
83
|
+
const resizedImg = fs.readFileSync(tmpFilePath);
|
|
84
|
+
const hash = blake2b(resizedImg);
|
|
85
|
+
const hex = u8aToHex(hash);
|
|
86
|
+
const finalFilePath = `${imgDir}/${hex}.jpg`;
|
|
87
|
+
fs.renameSync(tmpFilePath, finalFilePath);
|
|
88
|
+
const outputItem = {
|
|
89
|
+
...inputItem,
|
|
90
|
+
hash: hex,
|
|
91
|
+
data: fs.realpathSync(finalFilePath),
|
|
92
|
+
};
|
|
93
|
+
outputItems.push(outputItem);
|
|
94
|
+
}
|
|
95
|
+
bar.stop();
|
|
96
|
+
const outputMapFile = `${outDir}/data.json`;
|
|
97
|
+
const data = {
|
|
98
|
+
items: outputItems,
|
|
99
|
+
};
|
|
100
|
+
this.logger.info(() => ({ msg: "verifying data" }));
|
|
101
|
+
DataSchema.parse(data);
|
|
102
|
+
this.logger.info(() => ({ msg: "writing data" }));
|
|
103
|
+
fs.mkdirSync(args.output.split("/").slice(0, -1).join("/"), {
|
|
104
|
+
recursive: true,
|
|
105
|
+
});
|
|
106
|
+
fs.writeFileSync(outputMapFile, JSON.stringify(data, null, 4));
|
|
107
|
+
}
|
|
108
|
+
getDescription() {
|
|
109
|
+
return "Resize images to a given size";
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=resize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize.js","sourceRoot":"","sources":["../../src/commands/resize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAa,UAAU,EAAa,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC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KAAK,CAAC,IAAI,CAAC,CAAC;QAEvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;QAClD,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAC3D,SAAS,EAAE,IAAI;SACf,CAAC,CAAC;QACH,EAAE,CAAC,aAAa,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC;IAEe,cAAc;QAC7B,OAAO,+BAA+B,CAAC;IACxC,CAAC;CACD"}
|
package/dist/dummy.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dummy.d.ts","sourceRoot":"","sources":["../src/dummy.ts"],"names":[],"mappings":""}
|
package/dist/dummy.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { CaptchaItemTypes } from "@prosopo/types";
|
|
3
|
+
const nLabels = 4;
|
|
4
|
+
const nLabelledImages = 100;
|
|
5
|
+
const nUnlabelledImages = 100;
|
|
6
|
+
const labelledImages = [];
|
|
7
|
+
const unlabelledImages = [];
|
|
8
|
+
for (let i = 0; i < nLabelledImages; i++) {
|
|
9
|
+
const label = i % nLabels;
|
|
10
|
+
labelledImages.push({
|
|
11
|
+
label: label.toString(),
|
|
12
|
+
data: `abc${i}`,
|
|
13
|
+
type: CaptchaItemTypes.Image,
|
|
14
|
+
hash: `abc${i}hash`,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
for (let i = 0; i < nUnlabelledImages; i++) {
|
|
18
|
+
unlabelledImages.push({
|
|
19
|
+
data: `def${i}`,
|
|
20
|
+
type: CaptchaItemTypes.Image,
|
|
21
|
+
hash: `def${i}hash`,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
fs.writeFileSync("labelled.json", JSON.stringify(labelledImages));
|
|
25
|
+
fs.writeFileSync("unlabelled.json", JSON.stringify(unlabelledImages));
|
|
26
|
+
fs.writeFileSync("labels.json", JSON.stringify(Array.from(Array(nLabels).keys()).map((x) => x.toString())));
|
|
27
|
+
process.exit(0);
|
|
28
|
+
//# sourceMappingURL=dummy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dummy.js","sourceRoot":"","sources":["../src/dummy.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAgC,MAAM,gBAAgB,CAAC;AAEhF,MAAM,OAAO,GAAG,CAAC,CAAC;AAClB,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,MAAM,cAAc,GAAmB,EAAE,CAAC;AAC1C,MAAM,gBAAgB,GAAW,EAAE,CAAC;AAEpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAG,CAAC,GAAG,OAAO,CAAC;IAC1B,cAAc,CAAC,IAAI,CAAC;QACnB,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;QACvB,IAAI,EAAE,MAAM,CAAC,EAAE;QACf,IAAI,EAAE,gBAAgB,CAAC,KAAK;QAC5B,IAAI,EAAE,MAAM,CAAC,MAAM;KACnB,CAAC,CAAC;AACJ,CAAC;AAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5C,gBAAgB,CAAC,IAAI,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC,EAAE;QACf,IAAI,EAAE,gBAAgB,CAAC,KAAK;QAC5B,IAAI,EAAE,MAAM,CAAC,MAAM;KACnB,CAAC,CAAC;AACJ,CAAC;AAED,EAAE,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;AAClE,EAAE,CAAC,aAAa,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACtE,EAAE,CAAC,aAAa,CACf,aAAa,EACb,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAC1E,CAAC;AAEF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lodash.unit.test.d.ts","sourceRoot":"","sources":["../../src/tests/lodash.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { rng, seedLodash } from "@prosopo/util/lodash";
|
|
2
|
+
import { describe, expect, test } from "vitest";
|
|
3
|
+
describe("rng", () => {
|
|
4
|
+
test("generates random numbers using a seed", () => {
|
|
5
|
+
const seed = 0;
|
|
6
|
+
const rand = rng(seed);
|
|
7
|
+
const expected = [
|
|
8
|
+
-1681090547, 408334984, 788430095, 3233831872, 963300000, -299378919,
|
|
9
|
+
97582850,
|
|
10
|
+
];
|
|
11
|
+
for (let i = 0; i < expected.length; i++) {
|
|
12
|
+
expect(rand.int()).to.equal(expected[i]);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
describe("seeded_lodash", () => {
|
|
17
|
+
test("shuffles an array using a seed", () => {
|
|
18
|
+
let array = [1, 2, 3, 4, 5];
|
|
19
|
+
const seed = 0;
|
|
20
|
+
const _ = seedLodash(seed);
|
|
21
|
+
array = _.shuffle(array);
|
|
22
|
+
expect(array).to.deep.equal([4, 2, 1, 3, 5]);
|
|
23
|
+
array = _.shuffle(array);
|
|
24
|
+
expect(array).to.deep.equal([3, 4, 1, 5, 2]);
|
|
25
|
+
array = _.shuffle(array);
|
|
26
|
+
expect(array).to.deep.equal([3, 4, 5, 2, 1]);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=lodash.unit.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lodash.unit.test.js","sourceRoot":"","sources":["../../src/tests/lodash.unit.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAcvD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEhD,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;IACpB,IAAI,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAClD,MAAM,IAAI,GAAG,CAAC,CAAC;QACf,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QACvB,MAAM,QAAQ,GAAG;YAChB,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,SAAS;YACpE,QAAQ;SACR,CAAC;QACF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAA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