Skip to content

Commit eaf4f7a

Browse files
committed
Merge branch 'main' into muktadir
2 parents 6cb1c7f + 749d24f commit eaf4f7a

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed
6.06 KB
Binary file not shown.

src/maps.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def generate_patches(self, mapReader, image_groups=3, outDirectory=None):
9999
logging.info(f"Image group {img_group_number} saved in {path}")
100100
self.samples.clear()
101101
img_group_number+=1
102+
pass
102103

103104
def extractSample(self, mapReader, topLeft):
104105
i = topLeft[0]

src/read.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ def __init__(self, directory_path, location='SF'):
1313

1414
def load_group(self, group=0):
1515
if self.dir_path[-1]=='/':
16-
with open(self.dir_path+self.location+"_group"+str(group)+".dill", 'rb') as d:
16+
with open(self.dir_path+str(group)+".dill", 'rb') as d:
1717
self.data = dill.load(d)
1818
d.close()
1919
else:
2020
self.dir_path = self.dir_path + "/"
21-
with open(self.dir_path+self.location+"_group"+str(group)+".dill", 'rb') as d:
21+
with open(self.dir_path+str(group)+".dill", 'rb') as d:
2222
self.data = dill.load(d)
2323
d.close()
2424

@@ -30,10 +30,14 @@ def read_numpy(self):
3030
self.data = self.data.astype(np.uint8)
3131
return self.data
3232

33-
reader = ImgGroupReader("data/output/")
34-
reader.load_group()
35-
data = reader.read_numpy()
36-
im = Image.fromarray(data[0])
37-
im.show()
33+
sf_groups = 117
34+
for i in range(sf_groups):
35+
reader = ImgGroupReader("../data/output/city_patches/dill/washington")
36+
reader.load_group(group=i)
37+
data = reader.read_numpy()
38+
im = Image.fromarray(data[0])
39+
im.save('../data/output/city_patches/png/washington/'+str(i)+'.png')
40+
41+
3842

3943

0 commit comments

Comments
 (0)