jpterry commited on
Commit
4bec5d9
·
1 Parent(s): 086820c

trying to open with np

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -131,8 +131,14 @@ def predict_and_analyze(model_name, num_channels, dim, image):
131
  num_channels = int(num_channels)
132
  W = int(dim)
133
 
134
- image = image.read()
135
- image = np.frombuffer(image)
 
 
 
 
 
 
136
  image = image.reshape((num_channels, W, W))
137
 
138
  # W = int(np.sqrt(image.shape[1]))
 
131
  num_channels = int(num_channels)
132
  W = int(dim)
133
 
134
+ # image = image.read()
135
+
136
+ # with open(image, 'rb') as f:
137
+ # im = f.readlines()
138
+ # image = np.frombuffer(image)
139
+
140
+ image = np.open(image, allow_pickle=True)
141
+
142
  image = image.reshape((num_channels, W, W))
143
 
144
  # W = int(np.sqrt(image.shape[1]))