コード例 #1
0
    def __init__(self):
        super().__init__()

        # mainmenu attribute can be specified to create the GUI menu
        self.mainmenu = [{
            'File': [{
                'Open': self.__openEvent
            }, {
                'Save': self.__saveEvent
            }, {
                'Save as': self.__saveAsEvent
            }, {
                'Reload': self.__reloadEvent
            }]
        }]

        # Create text area to edit file contents
        self.editor = ControlTextArea()

        # Create file dialog control object.
        self.filedialog = ControlFile()
        self.filedialog.hide()

        # This attribute will hold the path to the current file being edited
        self.current_file = None
コード例 #2
0
    def __image_file_selection_event(self):

        open = ControlFile('image')
        open.click()
        fname = open.value.split("/")

        _filename = fname[len(fname) - 1]
        ## check blank path
        if open.value == "":
            return
        ## is image
        try:
            img = cv2.imread(open.value)
            height, width, alp = img.shape
        except:
            self.alert(msg="File is not a image")
        #check for file type

        self.tempath = ""
        self.path = open.value

        self.title = "Open file " + path
        self._imglabel.value = _filename
        self.tempath = TEMP + _filename
        copyfile(self.path, self.tempath)

        self._ToolsBox__updateImage(self.tempath)
コード例 #3
0
ファイル: mvc.py プロジェクト: shalevy1/pyforms-examples
    def __init__(self):
        BaseWidget.__init__(self)
        Organisms.__init__(self)

        self._list = ControlList(
            'Organisms',
            add_function=self.__addOrganismBtnAction,
            remove_function=self.__removeOrganismBtnAction)
        self._list.horizontal_headers = [
            'Kingdom', 'Class', 'Order', 'Family', 'Name'
        ]
        self._panel = ControlEmptyWidget()
        self.filedialog = ControlFile()
        self.filedialog.hide()

        self.mainmenu = [{
            'File': [{
                'Open': self.__openMenuAction
            }, {
                'Save': self.__saveMenuAction
            }]
        }]

        # Add by default some entities
        self.add(cat)
        self.add(human)
コード例 #4
0
ファイル: gui.py プロジェクト: hugodelahousse/csv2owl
    def __init__(self):
        super(Csv2OwlWidget, self).__init__('csv2owl')

        self._prefix = ControlFile('Prefixes CSV')
        self._classes = ControlFile('Classes CSV')
        self._properties = ControlFile('Properties CSV')
        self._output_format = ControlCombo('Output Format')
        self._output_format.add_item('JSON-LD', 'json-ld')
        self._output_format.add_item('XML', 'pretty-xml')

        self._generate = ControlButton('Generate')
        self._generate.value = self.__generateAction
コード例 #5
0
    def __init__(self, *args, **kwargs):
        super().__init__("Gateway Helper")

        self.set_margin(20)

        if getattr(sys, 'frozen', False):
            self.application_path = os.path.dirname(sys.executable)
        elif __file__:
            self.application_path = os.path.dirname(__file__)

        # cwd = os.getcwd()
        self.cwd = self.application_path
        # print()
        # print(cwd)
        # print()
        # self.cartsDir = os.path.join(self.cwd, "Carts")

        os.environ["PATH"] += os.pathsep + self.cwd

        self._vendor = ControlText('Vendor (Use exactly what Gateway does)')
        self._cart = ControlFile('Cart Excel File')
        self._runbutton = ControlButton('Run')
        self._cancelbutton = ControlButton('Cancel')

        self._vendor.changed_event = self.__vendorSelectEvent
        self._cart.changed_event = self.__cartSelectEvent

        self._runbutton.value = self.__runEvent
        self._cancelbutton.value = self.__cancelEvent

        self._formset = [('_vendor'), '_cart', ("_runbutton", '_cancelbutton')]

        self.fileOkay = False
        self.vendorOkay = False
        self.df = pd.DataFrame()
コード例 #6
0
    def __init__(self, timeline=None):
        super(ImportWindow, self).__init__('Import file', parent_win=timeline)
        self.setContentsMargins(10, 10, 10, 10)
        self._timeline = timeline

        # Definition of the forms fields
        self._filetype = ControlCombo(
            'Please select the type of file you would like to import:')
        self._importButton = ControlButton('Import')
        self._panel = ControlEmptyWidget('Panel')
        self._file = ControlFile('File to import')

        self._panel.value = self._file
        self._filetype.add_item('Events file', 0)
        self._filetype.add_item('Graph file', 1)
        self._filetype.add_item('Bonsai events file', 2)
        self._filetype.add_item('Bonsai events file (old format)', 3)

        self._formset = [('_filetype', ' '), '_panel', (' ', '_importButton'),
                         ' ']

        self._filetype.changed_event = self.__fileTypeChanged
        self._importButton.value = self.__importData

        from pyforms.gui.dialogs.csv_parser import CsvParserDialog
        self._graphCsvParserDlg = CsvParserDialog()
        self._graphCsvParserDlg.xField.label = "Value column"
        self._graphCsvParserDlg.yField.hide()
        self._graphCsvParserDlg.zField.hide()
        self._graphCsvParserDlg.loadButton.hide()

        self._bonsai_import_dlg = BonsaiImportFileDlg()
コード例 #7
0
    def __init__(self, timeline=None):
        super(BonsaiImportFileDlg, self).__init__('Import file')

        self._file = ControlFile('File to import')
        self._fps = ControlNumber('Video FPS', default=30)

        self._formset = [('_fps', '_file')]
コード例 #8
0
ファイル: generic_csv_parser.py プロジェクト: AvosLab/Subsin
    def __init__(self, columns, parent=None):
        super(GenericCsvParserDialog, self).__init__('CSV Choose the columns',
                                                     parent_win=parent)

        self._filename = None
        self._columns = columns
        self._columns_indexes = []
        self._rownum = 0

        # Definition of the forms fields
        self._filename = ControlFile('CSV File')
        self._separator = ControlText('Separator', default='auto')
        self._startingrow = ControlNumber('Starting row', default=0)

        for index, column in enumerate(columns):
            setattr(
                self, '_col_{0}'.format(index),
                ControlNumber(column, default=index, minimum=-1, maximum=1000))

        self._filePreview = ControlList('Preview')
        self._loadButton = ControlButton('Load')

        form_row = ['_separator'] + [
            '_col_{0}'.format(index) for index, column in enumerate(columns)
        ] + ['_loadButton']

        self._formset = [('_filename', '_startingrow'),
                         tuple(form_row), '_filePreview']
        self._separator.changed_event = self.__refreshPreview
        self._filename.changed_event = self.__refreshPreview
        self._startingrow.changed_event = self.__refreshPreview
        self._loadButton.value = self.load

        self._load_event = None
コード例 #9
0
    def __init__(self, parent=None):
        super(GeometryFromThreshold,
              self).__init__('Find geometry using a threshold on the image',
                             parent_win=parent)

        self._filename = ControlFile('Video file name')
        self._player = ControlPlayer('Player')
        self._threshold = ControlSlider('Movement threshold',
                                        default=10,
                                        minimum=0,
                                        maximum=255)
        self._epsilon = ControlSlider('Epsilon',
                                      default=10,
                                      minimum=1,
                                      maximum=255)
        self._add_contour = ControlButton('add contour')

        self._formset = [
            '_filename', ('_threshold', '_epsilon', '_add_contour'), '_player'
        ]

        self._filename.changed_event = self.__filename_changed
        self._player.process_frame_event = self.__processFrame
        self._threshold.changed_event = self._player.refresh
        self._epsilon.changed_event = self._player.refresh
        self._add_contour.value = self.__add_contours

        self._filename.value = '/home/ricardo/bitbucket/single-fly-tracker/Circle_and_Square.avi'

        self._contours = []
コード例 #10
0
	def __init__(self, *args, **kwargs):
		super().__init__('Computer vision algorithm example')

		# Definition of the forms fields
		self._videofile = ControlFile('Video Link')
		self._outputfile = ControlText('Results output file')
		# self._threshold  = ControlSlider('Threshold', default=114, minimum=0, maximum=255)
		# self._blobsize   = ControlSlider('Minimum blob size', default=110, minimum=100, maximum=2000)
		# self._player     = ControlPlayer('Player')
		self._runbutton = ControlButton('Run')

		# Define the function that will be called when a file is selected
		self._videofile.changed_event = self.__video_file_selection_event
		# Define the event that will be called when the run button is processed
		self._runbutton.value = self.run_event
		# Define the event called before showing the image in the player
		self._player.process_frame_event = self.__process_frame

		# Define the organization of the Form Controls
		self._formset = [
			('_videofile', '_outputfile'),
			# '_threshold',
			# ('_blobsize', '_runbutton'),
			# '_player'
		]
コード例 #11
0
    def __init__(self, *args, **kwargs):
        super().__init__('Astrocat GUI')
        self._input_file = ControlFile('Imaging record (*.lsm or *.tiff)')
        #self._json_file = ControlFile('Parameter JSON file')
        self._flags = ControlCheckBoxList('Flags')
        self._morphology_channel = ControlNumber("Morphology channel",
                                                 minimum=0,
                                                 maximum=5,
                                                 default=0)
        self._ca_channel = ControlNumber("Ca channel",
                                         minimum=0,
                                         maximum=5,
                                         default=1)
        self._suff = ControlText("Name suffix", default='astrocat004')
        self._fps = ControlNumber("Movie fps", default=25)
        self._codec = ControlText('Movie codec', default='libx264')

        self._detection_label = ControlLabel('Detection')
        self._detection_loc_nhood = ControlNumber('Nhood', default=5)
        self._detection_loc_stride = ControlNumber('Stride', default=2)
        self._detection_spatial_filter = ControlNumber('Spatial filter',
                                                       default=3)

        self._run_button = ControlButton('Process')
        self._run_button.value = self.__run_button_fired

        self._formset = [
            '_input_file', '=',
            [
                '_detection_label', '_detection_loc_nhood',
                '_detection_loc_stride'
            ], ('_codec', '_fps'), ('_run_button')
        ]
コード例 #12
0
    def __init__(self):
        super(Example1, self).__init__('dir examples')
        self.parent = None
        self._directory = ControlDir('Choose a directory')
        self._file = ControlFile('Choose a file')
        self._filetree = ControlFilesTree('Choose a file')
        self._image = ControlImage('Image')
        self._boundaries = ControlBoundingSlider('Bounding', horizontal=True)
        self._button = ControlButton('Click')

        self._button.value = self.onButtonClick
        # self._directory.value=self.onButtonClick

        self._checkbox = ControlCheckBox('Choose a directory')
        self._checkboxList = ControlCheckBoxList('Choose a file')
        self._player = ControlPlayer('Choose a file')
        self._slider = ControlSlider('Slider')
        self._player.show()
        self._checkboxList.value = [('Item 1', True), ('Item 2', False), ('Item 3', True)]

        self._combobox = ControlCombo('Choose a item')
        self._list = ControlList('List label')
        self._progress = ControlProgress('Progress bar')
        self._visvisVolume = ControlVisVisVolume('Visvis')
        self._timeline = ControlEventTimeline('Timeline')

        self._combobox.add_item('Item 1', 'Value 1')
        self._combobox.add_item('Item 2', 'Value 2')
        self._combobox.add_item('Item 3', 'Value 3')
        self._combobox.add_item('Item 4')

        self._list.value = [('Item1', 'Item2', 'Item3',), ('Item3', 'Item4', 'Item5',)]
        imageWithVolume = np.zeros((100, 100, 100), np.uint8)
        imageWithVolume[30:40, 30:50, :] = 255
        imageWithVolume[30:40, 70:72, :] = 255
        self._visvisVolume.value = imageWithVolume

        self._visvis = ControlVisVis('Visvis')
        values1 = [(i, random.random(), random.random()) for i in range(130)]
        values2 = [(i, random.random(), random.random()) for i in range(130)]
        self._visvis.value = [values1, values2]

        self.formset = [
            '_visvis'
            , '_directory'
            , '_button'
            , '_file'
            , '_boundaries'
            , '_filetree'
            , '_image'
            , '_slider'
            , ('_checkboxList', '_player')
            , ('_checkbox', ' ')
            , ('_combobox', ' ')
            , '_progress'
            , '='
            , ('_visvisVolume', '||', '_list')
            , '_timeline'
        ]
コード例 #13
0
ファイル: ui.py プロジェクト: Axlii/latex
    def __init__(self, *args, **kwargs):
        super().__init__('LateX')

        self._imagefile = ControlFile('Select image file')
        self._runbutton = ControlButton('Run')

        self._runbutton.value = self.__runEvent
        self._formset = [('_imagefile'), ('_runbutton')]
コード例 #14
0
    def __init__(self):
        super(Gui, self).__init__('Converter')

        #self._firstname = ControlText('First name')
        self._fileControl = ControlFile('Select File')
        self._fileControl.changed_event = self.__fileselectionevent
        self._toControl = ControlCombo('To', enabled=0)
        self._buttonControl = ControlButton('Convert', enabled=0)
        self._buttonControl.value = self.__clicker
コード例 #15
0
    def __init__(self, timeline=None):
        super(BonsaiImportFileDlg, self).__init__('Import file')

        self._file          = ControlFile('File to import')
        self._fps           = ControlNumber('Video FPS', default=30)
        self._startframe    = ControlNumber('Initial frame', visible=False, maximum=100000)


        self._formset = [('_startframe','_fps', '_file')]
コード例 #16
0
    def __init__(self):
        super(FluorescencePredictor,
              self).__init__('Предсказатель Флуоресенции')

        #Definition of the forms fields
        self._answer = ControlLabel('Ответ')
        self._load = ControlFile(label='Загрузить снимок')

        self._load.changed_event = self._fileOpen
コード例 #17
0
 def __init__(self):
     super(MainWindow, self).__init__('Main Window')
     self._fileInput = ControlFile("Input file")
     self._cbAlgo = ControlCombo("Algorithm")
     self._cbAlgo.add_item('Basic recursion', 1)
     self._cbAlgo.add_item('Depth First Search', 2)
     self._cbAlgo.add_item('Breadth First Search', 3)
     self._btnRun = ControlButton("Run")
     self._btnRun.value = self.__btnRunAction
コード例 #18
0
    def __init__(self):
        super(KaryML_Main, self).__init__(self.APP_NAME)
        self._app_title = ControlLabel(self.APP_NAME)
        self._input_image_path = ControlFile('Input image')
        self._pairs_path = ControlFile('Expected karyotype (optional)')

        self._features_label = ControlLabel("Chose features to be extracted")

        self._f1_check_box = ControlCheckBox(label=self.LENGTH_FEATURE, default=True)
        self._f1_check_box.changed_event = self._f1_check_box_changed
        self._f2_check_box = ControlCheckBox(label=self.CENTROMERIC_INDEX_FEATURE, default=True)
        self._f2_check_box.changed_event = self._f2_check_box_changed
        self._f3_check_box = ControlCheckBox(label=self.BANDING_PATTERN_FEATURE, default=True)
        self._f3_check_box.changed_event = self._f3_check_box_changed
        self._f4_check_box = ControlCheckBox(label=self.AREA_FEATURE, default=True)
        self._f4_check_box.changed_event = self._f4_check_box_changed

        self._eu_dist = ControlButton(EUCLIDEAN_DISTANCE)
        self._we_eu_dist = ControlButton(WEIGHTED_EUCLIDEAN_DISTANCE)
        self._man_dist = ControlButton(MANHATTAN_DISTANCE)

        self._dist_label = ControlLabel(label="Distance to use: " + EUCLIDEAN_DISTANCE.upper(),
                                        default="Distance to use: " + EUCLIDEAN_DISTANCE)

        self._f1_w = ControlSlider(label="Chromosome length", default=25, minimum=0, maximum=100, visible=False)
        self._f2_w = ControlSlider(label="  Centromeric Index", default=25, minimum=0, maximum=100, visible=False)
        self._f3_w = ControlSlider(label="      Banding pattern", default=25, minimum=0, maximum=100, visible=False)
        self._f4_w = ControlSlider(label="Chromosome area", default=25, minimum=0, maximum=100, visible=False)

        self._epochs_no = ControlSlider(label="    Epochs Nr.", default=200000, minimum=50000, maximum=400000)
        self._rows = ControlSlider(label="     Map rows", default=50, minimum=10, maximum=100)
        self._cols = ControlSlider(label="Map columns", default=50, minimum=10, maximum=100)

        self.errors_label_text = ControlLabel(label="Errors:", default="Errors:", visible=True)
        self.errors_label = ControlLabel(label="Errors", default="", visible=False)
        self.info_label_text = ControlLabel(label="Info:", default="Info:", visible=True)
        self.info_label = ControlLabel(label="Info", default="", visible=False)
        self._button = ControlButton('Start {}'.format(self.APP_NAME))
        self._button.value = self._runKarySomAction

        self._eu_dist.value = self.__dist_changed_eu
        self._we_eu_dist.value = self.__dist_changed_we_eu
        self._man_dist.value = self.__dist_changed_man
        self.t = None
コード例 #19
0
    def __init__(self, title, parent=None):
        super(GeometryManualDesigner, self).__init__(title, parent_win=parent)

        self._threshold_win = None
        self._start_point = None
        self._end_point = None

        self._selected_poly = None
        self._selected_point = None

        self._video = ControlFile("Video file")
        self._player = ControlPlayer("Video")
        self._remove = ControlButton("Remove")
        self._square = ControlButton("Square", checkable=True)
        self._circle = ControlButton("Circle", checkable=True)
        self._threshold = ControlButton("Threshold")
        self._export = ControlButton("Export")
        self._import = ControlButton("Import")
        self._polygons = ControlList('Polygons')

        self._apply = ControlButton('Apply')

        self._formset = [
            '_video', "_player",
            ("_square", "_circle", "_threshold", " ", "_remove", " ",
             "_export", "_import"), "=", "_polygons", '_apply'
        ]

        self._video.changedchanged_event = self.videoSelected
        self._square.value = self.square_toggle
        self._circle.value = self.circle_toggle
        self._remove.value = self.remove_clicked
        self._export.value = self.export_clicked
        self._import.value = self.import_clicked
        self._threshold.value = self.threshold_btn_click

        self._player.drag_event = self.on_player_drag_in_video_window
        self._player.end_drag_event = self.on_player_end_drag_in_video_window
        self._player.click_event = self.on_player_click_in_video_window
        self._player.double_click_event = self.on_player_double_click_in_video_window
        self._player.process_frame_event = self.process_frame
        self._player.key_release_event = self.on_player_key_release

        self._apply.hide()
コード例 #20
0
ファイル: pyforms_ui.py プロジェクト: macieyn/ARpi
    def __init__(self, *args, **kwargs):

        #settings.PYFORMS_STYLESHEET = "style.css"

        super().__init__("EKOHEX Loader GUI v1.0 - Maciej Nachtygal")

        # Definition of the forms fields

        self._uC = ControlCombo("Mikrokontroler: ")
        items = ["Wybierz...", "Attiny 10", "Attiny 13", "Attiny 24"]
        for item in items:
            self._uC.add_item(item)
        self._clock = ControlCombo("Ust. zegara: ")
        self._upload = ControlCombo("Częst. wgrywania: ")
        items = [
            "2 kHz", "4 kHz", "8 kHz", "16 kHz", "32 kHz", "93.75 kHz",
            "187 kHz", "375 kHz", "750 kHz", "1500 kHz"
        ]
        for item in items:
            self._upload.add_item(item)

        self._hexfile = ControlFile("Wybierz plik .hex : ")
        self._reapeat = ControlCheckBox("produkcja")
        self._reapeatInput = ControlText("Ilość: ")
        self._reapeatInput.enabled = False
        self.repeatStatus = self._reapeatInput.enabled

        self._progress = ControlProgress()
        self._progress.min = 0
        self._progress.max = 100
        self.progressStatus = 0

        self._startButton = ControlButton("Start")
        self._stopButton = ControlButton("Stop")
        self.stop = False

        self._logBox = ControlTextArea("Log:")
        self._logBox.readonly = True
        self._logBox.autoscroll = True
        self._logBox.value = "Program gotowy do działania!\n"
        self.avrdudeInfo = ""

        # Define the function that will be called when a file is selected
        self._hexfile.changed_event = self.__hexFileSelectionEvent
        self._uC.changed_event = self.__uCSelectionEvent
        self._clock.changed_event = self.__clockSelectionEvent
        self._upload.changed_event = self.__uploadSelectionEvent
        self._reapeat.changed_event = self.__reapeatSelectionEvent
        self._reapeatInput.changed_event = self.__valueUpdateSelectionEvent
        self._startButton.value = self.__startSelectionEvent
        self._stopButton.value = self.__stopSelectionEvent
        # Define the organization of the Form Controls
        self._formset = [("_hexfile"), ("_uC", "_clock"),
                         ("_upload", "_reapeat", "_reapeatInput"),
                         ("_progress"), ("_startButton", "_stopButton"),
                         "_logBox"]
コード例 #21
0
 def __init__(self):
     super(MainWindow, self).__init__('Maze Solver')
     self._fileInput = ControlFile("Input file")
     self._cbAlgo = ControlCombo("Algorithm")
     self._cbAlgo.add_item('Brute force', 1)
     self._cbAlgo.add_item('Depth First Search', 2)
     self._cbAlgo.add_item('Breadth First Search', 3)
     self._btnRun = ControlButton("Run")
     self._btnRun.value = self.__btnRunAction
     self._lblStatus = ControlLabel('STATUS: IDLE')
コード例 #22
0
	def __init__(self, name):
		OTModulePlugin.__init__(self, name, iconFile = tools.getFileInSameDirectory(__file__, 'iconvi.jpg'))
		TypeColorVideo.__init__(self)
	
		self._file      = ControlFile("File")
		self._player    = ControlPlayer("Video")

		self._formset = [ "_file", "_player"]
		
		self._file.changed = self.__videoSelected
コード例 #23
0
	def __init__(self, project):
		IModelGUI.__init__(self)
		Video.__init__(self, project)
		BaseWidget.__init__(self, 'Video window', parent_win=project)

		self._file 			= ControlFile('Video')
		self._addobj 		= ControlButton('Add object')
		self._addimg 		= ControlButton('Add Image')
		self._removevideo  	= ControlButton('Remove')
		self._fps_label 	= ControlLabel('Frames per second')
		self._width_label 	= ControlLabel('Width')
		self._height_label 	= ControlLabel('Height')
		

		self.formset = [
			'_name',
			'_file',
			'_removevideo',
			'_fps_label',
			('_width_label', '_height_label'),
			' '
		]

		self._name.enabled = False

		self._addobj.icon 	 	= conf.ANNOTATOR_ICON_ADD
		self._addimg.icon 	 	= conf.ANNOTATOR_ICON_ADD
		self._removevideo.icon 	= conf.ANNOTATOR_ICON_REMOVE

		self._addobj.value   	 = self.create_object
		self._addimg.value   	 = self.create_image
		

		self._removevideo.value  = self.__remove_video_changed_event
		self._file.changed_event = self.__file_changed_event

		self.treenode = self.tree.create_child('Video', icon=conf.ANNOTATOR_ICON_VIDEO)
		self.treenode.win = self
コード例 #24
0
ファイル: Videoplayer.py プロジェクト: anaik12/Videoplayer
    def __init__(self):
        super(VideoPlayer, self).__init__('Video Player')

        #Defnition of the form fields

        #         self._dirname = ControlText('Directory', 'Default Value')
        self._button_play = ControlButton("Play")
        self._button_play.value = self.__play_all

        self._button_pause = ControlButton("Pause")
        self._button_pause.value = self.__pause_all

        self._button_refresh = ControlButton("Reload")
        self._button_refresh.value = self.__refresh_all

        self._button_print = ControlButton("Print")
        self._button_print.value = self.__print_value
        #         self.formset = [{'Tab1':['_dirname'],},'_button']

        #         self._directory = ControlDir('Choose a directory')
        self._file1 = ControlFile('File 1')
        self._file2 = ControlFile('File 2')
        #         print(self._file.value)
        self._filetree = ControlFilesTree('Choose a file')

        #         self._filetree.value = 'C:\\Users\\Ashwini Naik\\Videos\\Captures'

        #         self._checkbox = ControlCheckBox('Choose a directory')
        #         self._checkboxList = ControlCheckBoxList('Choose a file')
        self._player = ControlPlayer('Choose a file')
        self._player1 = ControlPlayer('Choose a file')
        #         self._slider = ControlSlider('Slider')

        self._player.value = '_file.value'
        #         self._player.refresh()
        self.formset = [('_button_play', '_button_pause', '_button_refresh'),
                        ('_file1', '_file2'), ('_player', '_player1')]
コード例 #25
0
    def __init__(self, parent=None):
        super(DeepLabWindow, self).__init__('Label DeepLabCut',
                                            parent_win=parent)
        self.mainwindow = parent

        if deeplabcut_is_installed:

            self._file = ControlFile('YAML  to import from:')
            self._importButton = ControlButton('Import')

            self._outdir = ControlDir('Output directory')
            self._outfile = ControlText('Output file name')
            self._exportButton = ControlButton('Export')

            self._unlabeledFramesButton = ControlButton(
                "Check unlabeled frames ")

            self.formset = [
                ('_file', '_importButton'),
                ' ',
                '_unlabeledFramesButton',
                ' ',
                '_outdir',
                '_outfile',
                '_exportButton',
            ]

            self._importButton.value = self.__importFromYAMLFile
            self._exportButton.value = self.__exportToCSVFile
            self._unlabeledFramesButton.value = self.__checkUnlabeledFrames

            self.set_margin(5)
            #self.layout().setMargin(5)
            self.setMinimumHeight(400)
            self.setMinimumWidth(600)

            self._scorer = ""
            self._videos = {}
            self._bodyparts = []

        else:
            link = "<a target='_blank' href=\"https://pythonvideoannotator.readthedocs.io/en/master/user-docs\
            /install_and_run/index.html#install-deeplabcut\"> https://pythonvideoannotator.readthedocs.io/en/master/user-docs\
            /install_and_run/index.html#install-deeplabcut </a>"

            self.formset = [
                "Please follow the instructions in the link below to install deeplabcut: <br/><br/>"
                + link
            ]
コード例 #26
0
    def __init__(self, **kwargs):
        BaseWidget.__init__(self, 'Mask')
        Class.__init__(self, **kwargs)

        try:
            self.layout().setContentsMargins(10, 5, 10, 5)
            self.setMinimumHeight(100)
        except:
            pass

        self._maskimg = ControlFile('Mask image')
        self._formset = ['_maskimg']

        self._maskimg.changed_event = self.__maskimg_changed_event

        self._param_mask_img = None
コード例 #27
0
ファイル: record_app.py プロジェクト: haojia632/emotiv-client
    def __init__(self, *args, **kwargs):
        super().__init__('Computer vision algorithm example')

        # Definition of the forms fields
        self._first_name = ControlText('First Name')
        self._last_name = ControlText('Last Name')
        self._image_file = ControlFile('Image')
        self._image = ControlImage()
        self._start_button = ControlButton('Start')

        # Define the function that will be called when a file is selected
        self._image_file.changed_event = self.__image_file_selection_event
        # Define the event that will be called when the run button is processed
        self._start_button.value = self.run_event

        # Define the organization of the Form Controls
        self._formset = [('_first_name', '_last_name'),
                         ('_image_file', '_start_button'), '_image']
コード例 #28
0
    def __init__(self):
        BaseWidget.__init__(self, 'Batch Object Detection')

        self.batchFolder = ""
        self.batchFile = ""

        self._dir = ControlFile()
        self.Canvas = ControlPlayer('Canvas')
        self._label1 = ControlLabel("")
        self._start = ControlButton("Count")
        self._clr = ControlButton("Clear count")
        self._Progress = ControlProgress(label="0/0")
        self._Progress.min = 0

        self._clr.value = self.clr_mongo
        self.Canvas.value = "./batchDetect/test.jpg"
        self._dir.changed_event = self.folderpath_event
        self._start.value = self._startCount
コード例 #29
0
    def __init__(self):
        super(AutoStartPrograms, self).__init__('Autostart programs')

        # select script
        self._selectScript = ControlFile('select startup script: ')
        self._selectScript.changed_event = self.SelectScriptChanged

        # select list
        self._autoStartList = ControlCheckBoxList('autostart items')
        self._autoStartList.value = self.AutoStartList()
        self._autoStartList.changed_event = self.AutoStartListChanged

        # delete button
        self._buttonDelete = ControlButton('delete')
        self._buttonDelete.value = self._buttonDeleteAction

        # close button
        self._buttonClose = ControlButton('close')
        self._buttonClose.value = self._buttonCloseAction
コード例 #30
0
    def __init__(self, *args, **kwargs):
        super().__init__('Tiểu luận 2020 - Trần Hữu Hiền')

        self.set_margin(10)

        #Definition of the forms fields
        self._controlLabel = ControlLabel(
            'Tiểu luận 2020 - Trần Hữu Hiền - Nguyễn Phú Thông')
        self._imgFile = ControlFile('Chọn file')
        self._runbutton = ControlButton('Xử lý')
        self._outputfile = ControlText('Chữ trong hình')

        #Define the organization of the Form Controls
        self._formset = [
            '_controlLabel', ('_imgFile', '_runbutton'), '_outputfile'
        ]

        #Define the function that will be called when a file is selected
        self._runbutton.value = self.__runAction