示例#1
0
    def __init__(self, param, parent):
        core.CWorkflowTaskWidget.__init__(self, parent)

        if param is None:
            self.parameters = DatasetWgisdParam()
        else:
            self.parameters = param

        # Create layout : QGridLayout by default
        self.grid_layout = QGridLayout()

        self.browse_folder = pyqtutils.append_browse_file(
            grid_layout=self.grid_layout,
            label="Dataset folder",
            path=self.parameters.data_folder_path,
            mode=QFileDialog.Directory)

        self.browse_class_file = pyqtutils.append_browse_file(
            grid_layout=self.grid_layout,
            label="Classes file",
            path=self.parameters.class_file_path,
            mode=QFileDialog.ExistingFile)

        self.combo_seg_mask_mode = pyqtutils.append_combo(
            grid_layout=self.grid_layout, label="Segmentation masks")
        self.combo_seg_mask_mode.addItem("None")
        self.combo_seg_mask_mode.addItem("Instance")
        self.combo_seg_mask_mode.addItem("Panoptic")
        self.combo_seg_mask_mode.setCurrentText(self.parameters.seg_mask_mode)

        # PyQt -> Qt wrapping
        layout_ptr = qtconversion.PyQtToQt(self.grid_layout)

        # Set widget layout
        self.setLayout(layout_ptr)
    def __init__(self, param, parent):
        core.CWorkflowTaskWidget.__init__(self, parent)

        if param is None:
            self.parameters = DatasetYoloParam()
        else:
            self.parameters = param

        # Create layout : QGridLayout by default
        self.grid_layout = QGridLayout()

        self.browse_folder = pyqtutils.append_browse_file(
            grid_layout=self.grid_layout,
            label="YOLO dataset folder",
            path=self.parameters.data_folder_path,
            mode=QFileDialog.Directory)

        self.browse_class_file = pyqtutils.append_browse_file(
            grid_layout=self.grid_layout,
            label="YOLO classes file",
            path=self.parameters.class_file_path,
            mode=QFileDialog.ExistingFile)

        # PyQt -> Qt wrapping
        layout_ptr = qtconversion.PyQtToQt(self.grid_layout)

        # Set widget layout
        self.setLayout(layout_ptr)
    def __init__(self, param, parent):
        core.CWorkflowTaskWidget.__init__(self, parent)

        if param is None:
            self.parameters = DatasetCocoParam()
        else:
            self.parameters = param

        # Create layout : QGridLayout by default
        self.grid_layout = QGridLayout()

        self.browse_json = pyqtutils.append_browse_file(
            self.grid_layout,
            label="COCO json file",
            path=self.parameters.json_path,
            filter="*.json")

        self.browse_img_folder = pyqtutils.append_browse_file(
            self.grid_layout,
            label="Image folder",
            filter="",
            path=self.parameters.image_folder,
            mode=QFileDialog.Directory)

        # PyQt -> Qt wrapping
        layout_ptr = qtconversion.PyQtToQt(self.grid_layout)

        # Set widget layout
        self.setLayout(layout_ptr)
示例#4
0
    def __init__(self, param, parent):
        core.CWorkflowTaskWidget.__init__(self, parent)

        if param is None:
            self.parameters = DatasetPascalVocParam()
        else:
            self.parameters = param

        # Create layout : QGridLayout by default
        self.grid_layout = QGridLayout()

        self.browse_ann_folder = pyqtutils.append_browse_file(grid_layout=self.grid_layout, label="Annotation folder",
                                                              path=self.parameters.annotation_folder_path,
                                                              mode=QFileDialog.Directory)

        self.browse_img_folder = pyqtutils.append_browse_file(grid_layout=self.grid_layout, label="Image folder",
                                                              path=self.parameters.image_folder_path,
                                                              mode=QFileDialog.Directory)

        self.browse_instance_seg_folder = pyqtutils.append_browse_file(grid_layout=self.grid_layout,
                                                                       label="Instance segmentation folder",
                                                                       path=self.parameters.instance_seg_folder_path,
                                                                       mode=QFileDialog.Directory)

        self.browse_class_file = pyqtutils.append_browse_file(grid_layout=self.grid_layout, label="Classes file",
                                                              path=self.parameters.class_path,
                                                              mode=QFileDialog.ExistingFile)

        # PyQt -> Qt wrapping
        layout_ptr = qtconversion.PyQtToQt(self.grid_layout)

        # Set widget layout
        self.setLayout(layout_ptr)
    def __init__(self, param, parent):
        core.CWorkflowTaskWidget.__init__(self, parent)

        if param is None:
            self.parameters = ResnetParam()
        else:
            self.parameters = param

        # Create layout : QGridLayout by default
        self.grid_layout = QGridLayout()

        self.combo_model = pyqtutils.append_combo(self.grid_layout,
                                                  "Model name")
        self.combo_model.addItem("resnet18")
        self.combo_model.addItem("resnet34")
        self.combo_model.addItem("resnet50")
        self.combo_model.addItem("resnet101")
        self.combo_model.addItem("resnet152")
        self.combo_model.setCurrentIndex(self._get_model_name_index())

        self.combo_dataset = pyqtutils.append_combo(self.grid_layout,
                                                    "Trained on")
        self.combo_dataset.addItem("ImageNet")
        self.combo_dataset.addItem("Custom")
        self.combo_dataset.setCurrentIndex(self._get_dataset_index())
        self.combo_dataset.currentIndexChanged.connect(
            self.on_combo_dataset_changed)

        self.spin_size = pyqtutils.append_spin(
            self.grid_layout,
            label="Input size",
            value=self.parameters.input_size)

        self.browse_model = pyqtutils.append_browse_file(
            self.grid_layout, "Model path", self.parameters.model_path)

        self.browse_classes = pyqtutils.append_browse_file(
            self.grid_layout, "Classes path", self.parameters.classes_path)

        if self.parameters.dataset == "ImageNet":
            self.browse_model.set_path("Not used")
            self.browse_model.setEnabled(False)
            self.browse_classes.setEnabled(False)

        # PyQt -> Qt wrapping
        layout_ptr = qtconversion.PyQtToQt(self.grid_layout)

        # Set widget layout
        self.setLayout(layout_ptr)
    def __init__(self, param, parent):
        core.CWorkflowTaskWidget.__init__(self, parent)

        if param is None:
            self.parameters = TrainFasterRcnnParam()
        else:
            self.parameters = param

        # Create layout : QGridLayout by default
        self.grid_layout = QGridLayout()
        self.spin_workers = pyqtutils.append_spin(
            self.grid_layout,
            label="Data loader workers",
            value=self.parameters.cfg["num_workers"],
            min=0,
            max=8,
            step=2)

        self.spin_batch = pyqtutils.append_spin(
            self.grid_layout,
            label="Batch size",
            value=self.parameters.cfg["batch_size"],
            min=1,
            max=1024,
            step=1)

        self.spin_epoch = pyqtutils.append_spin(
            self.grid_layout,
            label="Epochs",
            value=self.parameters.cfg["epochs"],
            min=1)

        self.spin_size = pyqtutils.append_spin(
            self.grid_layout,
            label="Input size",
            value=self.parameters.cfg["input_size"])

        label_model_format = QLabel("Model format")
        row = self.grid_layout.rowCount()
        self.grid_layout.addWidget(label_model_format, row, 0)
        self.check_pth = QCheckBox("pth")
        self.check_pth.setChecked(self.parameters.cfg["export_pth"])
        self.grid_layout.addWidget(self.check_pth, row, 1)
        self.check_onnx = QCheckBox("onnx")
        self.check_onnx.setChecked(self.parameters.cfg["export_onnx"])
        self.grid_layout.addWidget(self.check_onnx, row + 1, 1)

        self.browse_folder = pyqtutils.append_browse_file(
            self.grid_layout,
            label="Output folder",
            path=self.parameters.cfg["output_folder"],
            tooltip="Select output folder",
            mode=QFileDialog.Directory)

        # PyQt -> Qt wrapping
        layout_ptr = qtconversion.PyQtToQt(self.grid_layout)

        # Set widget layout
        self.setLayout(layout_ptr)
    def __init__(self, param, parent):
        core.CWorkflowTaskWidget.__init__(self, parent)

        if param is None:
            self.parameters = TrainResnetParam()
        else:
            self.parameters = param

        # Create layout : QGridLayout by default
        self.grid_layout = QGridLayout()
        self.combo_model = pyqtutils.append_combo(self.grid_layout, "Model name")
        self.combo_model.addItem("resnet18")
        self.combo_model.addItem("resnet34")
        self.combo_model.addItem("resnet50")
        self.combo_model.addItem("resnet101")
        self.combo_model.addItem("resnet152")

        self.spin_workers = pyqtutils.append_spin(self.grid_layout, label="Data loader workers",
                                              value=self.parameters.cfg["num_workers"], min=0, max=8, step=2)

        self.spin_batch = pyqtutils.append_spin(self.grid_layout, label="Batch size",
                                            value=self.parameters.cfg["batch_size"], min=1, max=1024, step=1)

        self.spin_epoch = pyqtutils.append_spin(self.grid_layout, label="Epochs", value=self.parameters.cfg["epochs"], min=1)

        self.spin_classes = pyqtutils.append_spin(self.grid_layout, label="Classes", value=self.parameters.cfg["classes"], min=1)

        self.spin_size = pyqtutils.append_spin(self.grid_layout, label="Input size", value=self.parameters.cfg["input_size"])

        self.check_pretrained = pyqtutils.append_check(self.grid_layout, label="Pre-trained model",
                                                   checked=self.parameters.cfg["use_pretrained"])

        self.check_features = pyqtutils.append_check(self.grid_layout, label="Feature Extract mode",
                                                 checked=self.parameters.cfg["feature_extract"])

        label_model_format = QLabel("Model format")
        row = self.grid_layout.rowCount()
        self.grid_layout.addWidget(label_model_format, row, 0)
        self.check_pth = QCheckBox("pth")
        self.check_pth.setChecked(self.parameters.cfg["export_pth"])
        self.grid_layout.addWidget(self.check_pth, row, 1)
        self.check_onnx = QCheckBox("onnx")
        self.check_onnx.setChecked(self.parameters.cfg["export_onnx"])
        self.grid_layout.addWidget(self.check_onnx, row+1, 1)

        self.browse_folder = pyqtutils.append_browse_file(self.grid_layout, label="Output folder",
                                                      path=self.parameters.cfg["output_folder"],
                                                      tooltip="Select output folder",
                                                      mode=QFileDialog.Directory)

        # PyQt -> Qt wrapping
        layout_ptr = qtconversion.PyQtToQt(self.grid_layout)

        # Set widget layout
        self.setLayout(layout_ptr)
示例#8
0
    def __init__(self, param, parent):
        core.CWorkflowTaskWidget.__init__(self, parent)

        if param is None:
            self.parameters = MaskRcnnParam()
        else:
            self.parameters = param

        # Create layout : QGridLayout by default
        self.grid_layout = QGridLayout()

        self.combo_dataset = pyqtutils.append_combo(self.grid_layout,
                                                    "Trained on")
        self.combo_dataset.addItem("Coco2017")
        self.combo_dataset.addItem("Custom")
        self.combo_dataset.setCurrentIndex(self._get_dataset_index())
        self.combo_dataset.currentIndexChanged.connect(
            self.on_combo_dataset_changed)

        self.browse_model = pyqtutils.append_browse_file(
            self.grid_layout, "Model path", self.parameters.model_path)

        self.browse_classes = pyqtutils.append_browse_file(
            self.grid_layout, "Classes path", self.parameters.classes_path)

        self.spin_confidence = pyqtutils.append_double_spin(
            self.grid_layout, "Confidence", self.parameters.confidence, 0.0,
            1.0, 0.1, 2)
        self.spin_mask_thresh = pyqtutils.append_double_spin(
            self.grid_layout, "Mask threshold", self.parameters.mask_threshold,
            0.0, 1.0, 0.1, 2)

        if self.parameters.dataset == "Coco2017":
            self.browse_model.set_path("Not used")
            self.browse_model.setEnabled(False)
            self.browse_classes.setEnabled(False)

        # PyQt -> Qt wrapping
        layout_ptr = qtconversion.PyQtToQt(self.grid_layout)

        # Set widget layout
        self.setLayout(layout_ptr)
示例#9
0
    def __init__(self, param, parent):
        core.CWorkflowTaskWidget.__init__(self, parent)

        if param is None:
            self.parameters = DatasetViaParam()
        else:
            self.parameters = param

        # Create layout : QGridLayout by default
        self.grid_layout = QGridLayout()

        self.browse_json = pyqtutils.append_browse_file(
            self.grid_layout,
            label="VIA json file",
            path=self.parameters.via_json_path,
            filter="*.json")

        # PyQt -> Qt wrapping
        layout_ptr = qtconversion.PyQtToQt(self.grid_layout)

        # Set widget layout
        self.setLayout(layout_ptr)