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

Commit

Permalink
Newer model, better images
Browse files Browse the repository at this point in the history
  • Loading branch information
code2k13 committed Dec 31, 2022
1 parent 77f4e62 commit 4a56aed
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import tensorflow as tf

IMG_SIZE = 1024
IMG_SIZE = 512
OUTPUT_CHANNELS = 1

def downsample(filters, size, apply_batchnorm=True,strides = 2,name=''):
Expand Down
8 changes: 4 additions & 4 deletions removestars.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@


IMG_SIZE = 512
MODEL_SIZE = 1024
MODEL_SIZE = 512
all_outputs = 1
pad_width = 2
pad_width = 8
total_steps = 0
progress_bar = None
current_progress= 0
Expand All @@ -35,9 +35,9 @@ def process_tile(channel,i,j,pad_width,model,output_image):
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 = blank_image.resize((MODEL_SIZE,MODEL_SIZE))
blank_image = np.asarray(blank_image,dtype="float16").reshape(1,MODEL_SIZE,MODEL_SIZE)/512
blank_image = np.asarray(blank_image,dtype="float32").reshape(1,MODEL_SIZE,MODEL_SIZE)/512
predicted_section = model.predict(blank_image,verbose=0)
predicted_section = predicted_section.reshape(MODEL_SIZE,MODEL_SIZE)*1024
predicted_section = predicted_section.reshape(MODEL_SIZE,MODEL_SIZE)*512
predicted_section = Image.fromarray(predicted_section).convert('L')
predicted_section = predicted_section.resize((IMG_SIZE,IMG_SIZE))
predicted_section = predicted_section.crop((pad_width,pad_width,IMG_SIZE-pad_width,IMG_SIZE-pad_width))
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
tensorflow
numpy
pillow
tqdm
tqdm
tensorflowjs
2 changes: 1 addition & 1 deletion weights/weights.data-00000-of-00001
Git LFS file not shown
Binary file modified weights/weights.index
Binary file not shown.

0 comments on commit 4a56aed

Please sign in to comment.