Spaces:
Runtime error
Runtime error
Commit
·
0c320e8
1
Parent(s):
fe25407
Update app.py
Browse files
app.py
CHANGED
@@ -6,15 +6,4 @@ def main():
|
|
6 |
st.title("Haltmann Diffusion Algorithm")
|
7 |
|
8 |
slider = st.slider("Slider", 0, 255, 128) # default value=128, min=0, max=255
|
9 |
-
|
10 |
-
algo = np.array([[0, 0, 0], [0, 1/3, 1/3], [0, 1/3, 2/3]])
|
11 |
-
|
12 |
-
image = Image.open('image.png') # your image here
|
13 |
-
|
14 |
-
pixels = np.array(image)
|
15 |
-
|
16 |
-
for i in range(pixels.shape[0]): # iterate over the rows of the image matrix (height) for j in range(pixels.shape[1]): # iterate over the columns of the image matrix (width) for k in range(pixels.shape[2]): # iterate over the color channels (RGB) if pixels[i][j][k] > slider: pixels[i][j][k] = int((algo @ np.array([pixels[i-1][j-1][k], pixels[i-1][j+1][k], pixels[i+1][j-1][k]]).T)[2]) else: continue
|
17 |
-
|
18 |
-
new_image = Image.fromarray(pixels)
|
19 |
-
|
20 |
-
st.image(new_image , caption='Output Image', use_column_width=True) if __name__ == '__main__': main()
|
|
|
6 |
st.title("Haltmann Diffusion Algorithm")
|
7 |
|
8 |
slider = st.slider("Slider", 0, 255, 128) # default value=128, min=0, max=255
|
9 |
+
st.title "Work in progress please wait while ai is training"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|