@omnimedia/omnitool 1.1.0-94 → 1.1.0-96
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/package.json +1 -1
- package/s/features/bg-remover/bg-remover.ts +26 -0
- package/s/features/bg-remover/default-spec.ts +11 -0
- package/s/features/bg-remover/types.ts +27 -0
- package/s/features/bg-remover/worker.bundle.ts +51 -0
- package/s/features/{speech/transcribe/parts → parts}/load-pipe.ts +3 -5
- package/s/features/parts/types.ts +19 -0
- package/s/features/speech/transcribe/default-spec.ts +2 -2
- package/s/features/speech/transcribe/types.ts +6 -16
- package/s/features/speech/transcribe/worker.bundle.ts +4 -3
- package/s/index.html.ts +2 -2
- package/s/timeline/parts/captions.ts +1 -0
- package/s/timeline/parts/item.ts +16 -5
- package/s/timeline/parts/media.ts +11 -0
- package/s/timeline/renderers/parts/handy.ts +16 -0
- package/s/timeline/renderers/parts/samplers/visual/parts/defaults.ts +7 -1
- package/s/timeline/renderers/parts/samplers/visual/parts/image-sink.ts +51 -0
- package/s/timeline/renderers/parts/samplers/visual/parts/sample.ts +7 -0
- package/s/timeline/renderers/parts/samplers/visual/parts/types.ts +2 -1
- package/s/timeline/renderers/parts/samplers/visual/sampler.ts +8 -5
- package/s/timeline/sugar/helpers.ts +9 -0
- package/s/timeline/sugar/o.ts +21 -1
- package/x/demo/demo.bundle.min.js +100 -100
- package/x/demo/demo.bundle.min.js.map +4 -4
- package/x/features/bg-remover/bg-remover.d.ts +5 -0
- package/x/features/bg-remover/bg-remover.js +18 -0
- package/x/features/bg-remover/bg-remover.js.map +1 -0
- package/x/features/bg-remover/default-spec.d.ts +2 -0
- package/x/features/bg-remover/default-spec.js +6 -0
- package/x/features/bg-remover/default-spec.js.map +1 -0
- package/x/features/bg-remover/types.d.ts +20 -0
- package/x/features/bg-remover/types.js +2 -0
- package/x/features/bg-remover/types.js.map +1 -0
- package/x/features/bg-remover/worker.bundle.d.ts +1 -0
- package/x/features/bg-remover/worker.bundle.js +38 -0
- package/x/features/bg-remover/worker.bundle.js.map +1 -0
- package/x/features/bg-remover/worker.bundle.min.js +2916 -0
- package/x/features/bg-remover/worker.bundle.min.js.map +7 -0
- package/x/features/parts/load-pipe.d.ts +2 -0
- package/x/features/{speech/transcribe/parts → parts}/load-pipe.js +1 -1
- package/x/features/parts/load-pipe.js.map +1 -0
- package/x/features/parts/types.d.ts +15 -0
- package/x/features/parts/types.js +2 -0
- package/x/features/parts/types.js.map +1 -0
- package/x/features/speech/transcribe/default-spec.js +2 -2
- package/x/features/speech/transcribe/default-spec.js.map +1 -1
- package/x/features/speech/transcribe/types.d.ts +5 -14
- package/x/features/speech/transcribe/worker.bundle.js +3 -2
- package/x/features/speech/transcribe/worker.bundle.js.map +1 -1
- package/x/features/speech/transcribe/worker.bundle.min.js +1 -1
- package/x/features/speech/transcribe/worker.bundle.min.js.map +3 -3
- package/x/index.html +4 -4
- package/x/index.html.js +2 -2
- package/x/tests.bundle.min.js +103 -103
- package/x/tests.bundle.min.js.map +4 -4
- package/x/tests.html +1 -1
- package/x/timeline/parts/captions.d.ts +1 -0
- package/x/timeline/parts/captions.js.map +1 -1
- package/x/timeline/parts/item.d.ts +15 -6
- package/x/timeline/parts/item.js +1 -0
- package/x/timeline/parts/item.js.map +1 -1
- package/x/timeline/parts/media.d.ts +1 -0
- package/x/timeline/parts/media.js +8 -0
- package/x/timeline/parts/media.js.map +1 -1
- package/x/timeline/renderers/parts/handy.d.ts +1 -0
- package/x/timeline/renderers/parts/handy.js +11 -0
- package/x/timeline/renderers/parts/handy.js.map +1 -1
- package/x/timeline/renderers/parts/samplers/visual/parts/defaults.d.ts +4 -1
- package/x/timeline/renderers/parts/samplers/visual/parts/defaults.js +3 -0
- package/x/timeline/renderers/parts/samplers/visual/parts/defaults.js.map +1 -1
- package/x/timeline/renderers/parts/samplers/visual/parts/image-sink.d.ts +11 -0
- package/x/timeline/renderers/parts/samplers/visual/parts/image-sink.js +36 -0
- package/x/timeline/renderers/parts/samplers/visual/parts/image-sink.js.map +1 -0
- package/x/timeline/renderers/parts/samplers/visual/parts/sample.js +6 -0
- package/x/timeline/renderers/parts/samplers/visual/parts/sample.js.map +1 -1
- package/x/timeline/renderers/parts/samplers/visual/parts/types.d.ts +2 -1
- package/x/timeline/renderers/parts/samplers/visual/parts/{sink.js → video-sink.js} +1 -1
- package/x/timeline/renderers/parts/samplers/visual/parts/video-sink.js.map +1 -0
- package/x/timeline/renderers/parts/samplers/visual/sampler.js +8 -5
- package/x/timeline/renderers/parts/samplers/visual/sampler.js.map +1 -1
- package/x/timeline/sugar/helpers.d.ts +3 -0
- package/x/timeline/sugar/helpers.js +3 -0
- package/x/timeline/sugar/helpers.js.map +1 -1
- package/x/timeline/sugar/o.d.ts +3 -0
- package/x/timeline/sugar/o.js +14 -1
- package/x/timeline/sugar/o.js.map +1 -1
- package/x/features/speech/transcribe/parts/load-pipe.d.ts +0 -2
- package/x/features/speech/transcribe/parts/load-pipe.js.map +0 -1
- package/x/timeline/renderers/parts/samplers/visual/parts/sink.js.map +0 -1
- /package/s/timeline/renderers/parts/samplers/visual/parts/{sink.ts → video-sink.ts} +0 -0
- /package/x/timeline/renderers/parts/samplers/visual/parts/{sink.d.ts → video-sink.d.ts} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { PipeOptions } from "./types.js";
|
|
2
|
+
export declare function loadPipe(options: PipeOptions): Promise<import("@huggingface/transformers").TextClassificationPipeline | import("@huggingface/transformers").TokenClassificationPipeline | import("@huggingface/transformers").QuestionAnsweringPipeline | import("@huggingface/transformers").FillMaskPipeline | import("@huggingface/transformers").SummarizationPipeline | import("@huggingface/transformers").TranslationPipeline | import("@huggingface/transformers").Text2TextGenerationPipeline | import("@huggingface/transformers").TextGenerationPipeline | import("@huggingface/transformers").ZeroShotClassificationPipeline | import("@huggingface/transformers").AudioClassificationPipeline | import("@huggingface/transformers").ZeroShotAudioClassificationPipeline | import("@huggingface/transformers").AutomaticSpeechRecognitionPipeline | import("@huggingface/transformers").TextToAudioPipeline | import("@huggingface/transformers").ImageToTextPipeline | import("@huggingface/transformers").ImageClassificationPipeline | import("@huggingface/transformers").ImageSegmentationPipeline | import("@huggingface/transformers").BackgroundRemovalPipeline | import("@huggingface/transformers").ZeroShotImageClassificationPipeline | import("@huggingface/transformers").ObjectDetectionPipeline | import("@huggingface/transformers").ZeroShotObjectDetectionPipeline | import("@huggingface/transformers").DocumentQuestionAnsweringPipeline | import("@huggingface/transformers").ImageToImagePipeline | import("@huggingface/transformers").DepthEstimationPipeline | import("@huggingface/transformers").FeatureExtractionPipeline | import("@huggingface/transformers").ImageFeatureExtractionPipeline>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { pipeline } from "@huggingface/transformers";
|
|
2
2
|
export async function loadPipe(options) {
|
|
3
3
|
const { spec, onLoading } = options;
|
|
4
|
-
const pipe = await pipeline(
|
|
4
|
+
const pipe = await pipeline(options.task, spec.model, {
|
|
5
5
|
device: spec.device,
|
|
6
6
|
dtype: spec.dtype,
|
|
7
7
|
progress_callback: (data) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-pipe.js","sourceRoot":"","sources":["../../../s/features/parts/load-pipe.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,2BAA2B,CAAA;AAGlD,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAAoB;IAClD,MAAM,EAAC,IAAI,EAAE,SAAS,EAAC,GAAG,OAAO,CAAA;IAEjC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE;QACrD,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,iBAAiB,EAAE,CAAC,IAAS,EAAE,EAAE;YAChC,SAAS,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAC,CAAC,CAAA;QACxD,CAAC;KACD,CAAC,CAAA;IAEF,OAAO,IAAI,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DataType, DeviceType, TaskType } from "@huggingface/transformers";
|
|
2
|
+
export type Loading = {
|
|
3
|
+
total: number;
|
|
4
|
+
progress: number;
|
|
5
|
+
};
|
|
6
|
+
export type PipelineSpec<Extras extends object = {}> = {
|
|
7
|
+
model: string;
|
|
8
|
+
dtype: DataType;
|
|
9
|
+
device: DeviceType;
|
|
10
|
+
} & Extras;
|
|
11
|
+
export type PipeOptions = {
|
|
12
|
+
spec: PipelineSpec;
|
|
13
|
+
task: TaskType;
|
|
14
|
+
onLoading: (loading: Loading) => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../s/features/parts/types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-spec.js","sourceRoot":"","sources":["../../../../s/features/speech/transcribe/default-spec.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAoB,EAAE,CAAC,CAAC;IAC7D,KAAK,EAAE,yCAAyC;IAChD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"default-spec.js","sourceRoot":"","sources":["../../../../s/features/speech/transcribe/default-spec.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAoB,EAAE,CAAC,CAAC;IAC7D,KAAK,EAAE,yCAAyC;IAChD,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,EAAE;IACf,YAAY,EAAE,CAAC;CACf,CAAC,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AsSchematic } from "@e280/comrade";
|
|
2
|
-
import {
|
|
2
|
+
import { Pipeline } from "@huggingface/transformers";
|
|
3
|
+
import { Loading, PipelineSpec } from "../../parts/types.js";
|
|
3
4
|
import { Driver } from "../../../driver/driver.js";
|
|
4
5
|
export type TranscriberSchematic = AsSchematic<{
|
|
5
6
|
work: {
|
|
@@ -12,20 +13,12 @@ export type TranscriberSchematic = AsSchematic<{
|
|
|
12
13
|
deliverTranscription(transcription: string): Promise<void>;
|
|
13
14
|
};
|
|
14
15
|
}>;
|
|
15
|
-
export type Loading = {
|
|
16
|
-
total: number;
|
|
17
|
-
progress: number;
|
|
18
|
-
};
|
|
19
16
|
export type TranscribeOptions = {
|
|
20
17
|
pipe: Pipeline;
|
|
21
18
|
spec: TranscriberSpec;
|
|
22
19
|
request: TranscriptionRequest;
|
|
23
20
|
callbacks: TranscriptionCallbacks;
|
|
24
21
|
};
|
|
25
|
-
export type TranscriberPipeOptions = {
|
|
26
|
-
spec: TranscriberSpec;
|
|
27
|
-
onLoading: (loading: Loading) => void;
|
|
28
|
-
};
|
|
29
22
|
export type SpeechTime = [start: number, end: number];
|
|
30
23
|
export type TranscriptWord = {
|
|
31
24
|
text: string;
|
|
@@ -36,13 +29,11 @@ export type Transcription = {
|
|
|
36
29
|
text: string;
|
|
37
30
|
chunks: TranscriptWord[];
|
|
38
31
|
};
|
|
39
|
-
export type
|
|
40
|
-
|
|
41
|
-
dtype: DataType;
|
|
42
|
-
device: DeviceType;
|
|
32
|
+
export type TranscriberModels = "onnx-community/whisper-tiny_timestamped";
|
|
33
|
+
export type TranscriberSpec = PipelineSpec<{
|
|
43
34
|
chunkLength: number;
|
|
44
35
|
strideLength: number;
|
|
45
|
-
}
|
|
36
|
+
}>;
|
|
46
37
|
export type TranscriptionOptions = {
|
|
47
38
|
source: Blob;
|
|
48
39
|
language: string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defer, once } from "@e280/stz";
|
|
2
2
|
import { Comrade } from "@e280/comrade";
|
|
3
|
-
import { loadPipe } from "
|
|
3
|
+
import { loadPipe } from "../../parts/load-pipe.js";
|
|
4
4
|
import { transcribe } from "./parts/transcribe.js";
|
|
5
5
|
const deferred = defer();
|
|
6
6
|
const makePrepare = (host) => once(async (spec) => {
|
|
@@ -8,8 +8,9 @@ const makePrepare = (host) => once(async (spec) => {
|
|
|
8
8
|
spec,
|
|
9
9
|
pipe: await loadPipe({
|
|
10
10
|
spec,
|
|
11
|
+
task: "automatic-speech-recognition",
|
|
11
12
|
onLoading: loading => host.loading(loading),
|
|
12
|
-
})
|
|
13
|
+
})
|
|
13
14
|
});
|
|
14
15
|
});
|
|
15
16
|
await Comrade.worker(shell => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.bundle.js","sourceRoot":"","sources":["../../../../s/features/speech/transcribe/worker.bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AACrC,OAAO,EAAC,OAAO,EAAO,MAAM,eAAe,CAAA;AAG3C,OAAO,EAAC,QAAQ,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"worker.bundle.js","sourceRoot":"","sources":["../../../../s/features/speech/transcribe/worker.bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AACrC,OAAO,EAAC,OAAO,EAAO,MAAM,eAAe,CAAA;AAG3C,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAGhD,MAAM,QAAQ,GAAG,KAAK,EAA2C,CAAA;AAEjE,MAAM,WAAW,GAAG,CAAC,IAAgC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,EAAC,IAAqB,EAAE,EAAE;IAC7F,QAAQ,CAAC,OAAO,CAAC;QAChB,IAAI;QACJ,IAAI,EAAE,MAAM,QAAQ,CAAC;YACpB,IAAI;YACJ,IAAI,EAAE,8BAA8B;YACpC,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;SAC3C,CAAuC;KACxC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,MAAM,OAAO,CAAC,MAAM,CAAuB,KAAK,CAAC,EAAE;IAClD,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACvC,OAAO;QACN,OAAO;QACP,KAAK,CAAC,UAAU,CAAC,OAAO;YACvB,MAAM,EAAC,IAAI,EAAE,IAAI,EAAC,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAA;YAC3C,OAAO,UAAU,CAAC;gBACjB,IAAI;gBACJ,IAAI;gBACJ,OAAO;gBACP,SAAS,EAAE;oBACV,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;oBACpD,eAAe,EAAE,aAAa,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC;iBAChF;aACD,CAAC,CAAA;QACH,CAAC;KACD,CAAA;AACF,CAAC,CAAC,CAAA"}
|