@omnimedia/omnitool 1.1.0-95 → 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.
Files changed (88) hide show
  1. package/package.json +1 -1
  2. package/s/features/bg-remover/bg-remover.ts +26 -0
  3. package/s/features/bg-remover/default-spec.ts +11 -0
  4. package/s/features/bg-remover/types.ts +27 -0
  5. package/s/features/bg-remover/worker.bundle.ts +51 -0
  6. package/s/features/{speech/transcribe/parts → parts}/load-pipe.ts +3 -5
  7. package/s/features/parts/types.ts +19 -0
  8. package/s/features/speech/transcribe/default-spec.ts +2 -2
  9. package/s/features/speech/transcribe/types.ts +6 -16
  10. package/s/features/speech/transcribe/worker.bundle.ts +4 -3
  11. package/s/index.html.ts +2 -2
  12. package/s/timeline/parts/item.ts +15 -3
  13. package/s/timeline/parts/media.ts +11 -0
  14. package/s/timeline/renderers/parts/handy.ts +16 -0
  15. package/s/timeline/renderers/parts/samplers/visual/parts/defaults.ts +7 -1
  16. package/s/timeline/renderers/parts/samplers/visual/parts/image-sink.ts +51 -0
  17. package/s/timeline/renderers/parts/samplers/visual/parts/sample.ts +7 -0
  18. package/s/timeline/renderers/parts/samplers/visual/parts/types.ts +2 -1
  19. package/s/timeline/renderers/parts/samplers/visual/sampler.ts +8 -5
  20. package/s/timeline/sugar/helpers.ts +9 -0
  21. package/s/timeline/sugar/o.ts +19 -0
  22. package/x/demo/demo.bundle.min.js +100 -100
  23. package/x/demo/demo.bundle.min.js.map +4 -4
  24. package/x/features/bg-remover/bg-remover.d.ts +5 -0
  25. package/x/features/bg-remover/bg-remover.js +18 -0
  26. package/x/features/bg-remover/bg-remover.js.map +1 -0
  27. package/x/features/bg-remover/default-spec.d.ts +2 -0
  28. package/x/features/bg-remover/default-spec.js +6 -0
  29. package/x/features/bg-remover/default-spec.js.map +1 -0
  30. package/x/features/bg-remover/types.d.ts +20 -0
  31. package/x/features/bg-remover/types.js +2 -0
  32. package/x/features/bg-remover/types.js.map +1 -0
  33. package/x/features/bg-remover/worker.bundle.d.ts +1 -0
  34. package/x/features/bg-remover/worker.bundle.js +38 -0
  35. package/x/features/bg-remover/worker.bundle.js.map +1 -0
  36. package/x/features/bg-remover/worker.bundle.min.js +2916 -0
  37. package/x/features/bg-remover/worker.bundle.min.js.map +7 -0
  38. package/x/features/parts/load-pipe.d.ts +2 -0
  39. package/x/features/{speech/transcribe/parts → parts}/load-pipe.js +1 -1
  40. package/x/features/parts/load-pipe.js.map +1 -0
  41. package/x/features/parts/types.d.ts +15 -0
  42. package/x/features/parts/types.js +2 -0
  43. package/x/features/parts/types.js.map +1 -0
  44. package/x/features/speech/transcribe/default-spec.js +2 -2
  45. package/x/features/speech/transcribe/default-spec.js.map +1 -1
  46. package/x/features/speech/transcribe/types.d.ts +5 -14
  47. package/x/features/speech/transcribe/worker.bundle.js +3 -2
  48. package/x/features/speech/transcribe/worker.bundle.js.map +1 -1
  49. package/x/features/speech/transcribe/worker.bundle.min.js +1 -1
  50. package/x/features/speech/transcribe/worker.bundle.min.js.map +3 -3
  51. package/x/index.html +4 -4
  52. package/x/index.html.js +2 -2
  53. package/x/tests.bundle.min.js +103 -103
  54. package/x/tests.bundle.min.js.map +4 -4
  55. package/x/tests.html +1 -1
  56. package/x/timeline/parts/item.d.ts +14 -4
  57. package/x/timeline/parts/item.js +1 -0
  58. package/x/timeline/parts/item.js.map +1 -1
  59. package/x/timeline/parts/media.d.ts +1 -0
  60. package/x/timeline/parts/media.js +8 -0
  61. package/x/timeline/parts/media.js.map +1 -1
  62. package/x/timeline/renderers/parts/handy.d.ts +1 -0
  63. package/x/timeline/renderers/parts/handy.js +11 -0
  64. package/x/timeline/renderers/parts/handy.js.map +1 -1
  65. package/x/timeline/renderers/parts/samplers/visual/parts/defaults.d.ts +4 -1
  66. package/x/timeline/renderers/parts/samplers/visual/parts/defaults.js +3 -0
  67. package/x/timeline/renderers/parts/samplers/visual/parts/defaults.js.map +1 -1
  68. package/x/timeline/renderers/parts/samplers/visual/parts/image-sink.d.ts +11 -0
  69. package/x/timeline/renderers/parts/samplers/visual/parts/image-sink.js +36 -0
  70. package/x/timeline/renderers/parts/samplers/visual/parts/image-sink.js.map +1 -0
  71. package/x/timeline/renderers/parts/samplers/visual/parts/sample.js +6 -0
  72. package/x/timeline/renderers/parts/samplers/visual/parts/sample.js.map +1 -1
  73. package/x/timeline/renderers/parts/samplers/visual/parts/types.d.ts +2 -1
  74. package/x/timeline/renderers/parts/samplers/visual/parts/{sink.js → video-sink.js} +1 -1
  75. package/x/timeline/renderers/parts/samplers/visual/parts/video-sink.js.map +1 -0
  76. package/x/timeline/renderers/parts/samplers/visual/sampler.js +8 -5
  77. package/x/timeline/renderers/parts/samplers/visual/sampler.js.map +1 -1
  78. package/x/timeline/sugar/helpers.d.ts +3 -0
  79. package/x/timeline/sugar/helpers.js +3 -0
  80. package/x/timeline/sugar/helpers.js.map +1 -1
  81. package/x/timeline/sugar/o.d.ts +3 -0
  82. package/x/timeline/sugar/o.js +12 -0
  83. package/x/timeline/sugar/o.js.map +1 -1
  84. package/x/features/speech/transcribe/parts/load-pipe.d.ts +0 -2
  85. package/x/features/speech/transcribe/parts/load-pipe.js.map +0 -1
  86. package/x/timeline/renderers/parts/samplers/visual/parts/sink.js.map +0 -1
  87. /package/s/timeline/renderers/parts/samplers/visual/parts/{sink.ts → video-sink.ts} +0 -0
  88. /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("automatic-speech-recognition", spec.model, {
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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../s/features/parts/types.ts"],"names":[],"mappings":""}
@@ -1,7 +1,7 @@
1
1
  export const defaultTranscriberSpec = () => ({
2
2
  model: "onnx-community/whisper-tiny_timestamped",
3
- dtype: "q4",
4
- device: "wasm",
3
+ dtype: "auto",
4
+ device: "webgpu",
5
5
  chunkLength: 20,
6
6
  strideLength: 3,
7
7
  });
@@ -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,IAAI;IACX,MAAM,EAAE,MAAM;IACd,WAAW,EAAE,EAAE;IACf,YAAY,EAAE,CAAC;CACf,CAAC,CAAA"}
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 { DataType, DeviceType, Pipeline } from "@huggingface/transformers";
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 TranscriberSpec = {
40
- model: string;
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 "./parts/load-pipe.js";
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,sBAAsB,CAAA;AAC7C,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,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;SAC3C,CAAC;KACF,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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