Image Sharpening with LatticaAI Demo Tutorial
Last updated
Was this helpful?
Last updated
Was this helpful?
Our Image Sharpening model enhances the clarity and detail of an input image by applying a specialized 2D filter through convolution.
Input Format: RGB image tensor of shape (3, 200, 200)
, with pixel values in the [0,1]
range.
Output: Sharpened image preserving original dimensions.
The equivalent pytorch code for the operator is:
In order to convert this simple code to use homomorphic operations, all you need are the following few extra steps:
Install Lattica python package and obtain a JWT token
Generate encryption keys
Replace the actual convolution with our function that will:
preprocess the image and encrypt it
send the encrypted data to the cloud for computation
receive and decrypt the encrypted result using your private key
Everything else remains the same.
First our client package
See our for a detailed explanation of each step in this flow. To use the image sharpening model use the imageEnhancement model ID