vishalbakshi commited on
Commit
c6811ab
·
1 Parent(s): b5ebd06

add getters

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -4,6 +4,16 @@ from fastapi.responses import HTMLResponse
4
 
5
  app = FastAPI()
6
 
 
 
 
 
 
 
 
 
 
 
7
  # Load the model
8
  learn = load_learner('model.pkl')
9
 
@@ -24,15 +34,7 @@ if __name__ == "__main__":
24
  # import base64
25
  # import uvicorn
26
 
27
- # def get_x(i):
28
- # # Convert NumPy array to a single-channel PIL image with inverted colors
29
- # return PILImageBW.create(all_noise[i])
30
-
31
- # def get_y(i):
32
- # return all_thresh[i].astype(np.float32)
33
 
34
- # def get_items(_):
35
- # return range(len(all_noise))
36
 
37
  # # Load the model
38
  # learn = load_learner('model.pkl')
 
4
 
5
  app = FastAPI()
6
 
7
+ def get_x(i):
8
+ # Convert NumPy array to a single-channel PIL image with inverted colors
9
+ return PILImageBW.create(all_noise[i])
10
+
11
+ def get_y(i):
12
+ return all_thresh[i].astype(np.float32)
13
+
14
+ def get_items(_):
15
+ return range(len(all_noise))
16
+
17
  # Load the model
18
  learn = load_learner('model.pkl')
19
 
 
34
  # import base64
35
  # import uvicorn
36
 
 
 
 
 
 
 
37
 
 
 
38
 
39
  # # Load the model
40
  # learn = load_learner('model.pkl')