Ejemplo n.º 1
0
    def internal_update( self ):
        self.load_network()

        from mmdet.datasets.custom import CustomDataset

        signal.signal( signal.SIGINT, lambda signal, frame: self.interupt_handler() )

        train_dataset = CustomDataset(
            self._training_store,
            self._cfg.train_pipeline )

        if self._validate:
            validation_dataset = CustomDataset(
                self._validation_store,
                self._cfg.test_pipeline )
            self._cfg.data.val = validation_dataset
            self._cfg.data.val.type = "CustomDataset"

        from mmdet.apis import train_detector

        train_detector(
            self._model,
            train_dataset,
            self._cfg,
            distributed = self._distributed,
            validate = self._validate )
Ejemplo n.º 2
0
    def update_model(self):

        with open(self._groundtruth_store, 'wb') as fp:
            pickle.dump(self._training_data, fp)

        from mmdet.datasets.custom import CustomDataset

        train_dataset = CustomDataset(
            self._groundtruth_store,
            '.',
            self._cfg.data.train.img_scale,
            self._cfg.data.train.img_norm_cfg,
            size_divisor=self._cfg.data.train.size_divisor,
            flip_ratio=self._cfg.data.train.flip_ratio,
            with_mask=self._cfg.data.train.with_mask,
            with_crowd=self._cfg.data.train.with_crowd,
            with_label=self._cfg.data.train.with_label)

        from mmdet.apis import train_detector

        train_detector(self._model,
                       train_dataset,
                       self._cfg,
                       distributed=self._distributed,
                       validate=self._validate,
                       logger=self._logger)
Ejemplo n.º 3
0
    def internal_update(self):
        self.load_network()

        with open(self._groundtruth_store, 'wb') as fp:
            pickle.dump(self._training_data, fp)

        from mmdet.datasets.custom import CustomDataset

        signal.signal(signal.SIGINT,
                      lambda signal, frame: self.interupt_handler())

        train_dataset = CustomDataset(
            self._groundtruth_store,
            '.',
            self._cfg.data.train.img_scale,
            self._cfg.data.train.img_norm_cfg,
            size_divisor=self._cfg.data.train.size_divisor,
            flip_ratio=self._cfg.data.train.flip_ratio,
            with_mask=self._cfg.data.train.with_mask,
            with_crowd=self._cfg.data.train.with_crowd,
            with_label=self._cfg.data.train.with_label)

        from mmdet.apis import train_detector

        self.save_model_files(is_final=False)

        train_detector(self._model,
                       train_dataset,
                       self._cfg,
                       distributed=self._distributed,
                       validate=self._validate,
                       logger=self._logger)

        self.save_model_files(is_final=True)
Ejemplo n.º 4
0
    def internal_update(self):
        self.load_network()

        with open(self._groundtruth_store, 'wb') as fp:
            pickle.dump(self._training_data, fp)

        from mmdet.datasets.custom import CustomDataset

        signal.signal(signal.SIGINT,
                      lambda signal, frame: self.interupt_handler())

        train_dataset = CustomDataset(self._groundtruth_store,
                                      self._cfg.train_pipeline)

        from mmdet.apis import train_detector

        self.save_model_files(is_final=False)

        train_detector(self._model,
                       train_dataset,
                       self._cfg,
                       distributed=self._distributed,
                       validate=self._validate,
                       logger=self._logger)

        self.save_model_files(is_final=True)