longpipe 0.0.6 → 0.0.8
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 +37 -17
- package/dist/index.cjs +4165 -1926
- package/dist/index.d.cts +27 -4
- package/dist/index.d.ts +27 -4
- package/dist/index.js +4165 -1926
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -23,7 +23,7 @@ interface Op {
|
|
|
23
23
|
interface Presenter {
|
|
24
24
|
run(): void;
|
|
25
25
|
}
|
|
26
|
-
type Activation = "none" | "relu6";
|
|
26
|
+
type Activation = "none" | "relu6" | "relu";
|
|
27
27
|
interface Conv2dParams {
|
|
28
28
|
outChannels: number;
|
|
29
29
|
kernel: number;
|
|
@@ -47,6 +47,15 @@ interface UpsampleConv1x1Params {
|
|
|
47
47
|
outChannels: number;
|
|
48
48
|
activation: Activation;
|
|
49
49
|
}
|
|
50
|
+
interface ProjResidualParams {
|
|
51
|
+
outChannels: number;
|
|
52
|
+
}
|
|
53
|
+
interface ConcatConv2dParams {
|
|
54
|
+
outChannels: number;
|
|
55
|
+
}
|
|
56
|
+
interface DownAdapterParams {
|
|
57
|
+
stride: number;
|
|
58
|
+
}
|
|
50
59
|
type ImageSource = ImageBitmap | VideoFrame;
|
|
51
60
|
interface InputOp {
|
|
52
61
|
readonly output: Tensor;
|
|
@@ -67,7 +76,18 @@ interface Backend {
|
|
|
67
76
|
BilinearUpsample: (input: Tensor, params: UpsampleParams) => Op;
|
|
68
77
|
BicubicUpsample: (input: Tensor, params: UpsampleParams) => Op;
|
|
69
78
|
ChannelConcat: (a: Tensor, b: Tensor) => Op;
|
|
79
|
+
Tanh: (input: Tensor) => Op;
|
|
80
|
+
ElementwiseMul: (a: Tensor, b: Tensor) => Op;
|
|
81
|
+
GatesFused: (uIn: Tensor, hPrev: Tensor, weights: Conv2DWeights) => Op;
|
|
82
|
+
CandUpdateFused: (uIn: Tensor, hPrev: Tensor, gatesOut: Tensor, weights: Conv2DWeights, gamma: ArrayLike<number>) => Op;
|
|
83
|
+
ConvExpand: (input: Tensor, weights: Conv2DWeights) => Op;
|
|
84
|
+
CatConv6to2: (u: Tensor, d: Tensor, weights: Conv2DWeights) => Op;
|
|
85
|
+
DownAdapter: (input: Tensor, downWeights: Conv2DWeights, adaptWeights: Conv2DWeights, params: DownAdapterParams) => Op;
|
|
86
|
+
UpFinal: (u: Tensor, rgb: Tensor, weights: Conv2DWeights) => Op;
|
|
87
|
+
UpFinalSkip: (u: Tensor, dFull: Tensor, rgb: Tensor, weights: Conv2DWeights) => Op;
|
|
70
88
|
Conv2dAdd: (input: Tensor, skip: Tensor, weights: Conv2DWeights, params: Conv2dParams) => Op;
|
|
89
|
+
ProjResidual: (input: Tensor, skip: Tensor, weights: Conv2DWeights, params: ProjResidualParams) => Op;
|
|
90
|
+
ConcatConv2d: (a: Tensor, b: Tensor, weights: Conv2DWeights, params: ConcatConv2dParams) => Op;
|
|
71
91
|
UpsampleConcat: (a: Tensor, b: Tensor, params: UpsampleParams) => Op;
|
|
72
92
|
UpsampleConv1x1: (input: Tensor, weights: Conv2DWeights, params: UpsampleConv1x1Params) => Op;
|
|
73
93
|
UpsampleSigmoid: (input: Tensor, params: UpsampleParams) => Op;
|
|
@@ -80,11 +100,12 @@ interface Backend {
|
|
|
80
100
|
CompositePassthrough: (image: Tensor) => Presenter;
|
|
81
101
|
};
|
|
82
102
|
readback(tensor: Tensor): Promise<Float32Array>;
|
|
103
|
+
copyTensor(src: Tensor, dst: Tensor): void;
|
|
83
104
|
sync(): Promise<void>;
|
|
84
105
|
destroy(): void;
|
|
85
106
|
}
|
|
86
107
|
|
|
87
|
-
type ModelName = '
|
|
108
|
+
type ModelName = 'xs' | 'small' | 'medium' | 'large' | 'xl';
|
|
88
109
|
type PresetName = 'fast' | 'balanced' | 'quality' | 'auto';
|
|
89
110
|
interface ManualPreset {
|
|
90
111
|
model: ModelName;
|
|
@@ -97,7 +118,7 @@ interface ManualPreset {
|
|
|
97
118
|
}
|
|
98
119
|
|
|
99
120
|
type BackgroundInput = 'blur' | 'none' | string | ImageBitmap | HTMLImageElement | HTMLVideoElement | {
|
|
100
|
-
color:
|
|
121
|
+
color: ColorInput;
|
|
101
122
|
} | {
|
|
102
123
|
blur: BlurInput;
|
|
103
124
|
} | {
|
|
@@ -110,6 +131,7 @@ type BlurInput = true | {
|
|
|
110
131
|
} | {
|
|
111
132
|
sigma: number;
|
|
112
133
|
};
|
|
134
|
+
type ColorInput = string | [number, number, number];
|
|
113
135
|
type ImageInput = ImageBitmap | HTMLImageElement | string | {
|
|
114
136
|
data: ArrayBuffer | Blob | Uint8Array;
|
|
115
137
|
type: string;
|
|
@@ -220,8 +242,9 @@ declare class WebGPUBackend implements Backend {
|
|
|
220
242
|
upload(data: DataView_): WebGPUMLBuffer;
|
|
221
243
|
private writeView;
|
|
222
244
|
readback(tensor: WebGPUTensor): Promise<Float32Array>;
|
|
245
|
+
copyTensor(src: WebGPUTensor, dst: WebGPUTensor): void;
|
|
223
246
|
sync(): Promise<void>;
|
|
224
247
|
destroy(): void;
|
|
225
248
|
}
|
|
226
249
|
|
|
227
|
-
export { type Activation, type AudioMode, type Backend, type Background, type BackgroundInput, type BlurInput, type Conv2dParams, type DepthwiseParams, Pipeline as EffectsPipeline, type ErrorSource, type ImageInput, type ManualPreset, type ModelName, type Op, type PipelineError, type PipelineOptions, type PresetName, type Tensor, type VideoInput, WebGPUBackend };
|
|
250
|
+
export { type Activation, type AudioMode, type Backend, type Background, type BackgroundInput, type BlurInput, type ColorInput, type Conv2dParams, type DepthwiseParams, Pipeline as EffectsPipeline, type ErrorSource, type ImageInput, type ManualPreset, type ModelName, type Op, type PipelineError, type PipelineOptions, type PresetName, type Tensor, type VideoInput, WebGPUBackend };
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ interface Op {
|
|
|
23
23
|
interface Presenter {
|
|
24
24
|
run(): void;
|
|
25
25
|
}
|
|
26
|
-
type Activation = "none" | "relu6";
|
|
26
|
+
type Activation = "none" | "relu6" | "relu";
|
|
27
27
|
interface Conv2dParams {
|
|
28
28
|
outChannels: number;
|
|
29
29
|
kernel: number;
|
|
@@ -47,6 +47,15 @@ interface UpsampleConv1x1Params {
|
|
|
47
47
|
outChannels: number;
|
|
48
48
|
activation: Activation;
|
|
49
49
|
}
|
|
50
|
+
interface ProjResidualParams {
|
|
51
|
+
outChannels: number;
|
|
52
|
+
}
|
|
53
|
+
interface ConcatConv2dParams {
|
|
54
|
+
outChannels: number;
|
|
55
|
+
}
|
|
56
|
+
interface DownAdapterParams {
|
|
57
|
+
stride: number;
|
|
58
|
+
}
|
|
50
59
|
type ImageSource = ImageBitmap | VideoFrame;
|
|
51
60
|
interface InputOp {
|
|
52
61
|
readonly output: Tensor;
|
|
@@ -67,7 +76,18 @@ interface Backend {
|
|
|
67
76
|
BilinearUpsample: (input: Tensor, params: UpsampleParams) => Op;
|
|
68
77
|
BicubicUpsample: (input: Tensor, params: UpsampleParams) => Op;
|
|
69
78
|
ChannelConcat: (a: Tensor, b: Tensor) => Op;
|
|
79
|
+
Tanh: (input: Tensor) => Op;
|
|
80
|
+
ElementwiseMul: (a: Tensor, b: Tensor) => Op;
|
|
81
|
+
GatesFused: (uIn: Tensor, hPrev: Tensor, weights: Conv2DWeights) => Op;
|
|
82
|
+
CandUpdateFused: (uIn: Tensor, hPrev: Tensor, gatesOut: Tensor, weights: Conv2DWeights, gamma: ArrayLike<number>) => Op;
|
|
83
|
+
ConvExpand: (input: Tensor, weights: Conv2DWeights) => Op;
|
|
84
|
+
CatConv6to2: (u: Tensor, d: Tensor, weights: Conv2DWeights) => Op;
|
|
85
|
+
DownAdapter: (input: Tensor, downWeights: Conv2DWeights, adaptWeights: Conv2DWeights, params: DownAdapterParams) => Op;
|
|
86
|
+
UpFinal: (u: Tensor, rgb: Tensor, weights: Conv2DWeights) => Op;
|
|
87
|
+
UpFinalSkip: (u: Tensor, dFull: Tensor, rgb: Tensor, weights: Conv2DWeights) => Op;
|
|
70
88
|
Conv2dAdd: (input: Tensor, skip: Tensor, weights: Conv2DWeights, params: Conv2dParams) => Op;
|
|
89
|
+
ProjResidual: (input: Tensor, skip: Tensor, weights: Conv2DWeights, params: ProjResidualParams) => Op;
|
|
90
|
+
ConcatConv2d: (a: Tensor, b: Tensor, weights: Conv2DWeights, params: ConcatConv2dParams) => Op;
|
|
71
91
|
UpsampleConcat: (a: Tensor, b: Tensor, params: UpsampleParams) => Op;
|
|
72
92
|
UpsampleConv1x1: (input: Tensor, weights: Conv2DWeights, params: UpsampleConv1x1Params) => Op;
|
|
73
93
|
UpsampleSigmoid: (input: Tensor, params: UpsampleParams) => Op;
|
|
@@ -80,11 +100,12 @@ interface Backend {
|
|
|
80
100
|
CompositePassthrough: (image: Tensor) => Presenter;
|
|
81
101
|
};
|
|
82
102
|
readback(tensor: Tensor): Promise<Float32Array>;
|
|
103
|
+
copyTensor(src: Tensor, dst: Tensor): void;
|
|
83
104
|
sync(): Promise<void>;
|
|
84
105
|
destroy(): void;
|
|
85
106
|
}
|
|
86
107
|
|
|
87
|
-
type ModelName = '
|
|
108
|
+
type ModelName = 'xs' | 'small' | 'medium' | 'large' | 'xl';
|
|
88
109
|
type PresetName = 'fast' | 'balanced' | 'quality' | 'auto';
|
|
89
110
|
interface ManualPreset {
|
|
90
111
|
model: ModelName;
|
|
@@ -97,7 +118,7 @@ interface ManualPreset {
|
|
|
97
118
|
}
|
|
98
119
|
|
|
99
120
|
type BackgroundInput = 'blur' | 'none' | string | ImageBitmap | HTMLImageElement | HTMLVideoElement | {
|
|
100
|
-
color:
|
|
121
|
+
color: ColorInput;
|
|
101
122
|
} | {
|
|
102
123
|
blur: BlurInput;
|
|
103
124
|
} | {
|
|
@@ -110,6 +131,7 @@ type BlurInput = true | {
|
|
|
110
131
|
} | {
|
|
111
132
|
sigma: number;
|
|
112
133
|
};
|
|
134
|
+
type ColorInput = string | [number, number, number];
|
|
113
135
|
type ImageInput = ImageBitmap | HTMLImageElement | string | {
|
|
114
136
|
data: ArrayBuffer | Blob | Uint8Array;
|
|
115
137
|
type: string;
|
|
@@ -220,8 +242,9 @@ declare class WebGPUBackend implements Backend {
|
|
|
220
242
|
upload(data: DataView_): WebGPUMLBuffer;
|
|
221
243
|
private writeView;
|
|
222
244
|
readback(tensor: WebGPUTensor): Promise<Float32Array>;
|
|
245
|
+
copyTensor(src: WebGPUTensor, dst: WebGPUTensor): void;
|
|
223
246
|
sync(): Promise<void>;
|
|
224
247
|
destroy(): void;
|
|
225
248
|
}
|
|
226
249
|
|
|
227
|
-
export { type Activation, type AudioMode, type Backend, type Background, type BackgroundInput, type BlurInput, type Conv2dParams, type DepthwiseParams, Pipeline as EffectsPipeline, type ErrorSource, type ImageInput, type ManualPreset, type ModelName, type Op, type PipelineError, type PipelineOptions, type PresetName, type Tensor, type VideoInput, WebGPUBackend };
|
|
250
|
+
export { type Activation, type AudioMode, type Backend, type Background, type BackgroundInput, type BlurInput, type ColorInput, type Conv2dParams, type DepthwiseParams, Pipeline as EffectsPipeline, type ErrorSource, type ImageInput, type ManualPreset, type ModelName, type Op, type PipelineError, type PipelineOptions, type PresetName, type Tensor, type VideoInput, WebGPUBackend };
|