Skip to content

Commit

Permalink
Merge pull request zsdonghao#12 from arisliang/master
Browse files Browse the repository at this point in the history
refactoring and folder fix.
  • Loading branch information
zsdonghao authored Mar 18, 2018
2 parents bdba1de + 8e239b7 commit 275880d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 10 additions & 9 deletions train_txt2im.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 275880d

Please sign in to comment.