-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconcat_images.py
More file actions
34 lines (28 loc) · 827 Bytes
/
Copy pathconcat_images.py
File metadata and controls
34 lines (28 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3
"""Concatenate image files into single array/file."""
import argparse
import logging
import numpy as np
def main():
"""Create images and features for use in CNNs."""
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--inputfiles",
nargs="+",
help="""List of input files to use.""",
required=True,
)
parser.add_argument(
"--outputfile",
help="""Output file to write to.""",
required=True,
)
args = parser.parse_args()
all_arrays = []
for inputfile in args.inputfiles:
all_arrays.append(np.load(inputfile))
all_arrays = np.concatenate(all_arrays)
np.save(args.outputfile, all_arrays)
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
main()