Skip to content

Commit

Permalink
Mask generator utility
Browse files Browse the repository at this point in the history
  • Loading branch information
Petar Veličković committed Jan 21, 2018
1 parent de7bd67 commit a2a3497
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions utils/genmask.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import numpy as np
import sys

mst = {}

indices = np.empty(365)

with open(sys.argv[2], 'r') as f:
for line in f:
els = line.split()
mst[els[0]] = els[1]

with open(sys.argv[1], 'r') as f:
for line in f:
els = line.split()
if els[0] in mst:
indices[int(mst[els[0]])] = els[1]
print(mst[els[0]], '->', els[1])

np.save('mask.npy', indices)

0 comments on commit a2a3497

Please sign in to comment.