Skip to content
Snippets Groups Projects
Commit ce852108 authored by hexiangdong2019's avatar hexiangdong2019
Browse files

修改net_eval函数

parent 9f29aa73
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,6 @@ def cal_hist(a, b, n):
return np.bincount(n * a[k].astype(np.int32) + b[k], minlength=n ** 2).reshape(n, n)
def resize_long(img, long_size=513):
print(img)
h, w, _ = img.shape
if h > w:
new_h = long_size
......@@ -93,9 +92,7 @@ def eval_batch(eval_net, img_lst, crop_size=513, flip=True):
batch_img = np.zeros((4, 3, crop_size, crop_size), dtype=np.float32)
resize_hw = []
for l in range(batch_size):
print(img_lst)
img_ = img_lst[l]
print(img_)
img_, resize_h, resize_w = pre_process(img_, crop_size)
batch_img[l] = img_
resize_hw.append([resize_h, resize_w])
......@@ -151,14 +148,13 @@ def net_eval():
msk_path = './datasets/SegmentationClass/' + line.replace('\n', '') + '.png'
img_ = cv2.imread(img_path)
msk_ = cv2.imread(msk_path, cv2.IMREAD_GRAYSCALE)
print(img_path)
print(img_)
batch_img_lst.append(img_)
batch_msk_lst.append(msk_)
bi += 1
if bi == 4:
batch_res = eval_batch_scales(eval_net, batch_img_lst, scales=[1.0],
base_crop_size=513, flip=True)
print(batch_msk_lst)
for mi in range(16):
hist += cal_hist(batch_msk_lst[mi].flatten(), batch_res[mi].flatten(), 6)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment