infocusp / tf_cnnvis

CNN visualization tool in TensorFlow
MIT License
780 stars 208 forks source link

please add an option to the save image name #42

Closed jason-su closed 6 years ago

jason-su commented 6 years ago

I read the codes in utils.py and I found that all the output images from the same layer have the same file name (grid_activation.png). If I test more one image, the previous image would be replaced with later image. Could you please add an option to change the image name. Thank you very much!

for i in range(len(grid_activations)):
    time_stamp = time.time()
    time_stamp = datetime.datetime.fromtimestamp(time_stamp).strftime('%Y-%m-%d_%H-%M-%S')

    grid_activation_path = os.path.join(path_out, "activations")
    is_success = make_dir(grid_activation_path)
    imsave(os.path.join(grid_activation_path, "grid_activation.png"), grid_activations[i][0,:,:,0], format = "png")