Skip to content

Commit 7807b46

Browse files
authored
Update generate_fake_samples.py
1 parent 679727e commit 7807b46

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

generate_fake_samples.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,23 @@
1111
parser.add_argument('--num_samples', dest='num_samples', required=False, type=int, default=5000, help='Number of images to generate.')
1212
parser.add_argument('--batch_size', dest='batch_size', required=False, type=int, default=50, help='Batch size.')
1313
parser.add_argument('--z_dim', dest='z_dim', required=True, type=int, default=200, help='Latent space size.')
14+
parser.add_argument('--dataset', dest='dataset', type=str, default='vgh_nki', help='Dataset to use.')
15+
parser.add_argument('--marker', dest='marker', type=str, default='he', help='Marker of dataset to use.')
16+
parser.add_argument('--img_size', dest='img_size', type=int, default=224, help='Image size for the model.')
1417
parser.add_argument('--main_path', dest='main_path', default=None, type=str, help='Path for the output run.')
1518
parser.add_argument('--dbs_path', dest='dbs_path', type=str, default=None, help='Directory with DBs to use.')
19+
parser.add_argument('--model', dest='model', type=str, default='PathologyGAN', help='Model name.')
1620
args = parser.parse_args()
1721
checkpoint = args.checkpoint
1822
num_samples = args.num_samples
1923
batch_size = args.batch_size
2024
z_dim = args.z_dim
25+
dataset = args.dataset
26+
marker = args.marker
27+
img_size = args.img_size
2128
main_path = args.main_path
2229
dbs_path = args.dbs_path
30+
model = args.model
2331

2432
if main_path is None:
2533
main_path = os.path.dirname(os.path.realpath(__file__))
@@ -28,12 +36,10 @@
2836

2937
# Dataset information.
3038
data_out_path = os.path.join(main_path, 'data_model_output')
31-
data_out_path = os.path.join(data_out_path, 'PathologyGAN')
32-
image_width = 224
33-
image_height = 224
39+
data_out_path = os.path.join(data_out_path, model)
40+
image_width = img_size
41+
image_height = img_size
3442
image_channels = 3
35-
dataset='vgh_nki'
36-
marker='he'
3743
offset = None
3844
name_run = 'h%s_w%s_n%s' % (image_height, image_width, image_channels)
3945
data_out_path = '%s/%s' % (data_out_path, name_run)
@@ -61,4 +67,4 @@
6167

6268
# Generate Inception features from fake images.
6369
with tf.Graph().as_default():
64-
hdf5s_features = inception_tf_feature_activations(hdf5s=[gen_hdf5_path], input_shape=data.training.shape[1:], batch_size=batch_size)
70+
hdf5s_features = inception_tf_feature_activations(hdf5s=[gen_hdf5_path], input_shape=data.training.shape[1:], batch_size=batch_size)

0 commit comments

Comments
 (0)