Skip to content

Commit

Permalink
reduced tensorflow log outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
clarenceyapp committed Mar 29, 2021
1 parent dc9f392 commit 00b5044
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
10 changes: 7 additions & 3 deletions UnMicst.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import numpy as np
from scipy import misc
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import logging
logging.getLogger('tensorflow').setLevel(logging.FATAL)
import tensorflow.compat.v1 as tf
import shutil
import scipy.io as sio
import os, fnmatch, glob
import fnmatch, glob
import skimage.exposure as sk
import skimage.io
import argparse
Expand Down Expand Up @@ -590,7 +594,7 @@ def singleImageInference(image, mode, pmIndex):
parentFolder = os.path.dirname(os.path.dirname(imagePath))
fileName = os.path.basename(imagePath)
fileNamePrefix = fileName.split(os.extsep, 1)
print(fileName)
# print(fileName)
fileType = fileNamePrefix[1]

if fileType=='ome.tif' or fileType == 'btf' :
Expand All @@ -609,7 +613,7 @@ def singleImageInference(image, mode, pmIndex):
args.classOrder = range(nClass)

rawI = I
print(type(I))
# print(type(I))
hsize = int((float(I.shape[0]) * float(dsFactor)))
vsize = int((float(I.shape[1]) * float(dsFactor)))
I = resize(I, (hsize, vsize))
Expand Down
9 changes: 7 additions & 2 deletions UnMicst1-5.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import numpy as np
from scipy import misc
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import logging
logging.getLogger('tensorflow').setLevel(logging.FATAL)

import tensorflow.compat.v1 as tf
from tensorflow import keras
from tensorflow.keras import layers
import shutil
import scipy.io as sio
import os, fnmatch, glob
import fnmatch, glob
import skimage.exposure as sk
import skimage.io
import argparse
Expand Down Expand Up @@ -764,7 +769,7 @@ def singleImageInference(image, mode, pmIndex):
parentFolder = os.path.dirname(os.path.dirname(imagePath))
fileName = os.path.basename(imagePath)
fileNamePrefix = fileName.split(os.extsep, 1)
print(fileName)
# print(fileName)
fileType = fileNamePrefix[1]

if fileType == 'ome.tif' or fileType == 'btf':
Expand Down
9 changes: 7 additions & 2 deletions UnMicst2.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import numpy as np
from scipy import misc
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import logging
logging.getLogger('tensorflow').setLevel(logging.FATAL)

import tensorflow.compat.v1 as tf
from tensorflow import keras
from tensorflow.keras import layers
import shutil
import scipy.io as sio
import os, fnmatch, glob
import fnmatch, glob
import skimage.exposure as sk
import skimage.io
import argparse
Expand Down Expand Up @@ -742,7 +747,7 @@ def singleImageInference(image, mode, pmIndex):
parentFolder = os.path.dirname(os.path.dirname(imagePath))
fileName = os.path.basename(imagePath)
fileNamePrefix = fileName.split(os.extsep, 1)
print(fileName)
# print(fileName)
fileType = fileNamePrefix[1]

for iChan in range(len(channel)):
Expand Down
8 changes: 6 additions & 2 deletions unmicstWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

scriptPath =os.path.dirname(os.path.realpath(__file__))


cmd="python " + scriptPath + os.sep

channel = args.channel
Expand All @@ -36,16 +37,19 @@
elif args.tool == 'UnMicst':
cmd = cmd + "UnMicst.py "
channel = str(channel[0])
print("WARNING! YOU HAVE OPTED TO USE UNMICST V1, WHICH IS GETTING TIRED AND OLD. CONSIDERING USING V1.5 OR V2(IF YOU ALSO HAVE A NUCLEAR ENVELOPE STAIN")
print('')
print("WARNING! YOU HAVE OPTED TO USE UNMICST V1, WHICH IS GETTING TIRED AND OLD. CONSIDER USING V1.5 OR V2(IF YOU ALSO HAVE A NUCLEAR ENVELOPE STAIN")
print('')
elif args.tool == 'UnMicstCyto2':
cmd = cmd + "UnMicstCyto2.py "
channel = str(channel[0])
else:
cmd = cmd + "UnMicst1-5.py "
channel = str(channel[0])
print('')
print(
"WARNING! USING V1.5 AS DEFAULT. THIS MODEL HAS BEEN TRAINED ON MORE TISSUE TYPES. IF YOU WANT V1, USE --tool UnMicst")

print('')

cmd = cmd + " " + args.imagePath
cmd = cmd + " --channel " + str(channel)
Expand Down

0 comments on commit 00b5044

Please sign in to comment.