diff --git a/data_loader.py b/data_loader.py index 966e1ffc..b1e1b720 100755 --- a/data_loader.py +++ b/data_loader.py @@ -20,8 +20,8 @@ captions_ids = [80000, any] """ cwd = os.getcwd() - img_dir = os.path.join(cwd, '102flowers/102flowers') - caption_dir = os.path.join(cwd, '102flowers/text_c10') + img_dir = os.path.join(cwd, '102flowers') + caption_dir = os.path.join(cwd, 'text_c10') VOC_FIR = cwd + '/vocab.txt' ## load captions diff --git a/train_txt2im.py b/train_txt2im.py index 9f9c28fe..2344f052 100755 --- a/train_txt2im.py +++ b/train_txt2im.py @@ -137,15 +137,16 @@ def main_train(): ## seed for generation, z and sentence ids sample_size = batch_size sample_seed = np.random.normal(loc=0.0, scale=1.0, size=(sample_size, z_dim)).astype(np.float32) - # sample_seed = np.random.uniform(low=-1, high=1, size=(sample_size, z_dim)).astype(np.float32) - sample_sentence = ["the flower shown has yellow anther red pistil and bright red petals."] * int(sample_size/ni) + \ - ["this flower has petals that are yellow, white and purple and has dark lines"] * int(sample_size/ni) + \ - ["the petals on this flower are white with a yellow center"] * int(sample_size/ni) + \ - ["this flower has a lot of small round pink petals."] * int(sample_size/ni) + \ - ["this flower is orange in color, and has petals that are ruffled and rounded."] * int(sample_size/ni) + \ - ["the flower has yellow petals and the center of it is brown."] * int(sample_size/ni) + \ - ["this flower has petals that are blue and white."] * int(sample_size/ni) +\ - ["these white flowers have petals that start off white in color and end in a white towards the tips."] * int(sample_size/ni) + # sample_seed = np.random.uniform(low=-1, high=1, size=(sample_size, z_dim)).astype(np.float32)] + n = int(sample_size / ni) + sample_sentence = ["the flower shown has yellow anther red pistil and bright red petals."] * n + \ + ["this flower has petals that are yellow, white and purple and has dark lines"] * n + \ + ["the petals on this flower are white with a yellow center"] * n + \ + ["this flower has a lot of small round pink petals."] * n + \ + ["this flower is orange in color, and has petals that are ruffled and rounded."] * n + \ + ["the flower has yellow petals and the center of it is brown."] * n + \ + ["this flower has petals that are blue and white."] * n +\ + ["these white flowers have petals that start off white in color and end in a white towards the tips."] * n # sample_sentence = captions_ids_test[0:sample_size] for i, sentence in enumerate(sample_sentence):