Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sda.logLayer.b.set_value(logLayer_W_and_b[1])
print '...loading completed'
denoise_overlapped_strides(te_noisy_image);
print 'Completed:', te_noisy_image
exit()
msg = "You are currently running the image enhancement program, LLNet, developed by Akintayo, Lore, and Sarkar. What would you like to do?"
choices = ["Train Model","Enhance Single/Multiple Images","Exit Program"]
reply = buttonbox(msg, title="Welcome to LLNet!", choices=choices)
if reply == "Exit Program":
exit()
if reply == "Train Model":
if ccbox('You are currently training a new model. The model file might be overwritten. Continue?','Information')==True:
tr_dataset = fileopenbox(title='Select training data.',default='*',filetypes=["*.mat"])
test_SdA()
else:
msgbox("Program terminated. Goodbye!")
exit()
if reply == "Enhance Single/Multiple Images":
# Present model to load
model_to_load = fileopenbox(title='Select your model to load.',default='*',filetypes=["*.wgt","*.obj"])
#f = file(model_to_load, 'rb')
#sda = cPickle.load(f)
#f.close()
print '...initializing SDA'
sda = SdA(
numpy_rng= numpy.random.RandomState(89677),
msg = "请问你希望打开哪个功能选项呢?"
title = "EasyGuo小程序"
choices = ["Python入门", "Python进阶", "Python实战", "Python-AI"]
# 获得选择的结果
choice = eg.choicebox(msg, title, choices)
# 弹出对话框,显示选择的结果
eg.msgbox("你的选择是: "+ str(choice), "结果")
msg = "你希望重新开始小程序么?"
title = "请选择"
# 显示一个继续、取消对话框
if eg.ccbox(msg, title):
pass # 用户选择继续
else:
sys.exit(0) # 用户选择取消
def notify(self, title, text, url=False):
"""Open popup notification window with easygui"""
import easygui
if easygui.ccbox(text, title, ["Open web page", "Ignore"]):
webbrowser.open_new_tab(url)
elif action == "log":
if battles == 0:
easygui.msgbox("no battles yet !")
continue # jump to the top of the current (while) loop
easygi.textbox(vtext, "combat log", log)
elif action == "edit":
pass
elif action == "save":
output = open("combat_statistic","a") # a: append
output.write("\n- - - - -\ntext")
output.close()
elif action == "+1 battle":
pass
if easygui.ccbox(text,"combat result", image=victorimage):
easygui.textbox(vtext, "combat log", log)
def ask_for_draw():
if display_mode and use_dialog:
return easygui.ccbox(title='Request', msg='AlphaRenju requests a draw.', choices=['draw', 'continue'])
else:
print('> AlphaRenju requests a draw.')
return 0
def prompt_for_keygen(self):
message = ("We're going to generate a set of secure keys to protect "
"your connection to your device. These keys will be generated by the "
"Hologram API. The Hologram servers will only store the public key and "
"the private key will be saved to your computer.\n"
"If you have a key already that you want to use or want to generate "
"one on your own hit cancel and run with the --upload-publickey and --privatekey arguments.")
res = easygui.ccbox(msg=message, title=self.title)
return res