longpipe 0.0.7 → 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/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 = 'xxs' | 'xs' | 'small' | 'compact' | 'medium' | 'large' | 'xl';
108
+ type ModelName = 'xs' | 'small' | 'medium' | 'large' | 'xl';
88
109
  type PresetName = 'fast' | 'balanced' | 'quality' | 'auto';
89
110
  interface ManualPreset {
90
111
  model: ModelName;
@@ -221,6 +242,7 @@ declare class WebGPUBackend implements Backend {
221
242
  upload(data: DataView_): WebGPUMLBuffer;
222
243
  private writeView;
223
244
  readback(tensor: WebGPUTensor): Promise<Float32Array>;
245
+ copyTensor(src: WebGPUTensor, dst: WebGPUTensor): void;
224
246
  sync(): Promise<void>;
225
247
  destroy(): void;
226
248
  }
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 = 'xxs' | 'xs' | 'small' | 'compact' | 'medium' | 'large' | 'xl';
108
+ type ModelName = 'xs' | 'small' | 'medium' | 'large' | 'xl';
88
109
  type PresetName = 'fast' | 'balanced' | 'quality' | 'auto';
89
110
  interface ManualPreset {
90
111
  model: ModelName;
@@ -221,6 +242,7 @@ declare class WebGPUBackend implements Backend {
221
242
  upload(data: DataView_): WebGPUMLBuffer;
222
243
  private writeView;
223
244
  readback(tensor: WebGPUTensor): Promise<Float32Array>;
245
+ copyTensor(src: WebGPUTensor, dst: WebGPUTensor): void;
224
246
  sync(): Promise<void>;
225
247
  destroy(): void;
226
248
  }