def doTest(file_name,model):
probs,img_arr=seg(opt.img_dir+file_name,model)
probs=probs>opt.prob_threshould
probs=morphology.dilation(probs,np.ones([3,3,3]))
probs=morphology.dilation(probs,np.ones([3,3,3]))
probs=morphology.erosion(probs,np.ones([3,3,3]))
labels = measure.label(probs,connectivity=2)
regions = measure.regionprops(labels)
centers = []
crops = []
bboxes = []
spans=[]
for prop in regions:
B = prop.bbox
if B[3]-B[0]>2 and B[4]-B[1]>4 and B[5]-B[2]>4:
z=int((B[3]+B[0])/2.0)
y=int((B[4]+B[1])/2.0)
x=int((B[5]+B[2])/2.0)
span=np.array([int(B[3]-B[0]),int(B[4]-B[1]),int(B[5]-B[2])])
spans.append(span)
centers.append(np.array([z,y,x]))
bboxes.append(B)