From e15a605c679bc8a44b3192f4607def23ee11f6b8 Mon Sep 17 00:00:00 2001 From: code2k13 Date: Wed, 21 Sep 2022 09:13:30 +0000 Subject: [PATCH] Fixed logging messing up with progressbar --- README.md | 1 + removestars.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 55489b2..5f24300 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Star reduction in deep sky images ![images/star_removal.gif](images/star_removal.gif) + A GAN model trained to remove stars from astronomical images. Code was inspired from a [sample at Tensorflow's website](https://www.tensorflow.org/tutorials/generative/pix2pix). The training data consists of only two images. One image of the Antenna Galaxy and another is a starmap that was created from a star cluster image. Here is how the results look like: ![images/example2.png](images/example2.jpg) diff --git a/removestars.py b/removestars.py index 142c69c..c9c0373 100755 --- a/removestars.py +++ b/removestars.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 import os -os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' +os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) @@ -40,7 +40,7 @@ def process_channel(channel,pad_width,input_image_size): current_tile = current_tile.resize((IMG_SIZE-pad_width*2,IMG_SIZE-pad_width*2)) blank_image.paste(current_tile,(pad_width,pad_width)) blank_image = np.asarray(blank_image,dtype="float16").reshape(1,IMG_SIZE,IMG_SIZE)/255 - predicted_section = G2.predict(blank_image) + predicted_section = G2.predict(blank_image,verbose=0) predicted_section = predicted_section.reshape(IMG_SIZE,IMG_SIZE)*255 predicted_section = Image.fromarray(predicted_section).convert('L') predicted_section = predicted_section.crop((pad_width,pad_width,IMG_SIZE-pad_width,IMG_SIZE-pad_width))