Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -18,13 +18,15 @@ def fast_poisson_sharpening(img, alpha):
|
|
18 |
return np.clip(output, 0, 1)
|
19 |
|
20 |
def sharpen_image(input_img, alpha):
|
|
|
21 |
img = cv2.cvtColor(input_img, cv2.COLOR_BGR2RGB).astype('float32') / 255.0
|
22 |
|
23 |
sharpen_img = np.zeros_like(img)
|
24 |
for b in range(3):
|
25 |
sharpen_img[:,:,b] = fast_poisson_sharpening(img[:,:,b], alpha)
|
26 |
|
27 |
-
|
|
|
28 |
|
29 |
# Create examples list
|
30 |
examples = [
|
|
|
18 |
return np.clip(output, 0, 1)
|
19 |
|
20 |
def sharpen_image(input_img, alpha):
|
21 |
+
# Convert BGR to RGB
|
22 |
img = cv2.cvtColor(input_img, cv2.COLOR_BGR2RGB).astype('float32') / 255.0
|
23 |
|
24 |
sharpen_img = np.zeros_like(img)
|
25 |
for b in range(3):
|
26 |
sharpen_img[:,:,b] = fast_poisson_sharpening(img[:,:,b], alpha)
|
27 |
|
28 |
+
# Convert back to BGR for output
|
29 |
+
return cv2.cvtColor((sharpen_img * 255).astype(np.uint8), cv2.COLOR_RGB2BGR)
|
30 |
|
31 |
# Create examples list
|
32 |
examples = [
|