Skip to content

Commit 6be6553

Browse files
show total frames in the end
1 parent ccb1fb2 commit 6be6553

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/preprocess-remote.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ def main(args):
178178
'screenId': [],
179179
}
180180
testFrames = trainFrames = 0
181+
framesPerChunk = {}
181182
# subfolders: PlaceId -> UserId -> ScreenId -> start_time.npz
182183
folder = args.folder
183184
foldersList = lambda x: [nm for nm in os.listdir(x) if os.path.isdir(os.path.join(x, nm))]
@@ -202,12 +203,19 @@ def main(args):
202203
)
203204
testFrames += testFramesN
204205
trainFrames += trainFramesN
206+
# store the number of frames per chunk
207+
sid = '%s/%s/%s' % (placeId, userId, screenId)
208+
framesPerChunk[sid] = testFramesN + trainFramesN
205209
continue
206210
print('Total: %d training frames, %d testing frames' % (trainFrames, testFrames))
207211

208212
# save the stats
209213
with open(os.path.join(folder, 'stats.json'), 'w') as f:
210214
json.dump(stats, f, indent=2)
215+
216+
print('-' * 80)
217+
for k, v in framesPerChunk.items():
218+
print('%s: %d frames' % (k, v))
211219
return
212220

213221
if __name__ == '__main__':

0 commit comments

Comments
 (0)