Beispiel #1
0
    def __init__(self):

        self.path_manager = ds.PathManager()
        self.dset_store = ds.DetectionSetStore()
        self.hypothesis_manager = ds.HypothesisManager()
        self.claim_manager = ds.ClaimManager()
        self.graph = ds.Graph(self.dset_store, future_depth=3)
    def __init__(self):

        self.dset_store = ds.DetectionSetStore()
        self.modules = [
            vm.PathCongruence(),
            vm.PairsContinuity(),
            vm.EqualityCounter()
        ]
    def __init__(self, app, parent=None):

        super(MainWindow, self).__init__(parent)
        self.resize(1000, 600)
        self.setWindowTitle('BeesBook Filtering Editor')

        self.central_widget = QtGui.QStackedWidget(self)
        self.setCentralWidget(self.central_widget)

        self.dset_store = ds.DetectionSetStore()
        self.path_manager = ds.PathManager()

        self.loader_tab = LoaderTab(self, app)
        self.editor_tab = EditorTab(self, app)

        self.central_widget.addWidget(self.loader_tab)
        self.central_widget.addWidget(self.editor_tab)
        self.central_widget.setCurrentWidget(self.loader_tab)
    def __init__(self):

        self.path_manager = ds.PathManager()
        self.dset_store = ds.DetectionSetStore()
        self.claim_manager = ds.ClaimManager()
    def load_data(self):

        if not os.path.exists(config.DATA_FOLDER):
            print 'Error: folder not found'
            return

        self.block_inputs(True)

        self.dset_store = ds.DetectionSetStore()
        self.path_manager = None
        self.paths_load_progress.setValue(0)
        self.paths_load_label.setText('')

        try:
            repo = Repository(config.DATA_FOLDER)
            start_time = datetime(config.DATE[0],
                                  config.DATE[1],
                                  config.DATE[2],
                                  config.TIME[0],
                                  config.TIME[1],
                                  tzinfo=pytz.utc)

            fnames = repo.iter_fnames(begin=start_time)
            for fname in fnames:

                frame_container = load_frame_container(fname)

                cam = frame_container.camId
                #frame_container.fromTimestamp              # already available
                #frame_container.toTimestamp                # already available

                self.dset_store.source = frame_container.dataSources[
                    0].filename

                previous_timestamp = None

                self.data_load_progress.setMaximum(config.FRAME_END + 1 -
                                                   config.FRAME_START)
                self.app.processEvents()

                frame_index = config.FRAME_START

                for frame in list(frame_container.frames
                                  )[config.FRAME_START:config.FRAME_END + 1]:

                    #timestamp = frame.timestamp  # not included yet
                    #frame.id                     # not included yet

                    timestamp = ds.TimeStamp(frame_index, cam)
                    timestamp.connect_with_previous(previous_timestamp)
                    previous_timestamp = timestamp

                    dset = ds.DetectionSet()
                    self.dset_store.store[timestamp] = dset

                    data = convert_frame_to_numpy(frame)

                    for detection_data in data:

                        dset.add_detection(
                            ds.Detection(
                                detection_data['idx'],
                                timestamp,
                                np.array(
                                    [
                                        detection_data['ypos'],
                                        detection_data['xpos']
                                    ]
                                ),  # rotated, otherwise will be portrait orientation
                                detection_data['localizerSaliency'],
                                detection_data['decodedId']
                                [::
                                 -1]  # reversed, we want least significant bit last
                            ))

                    frame_index += 1

                    self.data_load_progress.setValue(frame_index -
                                                     config.FRAME_START)
                    self.app.processEvents()

                self.data_load_label.setText(
                    str(len(self.dset_store.store)) + ' frames loaded')
                self.app.processEvents()

                # break because we only load the first fname
                break

        except:

            pass

        self.block_inputs(False)
    def __init__(self):

        self.future_depth = 4
        self.dset_store = ds.DetectionSetStore()
        self.graph = ds.Graph(self.dset_store, future_depth=self.future_depth)
        self.path_manager = PathManager(self.dset_store)
    def __init__(self):

        self.dset_store = ds.DetectionSetStore()