Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/generatedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def generate():
while i<nit:
found=False
while found==False:
x, y = (np.random.random(2)*(n-sz)).astype(np.int)
x, y = (np.random.random(2)*(n-sz)).astype(int)
if l[x:x+sz,y:y+sz].max()==0:
found=True
vl = np.random.random()*0.8+0.2
Expand Down
2 changes: 1 addition & 1 deletion msdnet/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(self, dlist, batchsize, seed=None):
self.d = dlist
self.nd = len(self.d)
self.rndm = np.random.RandomState(seed)
self.idx = np.arange(self.nd,dtype=np.int)
self.idx = np.arange(self.nd,dtype=int)
self.rndm.shuffle(self.idx)
self.bsize = batchsize
self.i = 0
Expand Down
2 changes: 1 addition & 1 deletion msdnet/loggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def getheaderimage(width):
header_dict[header_image.shape[1]] = header_image
if width == header_image.shape[1]:
return header_image
res_image = skt.rescale(header_image, width/1536, preserve_range=True, mode='constant', anti_aliasing=True, multichannel=False)
res_image = skt.rescale(header_image, width/1536, preserve_range=True, mode='constant', anti_aliasing=True)
header_dict[width] = res_image
return res_image

Expand Down
6 changes: 3 additions & 3 deletions msdnet/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class LossValidation(Validation):
def __init__(self, data, loss=None, keep=True):
self.d = data
self.keep = keep
self.best = np.Inf
self.best = np.inf
self.loss = loss

def errorfunc(self, output, target, msk):
Expand Down Expand Up @@ -151,8 +151,8 @@ def validate(self, n):
errs = np.zeros(len(self.d))
if self.keep:
self.outputs = [0,0,0]
low = np.Inf
high = -np.Inf
low = np.inf
high = -np.inf
self.idx = [0,0,0]
for i,d in enumerate(self.d):
out = self.n.forward(d.input)
Expand Down
7 changes: 7 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
scikit-build
numpy
h5py
tqdm
imageio
scikit-image
numba