Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
Fixed logging messing up with progressbar
Browse files Browse the repository at this point in the history
  • Loading branch information
code2k13 committed Sep 21, 2022
1 parent 2d58799 commit e15a605
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions removestars.py
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit e15a605

Please sign in to comment.