Spaces:
Sleeping
Sleeping
Dennis Trujillo commited on
Commit ·
5802303
1
Parent(s): 8f490e0
good fix, len(dataset.patches) == len(dataset)
Browse files
ds1.py
CHANGED
|
@@ -52,7 +52,6 @@ class PatchDataset(Dataset):
|
|
| 52 |
thisFrame2[thisFrame2>0] = 1
|
| 53 |
labels = label(thisFrame2)
|
| 54 |
regions = regionprops(labels)
|
| 55 |
-
self.patches = []
|
| 56 |
for prop_nr,props in enumerate(regions):
|
| 57 |
if props.area < 4 or props.area > 150:
|
| 58 |
continue
|
|
@@ -67,12 +66,13 @@ class PatchDataset(Dataset):
|
|
| 67 |
self.patches.append(normalize_patch(sub_img))
|
| 68 |
self.xy_positions.append([start_y,start_x])
|
| 69 |
self.f_nums.append(fNr)
|
| 70 |
-
|
|
|
|
| 71 |
f.close()
|
| 72 |
|
| 73 |
def __len__(self):
|
| 74 |
return self.length
|
| 75 |
|
| 76 |
def __getitem__(self, index):
|
| 77 |
-
return self.patches[index], self.xy_positions[index], self.f_nums[index]
|
| 78 |
|
|
|
|
| 52 |
thisFrame2[thisFrame2>0] = 1
|
| 53 |
labels = label(thisFrame2)
|
| 54 |
regions = regionprops(labels)
|
|
|
|
| 55 |
for prop_nr,props in enumerate(regions):
|
| 56 |
if props.area < 4 or props.area > 150:
|
| 57 |
continue
|
|
|
|
| 66 |
self.patches.append(normalize_patch(sub_img))
|
| 67 |
self.xy_positions.append([start_y,start_x])
|
| 68 |
self.f_nums.append(fNr)
|
| 69 |
+
#print(len(self.patches))
|
| 70 |
+
self.length = len(self.patches)
|
| 71 |
f.close()
|
| 72 |
|
| 73 |
def __len__(self):
|
| 74 |
return self.length
|
| 75 |
|
| 76 |
def __getitem__(self, index):
|
| 77 |
+
return self.patches[index]#, self.xy_positions[index], self.f_nums[index]
|
| 78 |
|