@@ -23,14 +23,15 @@ def show_info():
2323 pywebio .output .put_html ("<br>" )
2424
2525 show_net = [pywebio .output .put_text ('net' ),
26- pywebio .output .put_image (graph_img )]
26+ pywebio .output .put_image (graph_img )]
2727
2828 def popup_window (title , content ):
2929 pywebio .output .popup (title = title , content = content )
3030
3131 show_info ()
3232 pywebio .output .put_buttons (['查看网络结构' ], [lambda : popup_window ("网络结构" , show_net )])
3333 # pywebio.output.put_buttons(['点击查看网络结构'], [popup_window])
34+ pywebio .input .actions ("" , [{'label' : "上传图片" , 'value' : "" , 'color' : 'success' , }])
3435 inpic = pywebio .input .file_upload (label = "上传图片 please upload a image" )
3536 pywebio .output .popup ("加载中" , [
3637 pywebio .output .put_loading (),
@@ -60,8 +61,9 @@ def popup_window(title, content):
6061 # print(train_set.classes[output.argmax(1).item()])
6162 # pywebio.output.put_text(train_set.classes[output.argmax(1).item()])
6263 pywebio .output .popup (title = '识别结果' ,
63- content = [pywebio .output .put_markdown ("分类结果:\n # " + train_set_classes [output .argmax (1 ).item ()]),
64- pywebio .output .put_image (None if not inpic else inpic ['content' ])])
64+ content = [
65+ pywebio .output .put_markdown ("分类结果:\n # " + train_set_classes [output .argmax (1 ).item ()]),
66+ pywebio .output .put_image (None if not inpic else inpic ['content' ])])
6567
6668 # img = torch.reshape(img, (3, 32, 32))
6769 # transform2 = torchvision.transforms.Compose([
@@ -89,4 +91,3 @@ def popup_window(title, content):
8991 remote_access = False ,
9092 port = 6006
9193 )
92-
0 commit comments