diff --git a/exp/kerokero/prepare_data.py b/exp/kerokero/prepare_data.py --- a/exp/kerokero/prepare_data.py +++ b/exp/kerokero/prepare_data.py @@ -37,7 +37,7 @@ class Sample: m=np.matmul(mi,m) m=np.matmul(self._computeCrop(m),m) img=cv.warpPerspective(self.img,m,(self.SIDE,self.SIDE)) - img=np.float32(img)/128-1 + img=np.uint8(img) grid=Corners(c.transform(m) for c in self.grid) grid=list(map(lambda p: list(2*p/self.SIDE-EPoint(1,1)), grid)) return (img,grid) @@ -108,8 +108,8 @@ def loadDataset(root): labels=[labels[k] for k in keys] m=int(n*trainRatio) return ( - (np.float32(images[:m]),np.float32(labels[:m])), - (np.float32(images[m:]),np.float32(labels[m:])) + (np.uint8(images[:m]),np.float32(labels[:m])), + (np.uint8(images[m:]),np.float32(labels[m:])) )