Exemplo n.º 1
0
 def on_saveas(self, event):
     if manager.model_para is None:
         return IPy.alert('you must train your model first!')
     para = {'path': ''}
     filt = '|'.join(['%s files (*.%s)|*.%s' % ('FCL', 'fcl', 'fcl')])
     if not IPy.getpath('Save..', filt, 'save', para): return
     joblib.dump(manager.model_para, para['path'])
Exemplo n.º 2
0
 def show(self):
     self.para['name'] = self.ips.title
     rst = IPy.get_para('Save Video', self.view, self.para)
     if rst != wx.ID_OK: return rst
     return IPy.getpath('Save Video',
                        '%s files (*.%s)|*.%s' % ('WMV', 'wmv', 'wmv'),
                        'save', self.para)
Exemplo n.º 3
0
 def show(self):
     filt = '|'.join(
         ['%s files (*.%s)|*.%s' % (i.upper(), i, i) for i in ['']])
     return IPy.getpath('Save..',
                        filt,
                        'save',
                        self.para,
                        name=self.tps.title[:8])
Exemplo n.º 4
0
 def on_export(self, event):
     idx = self.lst_model.GetSelection()
     if idx == -1: return IPy.alert('no model selected!')
     para = {'path': ''}
     filt = '|'.join(['%s files (*.%s)|*.%s' % ('FCL', 'fcl', 'fcl')])
     if not IPy.getpath('Save..', filt, 'save', para): return
     oldname = osp.join(
         IPy.root_dir,
         'data/ilastik/%s' % self.lst_model.GetStringSelection())
     print(para['path'])
     shutil.copyfile(oldname, para['path'])
     self.LoadModel()
Exemplo n.º 5
0
    def show(self):
        filt = '|'.join(
            ['%s files (*.%s)|*.%s' % (i.upper(), i, i) for i in self.filt])
        rst = IPy.getpath('Import sequence', filt, 'open', self.para)
        if not rst: return rst

        self.view = [(float, 'time', (1, 12.31), 2, '入侵时间', '(月.日)用小数表示'),
                     (bool, 'check', '县名称检查'), (bool, 'line', '显示2级区划线'),
                     (list, 'type', ['点图', '面图'], str, '灾区标识', ''),
                     ('lab', '', '=' * 20 + ' 以下是备注 ' + '=' * 20),
                     (str, 't1', '备注1:', ''), (str, 't2', '备注2:', ''),
                     (str, 't3', '备注3:', ''), (str, 't4', '备注4:', ''),
                     (str, 't5', '备注5:', ''), (str, 't6', '备注6:', ''),
                     (str, 't7', '备注7:', ''), (str, 't8', '备注8:', '')]
        return IPy.get_para(self.title, self.view, self.para)
Exemplo n.º 6
0
	def show(self):
		filt = '|'.join(['%s files (*.%s)|*.%s'%(i.upper(),i,i) for i in (
			'wmv', 'avi', 'mov')])
		rst = IPy.getpath('Import Video', filt, 'open', self.para)
		if not rst :return rst

		videoCapture = cv2.VideoCapture(self.para['path'])
		nfs = int(videoCapture.get(cv2.CAP_PROP_FRAME_COUNT))
		videoCapture.release()
		self.para['end'] = nfs-1
		self.view = [(str, 'title','Title',''), 
					 (int, 'start', (0, nfs-1), 0, 'Start',  '0~{}'.format(nfs)),
					 (int, 'end', (0, nfs-1), 0, 'End',  '0~{}'.format(nfs)),
					 (bool, 'gray', 'convert to gray')]
		return IPy.get_para('Import sequence', self.view, self.para)
Exemplo n.º 7
0
 def start(self, para=None, callafter=None):
     wb = pyxl.load_workbook(self.cont)
     xlreport.repair(wb)
     info, key = xlreport.parse(wb)
     if para is not None:
         return self.runasyn(wb, info, para, callafter)
     dialog = GridDialog(IPy.curapp, self.title, info, key)
     rst = dialog.ShowModal()
     para = dialog.GetValue()
     dialog.Destroy()
     if rst != 5100: return
     filt = '|'.join(['%s files (*.%s)|*.%s' % ('XLSX', 'xlsx', 'xlsx')])
     if not IPy.getpath('Save..', filt, 'save', para): return
     win = WidgetsManager.getref('Macros Recorder')
     if win != None: win.write('{}>{}'.format(self.title, para))
     self.runasyn(wb, info, key, para, callafter)
Exemplo n.º 8
0
    def show(self):
        filt = '|'.join(
            ['%s files (*.%s)|*.%s' % (i.upper(), i, i) for i in self.filt])
        rst = IPy.getpath('Import sequence', filt, 'open', self.para)
        if rst != wx.ID_OK: return rst

        files = self.getfiles(self.para['path'])
        nfs = len(files)
        self.para['end'] = nfs - 1
        self.view = [
            (str, 'Title', 'title', ''),
            (int, (0, nfs - 1), 0, 'Start', 'start', '0~{}'.format(nfs - 1)),
            (int, (0, nfs - 1), 0, 'End', 'end', '0~{}'.format(nfs - 1)),
            (int, (0, nfs - 1), 0, 'Step', 'step', '')
        ]
        return IPy.get_para('Import sequence', self.view, self.para)
Exemplo n.º 9
0
 def show(self):
     filt = '|'.join(
         ['%s files (*.%s)|*.%s' % (i.upper(), i, i) for i in self.filt])
     rst = IPy.getpath('Import sequence', filt, 'open', self.para)
     if not rst: return rst
     shp, prj, m, chans = gio.read_raster_box(self.para['path'])
     files = self.getfiles(self.para['path'])
     nfs = len(files)
     self.para['end'] = nfs - 1
     self.view = [
         (str, 'title', 'Title', ''),
         (int, 'start', (0, nfs - 1), 0, 'Start', '0~{}'.format(nfs - 1)),
         (int, 'end', (0, nfs - 1), 0, 'End', '0~{}'.format(nfs - 1)),
         (int, 'step', (0, nfs - 1), 0, 'Step', ''),
         ('chos', 'chans', chans, 'Channels')
     ]
     return IPy.get_para('Import sequence', self.view, self.para)
Exemplo n.º 10
0
 def show(self):
     filt = '|'.join(
         ['%s files (*.%s)|*.%s' % (i.upper(), i, i) for i in self.filt])
     rst = IPy.getpath('Import sequence', filt, 'open', self.para)
     if not rst: return rst
     ds = gdal.Open(self.para['path'])
     sds = ds.GetSubDatasets()
     files = self.getfiles(self.para['path'])
     nfs = len(files)
     self.para['end'] = nfs - 1
     self.view = [
         (str, 'title', 'Title', ''),
         (int, 'start', (0, nfs - 1), 0, 'Start', '0~{}'.format(nfs - 1)),
         (int, 'end', (0, nfs - 1), 0, 'End', '0~{}'.format(nfs - 1)),
         (int, 'step', (0, nfs - 1), 0, 'Step', ''),
         ('chos', 'chans', [i[0] for i in sds], 'Channels')
     ]
     return IPy.get_para('Import sequence', self.view, self.para)
Exemplo n.º 11
0
 def show(self):
     filt = 'MARK files (*.mrk)|*.mrk'
     return IPy.getpath('Save..', filt, 'save', self.para)
Exemplo n.º 12
0
 def show(self):
     filt = '|'.join(['%s files (*.%s)|*.%s'%(i.upper(),i,i) for i in ['htm','html']])
     return IPy.getpath('Open..', filt, 'open', self.para)
Exemplo n.º 13
0
 def show(self):
     self.view = [('tab', 'Table', 'tab', '')]
     rst = IPy.getpara('Import sequence', self.view, self.para)
     if rst != wx.ID_OK: return rst
     filt = 'TXT files (*.txt)|*.txt'
     return IPy.getpath('Import sequence', filt, self.para)
Exemplo n.º 14
0
 def load(self):
     filt = 'RAW files (*.raw)|*.raw'
     rst = IPy.getpath('Open..', filt, 'open', self.para)
     if rst!=None:return True
Exemplo n.º 15
0
 def show(self):
     filt = 'Macros files (*.mc)|*.mc'
     return IPy.getpath('open..', filt, 'open', self.para)
Exemplo n.º 16
0
 def load(self):
     filt = '|'.join(
         ['%s files (*.%s)|*.%s' % (i.upper(), i, i) for i in ["zip"]])
     return IPy.getpath(self.title, filt, 'open', self.para)
Exemplo n.º 17
0
 def show(self):
     filt = '|'.join(['%s files (*.%s)|*.%s'%(i.upper(),i,i) for i in ['shp']])
     return IPy.getpath('Save..', filt, 'save', self.para)
Exemplo n.º 18
0
 def load(self, ips):
     filt = '|'.join(
         ['%s files (*.%s)|*.%s' % (i.upper(), i, i) for i in ['GIF']])
     return IPy.getpath('Save..', filt, 'save', self.para)
Exemplo n.º 19
0
 def show(self):
     filt = 'MARK files (*.mrk)|*.mrk'
     return IPy.getpath('Open..', filt, 'open', self.para)
Exemplo n.º 20
0
 def show(self):
     filt = '|'.join(
         ['%s files (*.%s)|*.%s' % (i.upper(), i, i) for i in ['PRJ']])
     return IPy.getpath('Build idx', filt, 'open', self.para)
Exemplo n.º 21
0
 def show(self):
     filt = 'BMP files (*.bmp)|*.bmp|PNG files (*.png)|*.png|JPG files (*.jpg)|*.jpg|GIF files (*.gif)|*.gif'
     return IPy.getpath('Save..', filt, 'save', self.para)