Spaces:
Sleeping
Sleeping
Commit
·
d0a07ac
1
Parent(s):
d67a120
add getters
Browse files
app.py
CHANGED
@@ -5,6 +5,16 @@ from PIL import Image
|
|
5 |
import io
|
6 |
import base64
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
# Load the model
|
9 |
learn = load_learner('model.pkl')
|
10 |
|
|
|
5 |
import io
|
6 |
import base64
|
7 |
|
8 |
+
def get_x(i):
|
9 |
+
# Convert NumPy array to a single-channel PIL image with inverted colors
|
10 |
+
return PILImageBW.create(all_noise[i])
|
11 |
+
|
12 |
+
def get_y(i):
|
13 |
+
return all_thresh[i].astype(np.float32)
|
14 |
+
|
15 |
+
def get_items(_):
|
16 |
+
return range(len(all_noise))
|
17 |
+
|
18 |
# Load the model
|
19 |
learn = load_learner('model.pkl')
|
20 |
|