-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
69 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import argparse | ||
from pathlib import Path | ||
|
||
from PIL import Image | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('path_to_images', type=str) | ||
parser.add_argument('--output_name', type=str, default='plots.png') | ||
|
||
args = parser.parse_args() | ||
|
||
variables = [ | ||
'crossing_angle', | ||
'dip_angle', | ||
'drift_length', | ||
'pad_coord_fraction', | ||
'time_bin_fraction', | ||
] | ||
|
||
stats = [ | ||
'Mean0', | ||
'Mean1', | ||
'Sigma0^2', | ||
'Sigma1^2', | ||
'Cov01', | ||
'Sum', | ||
] | ||
|
||
img_path = Path(args.path_to_images) | ||
images = [[Image.open(img_path / f'{s} vs {v}_amp_gt_1.png') for v in variables] for s in stats] | ||
|
||
width, height = images[0][0].size | ||
|
||
new_image = Image.new('RGB', (width * len(stats), height * len(variables))) | ||
|
||
x_offset = 0 | ||
for img_line in images: | ||
y_offset = 0 | ||
for img in img_line: | ||
new_image.paste(img, (x_offset, y_offset)) | ||
y_offset += img.size[1] | ||
x_offset += img.size[0] | ||
|
||
new_image.save(img_path / args.output_name) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
docker run -it \ | ||
--rm \ | ||
--env HOME=`pwd` \ | ||
-v `pwd`:`pwd` \ | ||
centos:centos7.8.2003 \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
docker run -u $(id -u):$(id -g) --runtime nvidia -v `pwd`:`pwd` silikhon/tensorflow2:v1 /bin/bash -c 'cd '`pwd`'; python test_script.py' | ||
docker run -it \ | ||
--rm \ | ||
-u $(id -u):$(id -g) \ | ||
--env HOME=`pwd` \ | ||
--runtime nvidia \ | ||
-v `pwd`:`pwd` \ | ||
silikhon/tensorflow2:v1 \ | ||
/bin/bash |
BUG: this thing is always
True
now...Consider removing - this was only needed for convolutional generator exported with XLA, which we don't use anymore...