Skip to content
Snippets Groups Projects
Commit dfb76470 authored by 何向东's avatar 何向东
Browse files

训练过程中裁切图像

parent 09dfbd63
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ class GetDatasetGenerator:
r2 = random.randint(0, 7200 - size2)
image = np.float32(cv2.imread(self.path+"/JPEGImages/"+self.__data[index]+".bmp"))
image = image.swapaxes(1, 2).swapaxes(0, 1)
image = image[3, r1:r1+size1, r2:r2+size2]
image = image[:, r1:r1+size1, r2:r2+size2]
mask = Image.open(self.path+"/SegmentationClass/"+self.__data[index]+".png")
mask = np.int32(np.asarray(mask))
mask = mask[r1:r1+size1, r2:r2+size2]
......
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