Skip to content
Snippets Groups Projects
Commit 1814b429 authored by Guillaume HEUSCH's avatar Guillaume HEUSCH
Browse files

[script] added the start epoch option when showing images saved during the training

parent 714007eb
No related branches found
No related tags found
No related merge requests found
...@@ -4,12 +4,13 @@ ...@@ -4,12 +4,13 @@
""" Read data saved during the training of a DR-GAN """ Read data saved during the training of a DR-GAN
Usage: Usage:
%(prog)s [--datadir=<path>] [--verbose ...] %(prog)s [--datadir=<path>] [--start-epoch=<int>] [--verbose ...]
Options: Options:
-h, --help Show this screen. -h, --help Show this screen.
-V, --version Show version. -V, --version Show version.
-d, --datadir=<path> The dir where the training data reside -d, --datadir=<path> The dir where the training data reside
-e, --start-epoch=<path> The epoch where you want to start the display [default:0]
-v, --verbose Increase the verbosity (may appear multiple times). -v, --verbose Increase the verbosity (may appear multiple times).
...@@ -54,13 +55,19 @@ def main(user_input=None): ...@@ -54,13 +55,19 @@ def main(user_input=None):
# get the arguments # get the arguments
data_dir = args['--datadir'] data_dir = args['--datadir']
start_epoch = int(args['--start-epoch'])
logger.info("Start displaying picture at epoch {}".format(start_epoch))
# get the data # get the data
for f in os.listdir(data_dir): for f in os.listdir(data_dir):
if f.endswith(".hdf5"): if f.endswith(".hdf5"):
filename = os.path.join(data_dir, f) filename = os.path.join(data_dir, f)
print filename temp = filename.split('_')
epoch = int(temp[-2])
if epoch < start_epoch:
continue
# read the data # read the data
f = bob.io.base.HDF5File(filename) #read only f = bob.io.base.HDF5File(filename) #read only
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment