Skip to content

HINet

Warning

This is very large model and the weight file takes approximately 400MB on the disk.

Image title

Original image and denoised image

BiWAKO.HINet

HINet for denoising image.

Attributes:

Name Type Description
model InferenceSession

ONNX model.

input_name str

Name of input node.

input_shape tuple

Shape of input node.

__init__(self, model='denoise_320_480') special

Initialize HINet.

Parameters:

Name Type Description Default
model str

Choise of model. Weight file is automatically downloaded to the current directory at the first time. Defaults to "denoise_320_480.onnx".

'denoise_320_480'

predict(self, image)

Return denoised image.

Parameters:

Name Type Description Default
image Image

Image to be denoised in str or cv2 format.

required

Returns:

Type Description
np.ndarray

Denoised image array containing two images for different denoising methods.

render(self, prediction, image=None, output_type=0, output_shape=None)

Return the denoised image in original image size.

Parameters:

Name Type Description Default
prediction np.ndarray

Return value of predict().

required
image Image

Image to be processed in str or cv2 format. Defaults to None.

None
output_type Literal[0, 1]

Choice of denoising method either 0 or 1. Defaults to 0.

0
output_shape Optional[Tuple[int, int]]

Optional tuple of int to resize the return image. Defaults to None.

None

Exceptions:

Type Description
ValueError

If none of the original image or image size is given.

ValueError

If output_type is not 0 or 1.

Returns:

Type Description
np.ndarray

Denoised image in cv2 format.