fix memory leak in histogramEqualization

Bug was introduced in cc4650c after rgb variable had been renamed.
pull/405/head
Kozyrev Vladislav 2023-05-03 10:34:08 +03:00 committed by Vladimir Mandic
parent 73544e6c1b
commit acf6bead21
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ export async function histogramEqualization(inputImage: Tensor): Promise<Tensor>
const enh = [tf.mul(sub[0], factor), tf.mul(sub[1], factor), tf.mul(sub[2], factor)];
const stack = tf.stack([enh[0], enh[1], enh[2]], 2);
final = tf.reshape(stack, [1, squeeze.shape[0] || 0, squeeze.shape[1] || 0, 3]);
tf.dispose([...sub, ...range, ...enh]);
tf.dispose([...sub, ...range, ...enh, stack]);
} else {
final = tf.expandDims(squeeze, 0);
}