fradinho commited on
Commit
0d19afe
·
1 Parent(s): 0d61d3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -45,7 +45,7 @@ def predict_2(image):
45
 
46
  image = Image.fromarray(image).resize((size,size))
47
  image = np.array(image)
48
- stride = 2
49
  steps = int(pach_size/stride)
50
  patches_img = patchify(image, (pach_size, pach_size, 3), step=steps) #Step=256 for 256 patches means no overlap
51
  patches_img = patches_img[:,:,0,:,:,:]
@@ -77,7 +77,7 @@ def predict_2(image):
77
 
78
  unpatched_prediction = unpatchify(patched_prediction, (image.shape[0], image.shape[1]))
79
  labels = LABEL_NAMES
80
- res = list(map(str, np.bincount(unpatched_prediction.reshape(-1))/unpatched_prediction.reshape(-1).shape[0]))
81
  out = dict(list(zip(labels, res)))
82
  unpatched_prediction = targets_classes_colors[unpatched_prediction]
83
 
 
45
 
46
  image = Image.fromarray(image).resize((size,size))
47
  image = np.array(image)
48
+ stride = 1
49
  steps = int(pach_size/stride)
50
  patches_img = patchify(image, (pach_size, pach_size, 3), step=steps) #Step=256 for 256 patches means no overlap
51
  patches_img = patches_img[:,:,0,:,:,:]
 
77
 
78
  unpatched_prediction = unpatchify(patched_prediction, (image.shape[0], image.shape[1]))
79
  labels = LABEL_NAMES
80
+ res = np.bincount(unpatched_prediction.reshape(-1))/unpatched_prediction.reshape(-1).shape[0]
81
  out = dict(list(zip(labels, res)))
82
  unpatched_prediction = targets_classes_colors[unpatched_prediction]
83