dddd

# -*- coding: utf-8 -*-

import wx
import modelmngr_execute

##########################################################################################
class MyFrame1 ( wx.Frame ):

    def __init__( self, parent ):
        wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"模型管家", pos = wx.DefaultPosition, size = wx.Size( 779,521 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )

        self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )

	####################################################
        bSizer6 = wx.BoxSizer( wx.VERTICAL )

	####################################################
        bSizer7 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"模型文件1路径 *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText6.Wrap( -1 )
        bSizer7.Add( self.m_staticText6, 0, wx.ALL, 5 )

        self.m_textCtrl6 = wx.TextCtrl( self, wx.ID_ANY, u"/system/etc/models/fsrcn.cambricon", wx.DefaultPosition, wx.Size( 650,-1 ), 0 )
        bSizer7.Add( self.m_textCtrl6, 0, wx.ALL, 5 )

        bSizer6.Add( bSizer7, 1, wx.EXPAND, 5 )

        ########################
        bSizer90 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_checkBox2 = wx.CheckBox( self, wx.ID_ANY, u"是否加密 *", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer90.Add( self.m_checkBox2, 0, wx.ALL, 5 )

        self.Bind(wx.EVT_CHECKBOX, self.on_model1_check, self.m_checkBox2)

        self.m_staticText19 = wx.StaticText( self, wx.ID_ANY, u"模型文件1密钥", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText19.Wrap( -1 )
        bSizer90.Add( self.m_staticText19, 0, wx.ALL, 5 )

        self.m_textCtrl19 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 300,-1 ), 0 )
        bSizer90.Add( self.m_textCtrl19, 0, wx.ALL, 5 )

        bSizer6.Add( bSizer90, 1, wx.EXPAND, 5 )

        ####################################################
        bSizer24 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_staticText20 = wx.StaticText( self, wx.ID_ANY, u"模型文件2路径", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText20.Wrap( -1 )
        bSizer24.Add( self.m_staticText20, 0, wx.ALL, 5 )

        self.m_textCtrl20 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 650,-1 ), 0 )
        bSizer24.Add( self.m_textCtrl20, 0, wx.ALL, 5 )

        bSizer6.Add( bSizer24, 1, wx.EXPAND, 5 )

        ########################
        bSizer12 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_checkBox3 = wx.CheckBox( self, wx.ID_ANY, u"是否加密", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer12.Add( self.m_checkBox3, 0, wx.ALL, 5 )

        self.Bind(wx.EVT_CHECKBOX, self.on_model2_check, self.m_checkBox3)

        self.m_staticText21 = wx.StaticText( self, wx.ID_ANY, u"模型文件2密钥", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText21.Wrap( -1 )
        bSizer12.Add( self.m_staticText21, 0, wx.ALL, 5 )

        self.m_textCtrl21 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 300,-1 ), 0 )
        bSizer12.Add( self.m_textCtrl21, 0, wx.ALL, 5 )

        bSizer6.Add( bSizer12, 1, wx.EXPAND, 5 )

	####################################################
        bSizer31 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_staticText22 = wx.StaticText( self, wx.ID_ANY, u"模型类型 *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText22.Wrap( -1 )
        bSizer31.Add( self.m_staticText22, 0, wx.ALL, 5 )

        m_choice1Choices = [ u"在线模型(0)", u"离线模型(1)" ]
        self.m_choice1 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choice1Choices, 0 )
        self.m_choice1.SetSelection( 0 )
        bSizer31.Add( self.m_choice1, 0, wx.ALL, 5 )

        bSizer6.Add( bSizer31, 1, wx.EXPAND, 5 )

	####################################################
        bSizer32 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_staticText29 = wx.StaticText( self, wx.ID_ANY, u"框架类型 *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText29.Wrap( -1 )
        bSizer32.Add( self.m_staticText29, 0, wx.ALL, 5 )

        m_choice3Choices = [ u"无(0)", u"TensorFlow(1)", u"KalDi(2)", u"Caffe(3)"]
        self.m_choice3 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choice3Choices, 0 )
        self.m_choice3.SetSelection( 0 )
        bSizer32.Add( self.m_choice3, 0, wx.ALL, 5 )

        bSizer6.Add( bSizer32, 1, wx.EXPAND, 5 )

	####################################################
        bSizer33 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_staticText30 = wx.StaticText( self, wx.ID_ANY, u"源数据(图片)路径 *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText30.Wrap( -1 )
        bSizer33.Add( self.m_staticText30, 0, wx.ALL, 5 )

        self.m_textCtrl27 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 500,-1 ), 0 )
        bSizer33.Add( self.m_textCtrl27, 0, wx.ALL, 5 )

        bSizer6.Add( bSizer33, 1, wx.EXPAND, 5 )

	####################################################
        bSizer45 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_staticText31 = wx.StaticText( self, wx.ID_ANY, u"输入尺寸N *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText31.Wrap( -1 )
        bSizer45.Add( self.m_staticText31, 0, wx.ALL, 5 )

        self.m_textCtrl28 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 50,-1 ), 0 )
        bSizer45.Add( self.m_textCtrl28, 0, wx.ALL, 5 )

        self.m_staticText32 = wx.StaticText( self, wx.ID_ANY, u"输入尺寸C *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText32.Wrap( -1 )
        bSizer45.Add( self.m_staticText32, 0, wx.ALL, 5 )

        self.m_textCtrl29 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 50,-1 ), 0 )
        bSizer45.Add( self.m_textCtrl29, 0, wx.ALL, 5 )

        self.m_staticText33 = wx.StaticText( self, wx.ID_ANY, u"输入尺寸H *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText33.Wrap( -1 )
        bSizer45.Add( self.m_staticText33, 0, wx.ALL, 5 )

        self.m_textCtrl30 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 50,-1 ), 0 )
        bSizer45.Add( self.m_textCtrl30, 0, wx.ALL, 5 )

        self.m_staticText34 = wx.StaticText( self, wx.ID_ANY, u"输入尺寸W *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText34.Wrap( -1 )
        bSizer45.Add( self.m_staticText34, 0, wx.ALL, 5 )

        self.m_textCtrl31 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 50,-1 ), 0 )
        bSizer45.Add( self.m_textCtrl31, 0, wx.ALL, 5 )

        bSizer6.Add( bSizer45, 1, wx.EXPAND, 5 )

        ####################################################
        bSizer47 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_staticText35 = wx.StaticText( self, wx.ID_ANY, u"输出尺寸N *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText35.Wrap( -1 )
        bSizer47.Add( self.m_staticText35, 0, wx.ALL, 5 )

        self.m_textCtrl32 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 50,-1 ), 0 )
        bSizer47.Add( self.m_textCtrl32, 0, wx.ALL, 5 )

        self.m_staticText36 = wx.StaticText( self, wx.ID_ANY, u"输出尺寸C *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText36.Wrap( -1 )
        bSizer47.Add( self.m_staticText36, 0, wx.ALL, 5 )

        self.m_textCtrl33 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 50,-1 ), 0 )
        bSizer47.Add( self.m_textCtrl33, 0, wx.ALL, 5 )

        self.m_staticText37 = wx.StaticText( self, wx.ID_ANY, u"输出尺寸H *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText37.Wrap( -1 )
        bSizer47.Add( self.m_staticText37, 0, wx.ALL, 5 )

        self.m_textCtrl34 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 50,-1 ), 0 )
        bSizer47.Add( self.m_textCtrl34, 0, wx.ALL, 5 )

        self.m_staticText38 = wx.StaticText( self, wx.ID_ANY, u"输出尺寸W *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText38.Wrap( -1 )
        bSizer47.Add( self.m_staticText38, 0, wx.ALL, 5 )

        self.m_textCtrl35 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 50,-1 ), 0 )
        bSizer47.Add( self.m_textCtrl35, 0, wx.ALL, 5 )

        bSizer6.Add( bSizer47, 1, wx.EXPAND, 5 )

	####################################################
        bSizer48 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_staticText39 = wx.StaticText( self, wx.ID_ANY, u"超时时限 *", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText39.Wrap( -1 )
        bSizer48.Add( self.m_staticText39, 0, wx.ALL, 5 )

        self.m_textCtrl36 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer48.Add( self.m_textCtrl36, 0, wx.ALL, 5 )

        bSizer6.Add( bSizer48, 1, wx.EXPAND, 5 )

	####################################################
        bSizer49 = wx.BoxSizer( wx.VERTICAL )

        self.m_button2 = wx.Button( self, wx.ID_ANY, u"模型执行-异步-非级联", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer49.Add( self.m_button2, 0, wx.ALL, 5 )

        bSizer6.Add( bSizer49, 1, wx.EXPAND, 5 )

        self.Bind(wx.EVT_BUTTON, self.on_async_single, self.m_button2)

	####################################################
        self.SetSizer( bSizer6 )
        self.Layout()

        self.Centre( wx.BOTH )

        ###############################################################################################################################################################################
        if self.m_checkBox2.GetValue() == True:
            self.m_textCtrl19.Enable()
        else:
            self.m_textCtrl19.Disable()

        if self.m_checkBox3.GetValue() == True:
            self.m_textCtrl21.Enable()
        else:
            self.m_textCtrl21.Disable()            

    def on_async_single(self, event):
        model1Path = modelmngr_execute._getTextCtrl(self.m_textCtrl6.GetValue()) #1
        model1Encr = modelmngr_execute._getCheckBox(self.m_checkBox2.GetValue()) #2
        model1Key = modelmngr_execute._getTextCtrl(self.m_textCtrl19.GetValue()) #3
        print model1Path, model1Encr, model1Key
        model2Path = modelmngr_execute._getTextCtrl(self.m_textCtrl20.GetValue()) #4
        model2Encr = modelmngr_execute._getCheckBox(self.m_checkBox3.GetValue()) #5
        model2Key = modelmngr_execute._getTextCtrl(self.m_textCtrl21.GetValue()) #6
        print model2Path, model2Encr, model2Key
        modelType = str(self.m_choice1.GetSelection()) #7
        frameworkType = str(self.m_choice3.GetSelection()) #8
        jpgPath = modelmngr_execute._getTextCtrl(self.m_textCtrl27.GetValue()) #9
        print modelType,frameworkType,jpgPath
        srcN = str(self.m_textCtrl28.GetValue()) #10
        srcC = str(self.m_textCtrl29.GetValue()) #11
        srcH = str(self.m_textCtrl30.GetValue()) #12
        srcW = str(self.m_textCtrl31.GetValue()) #13
        print srcN,srcC,srcH,srcW

        dstN = str(self.m_textCtrl32.GetValue()) #14
        dstC = str(self.m_textCtrl33.GetValue()) #15
        dstH = str(self.m_textCtrl34.GetValue()) #16
        dstW = str(self.m_textCtrl35.GetValue()) #17
        print dstN,dstC,dstH,dstW
        timeout = str(self.m_textCtrl36.GetValue()) #18
        print timeout

        modelmngr_execute.singleRun_async(model1Path, model1Encr, model1Key, model2Path, model2Encr, model2Key, modelType, frameworkType, jpgPath, srcN, srcC, srcH, srcW, dstN, dstC, dstH, dstW, timeout)

        event.Skip()

    def on_model1_check(self, event):
        cb = event.GetEventObject()
        if cb.GetValue() == True:
            self.m_textCtrl19.Enable()
            self.m_textCtrl19.SetValue("")
        else:
            self.m_textCtrl19.Disable()
            self.m_textCtrl19.SetValue("")
        event.Skip()

    def on_model2_check(self, event):
        cb = event.GetEventObject()
        if cb.GetValue() == True:
            self.m_textCtrl21.Enable()
            self.m_textCtrl21.SetValue("")
        else:
            self.m_textCtrl21.Disable()
            self.m_textCtrl21.SetValue("")
        event.Skip()        

    def __del__( self ):
        pass
时间: 2024-10-05 08:48:06

dddd的相关文章

dddd<script>ab " /> onclick="alert(123);" % # _

#3# ### <script>aler t(1234);</script> <basbd   llll ### wer adfasdf tttttttttttt dddd<script>ab " /> onclick="alert(123);" % # _,布布扣,bubuko.com

shell 中seq的用法 echo -n用法

用法:seq [选项]... 尾数 或:seq [选项]... 首数 尾数 或:seq [选项]... 首数 增量 尾数 从1循环到100的两种方法(bash 其它的shell没试过)for x in `seq 1 100`;do echo $x;donefor x in {1..100};do echo $x;done echo -n 不换行输出 $echo -n "123" $echo "456" 最终输出 123456 echo -e 处理特殊字符 若字符串中

mycat

schema.xml管理逻辑库,分片表,分片借点和分片主机等信息 server.xml是系统参数的配置文件. sequence是全局序列的配置文件 log4j.xml是mycat的日志输出配置文件 mycat从1.5版本开始支持两种配置方式:zookeeper和本地xml方式.默认以本地加载xml方式启动.如果需要配置成zookeeper方式启动,把zk.conf文件中的loadfromzk参数设置成true. server.xml配置文件 1.user标签 p.p1 { margin: 0.0

python 装饰器的用法

为什么要使用装饰器? 在不改变原函数功能的情况,为了添加新的功能 我们可以在函数运行前后给函数添加新的功能 1 def outer(func): 2 #fun()等于原f1函数 3 def inner(): 4 print('ccccc') 5 r=func() 6 print('dddd') 7 return r 8 return inner 9 @outer 10 #@outer代表运行了2个步骤:1.将f1作为参数运行outer函数,2.新函数f1=inner() 11 def f1():

集合和三元运算符

一.三元运算符 如下判断可以使用三元运算更方便的实现: a = 1b = 2 if a > 1: c = aelse: c = b 和下面是一样的: a = 1b = 2#下面这个c = a if a>1 else b 如下两种方法也是一样的:方式一: s=[]nums = list(range(1,11))for i in nums: if i%2==0: s.append(i)print(s)方式二:ss = [i for i in nums if i%2==0]print(ss)#这两种

Pandas中如何处理大数据?

近期的工作和Hive SQL打交道比较多,偶尔遇到一些SQL不好解决的问题,会将文件下载下来用pandas来处理,由于数据量比较大,因此有一些相关的经验可以和大家分享,希望对大家学习pandas有所帮助吧. 大文本数据的读写 有时候我们会拿到一些很大的文本文件,完整读入内存,读入的过程会很慢,甚至可能无法读入内存,或者可以读入内存,但是没法进行进一步的计算,这个时候如果我们不是要进行很复杂的运算,可以使用read_csv提供的chunksize或者iterator参数,来部分读入文件,处理完之后

echo命令的-n -e两个参数

echo -n 不换行输出 $echo -n "123" $echo "456" 最终输出 123456 而不是 123 456 echo -e 处理特殊字符 若字符串中出现以下字符,则特别加以处理,而不会将它当成一般文字输出: \a 发出警告声: \b 删除前一个字符: \c 最后不加上换行符号: \f 换行但光标仍旧停留在原来的位置: \n 换行且光标移至行首: \r 光标移至行首,但不换行: \t 插入tab: \v 与\f相同: \\ 插入\字符: \nnn

Smarty 函数讲解

这里给大家总结了几种Smarty 函数并分别详细讲解了.如果你正在学习Smarty  ,希望这篇文章对你有用. html_checkboxes 自定义函数 html_checkboxes 根据给定的数据创建复选按钮组. 该函数可以指定哪些元素被选定. 要么必须指定 values 和 ouput 属性,要么指定 options 替代. 所有的输出与 XHTML 兼容 html_checkbox用来用给定的数据创建checkbox.name表示checkbox的名称,values表示checkbox

学习SQLite之路(四)

20160621 更新 1. SQLite   alter命令:不通过执行一个完整的转储和数据的重载来修改已有的表. 可以使用 ALTER TABLE 语句重命名表,使用 ALTER TABLE 语句还可以在已有的表中添加额外的列. 在 SQLite 中,除了重命名表和在已有的表中添加列,ALTER TABLE 命令不支持其他操作(在其他数据库中可以改变表中列的数据类型,删除表中的列) (1)基本语法: 用来重命名已有的表的 ALTER TABLE 的基本语法如下: ALTER TABLE da