Exemple #1
0
    def __init__(self, name, param):
        dataprocess.C2dImageTask.__init__(self, name)

        # Create parameters class
        if param is None:
            self.setParam(PointRendParam())
        else:
            self.setParam(copy.deepcopy(param))

        self.threshold = 0.5
        self.MODEL_NAME_CONFIG = "pointrend_rcnn_R_50_FPN_3x_coco"
        self.MODEL_NAME = "model_final_3c3198"
        self.path_to_config = "/PointRend_git/configs/InstanceSegmentation/" + self.MODEL_NAME_CONFIG + ".yaml"
        self.path_to_model = "/models/" + self.MODEL_NAME + ".pkl"
        self.folder = os.path.dirname(os.path.realpath(__file__))
        self.cfg = get_cfg()
        add_pointrend_config(self.cfg)
        self.cfg.merge_from_file(self.folder + self.path_to_config)
        self.cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = self.threshold
        self.cfg.MODEL.WEIGHTS = self.folder + self.path_to_model
        self.loaded = False
        self.deviceFrom = ""

        # add output + set data type
        self.setOutputDataType(core.IODataType.IMAGE_LABEL, 0)
        self.addOutput(dataprocess.CImageIO(core.IODataType.IMAGE))
        self.addOutput(dataprocess.CGraphicsOutput())
    def __init__(self, name, param):
        dataprocess.C2dImageTask.__init__(self, name)
        if param is None:
            self.setParam(MaskRcnnParam())
        else:
            self.setParam(copy.deepcopy(param))

        # get and set config model
        self.threshold = 0.5
        self.cfg = None
        self.model_link = "COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x.yaml"
        self.predictor = None

        # add output + set data type
        self.setOutputDataType(core.IODataType.IMAGE_LABEL, 0)
        self.addOutput(dataprocess.CImageIO(core.IODataType.IMAGE))
        self.addOutput(dataprocess.CGraphicsOutput())
Exemple #3
0
    def __init__(self, name, param):
        dataprocess.C2dImageTask.__init__(self, name)
        self.model = None
        self.names = None
        self.colors = None
        self.update = False
        # Detect if we have a GPU available
        self.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
        # Add graphics output
        self.addOutput(dataprocess.CGraphicsOutput())
        # Add numeric output
        self.addOutput(dataprocess.CNumericIO())

        # Create parameters class
        if param is None:
            self.setParam(InferYoloV5Param())
        else:
            self.setParam(copy.deepcopy(param))
    def __init__(self, name, param):
        dataprocess.C2dImageTask.__init__(self, name)
        self.model = None
        self.class_names = []
        # Detect if we have a GPU available
        self.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
        # Remove graphics input
        self.removeInput(1)
        # Add graphics output
        self.addOutput(dataprocess.CGraphicsOutput())
        # Add numeric output
        self.addOutput(dataprocess.CNumericIO())

        # Create parameters class
        if param is None:
            self.setParam(MnasnetParam())
        else:
            self.setParam(copy.deepcopy(param))
    def __init__(self, name, param):
        dataprocess.C2dImageTask.__init__(self, name)
        if param is None:
            self.setParam(TridentnetParam())
        else:
            self.setParam(copy.deepcopy(param))

        # get and set config model
        self.folder = os.path.dirname(os.path.realpath(__file__))
        self.MODEL_NAME_CONFIG = "tridentnet_fast_R_101_C4_3x"
        self.MODEL_NAME = "model_final_164568"
        self.cfg = get_cfg()
        add_tridentnet_config(self.cfg)
        self.cfg.merge_from_file(self.folder + "/TridentNet_git/configs/" +
                                 self.MODEL_NAME_CONFIG + ".yaml")
        self.cfg.MODEL.WEIGHTS = self.folder + "/models/" + self.MODEL_NAME + ".pkl"
        self.loaded = False
        self.deviceFrom = ""

        # add output
        self.addOutput(dataprocess.CGraphicsOutput())
    def __init__(self, name, param):
        dataprocess.C2dImageTask.__init__(self, name)
        # Add graphics output
        self.addOutput(dataprocess.CGraphicsOutput())
        # Add numeric output
        self.addOutput(dataprocess.CNumericIO())

        # Network members
        self.net = None
        self.class_names = []

        # Create parameters class
        if param is None:
            self.setParam(EmotionFerPlusParam())
        else:
            self.setParam(copy.deepcopy(param))

        # Load class names
        model_folder = os.path.dirname(os.path.realpath(__file__)) + "/models"
        with open(model_folder + "/class_names") as f:
            for row in f:
                self.class_names.append(row[:-1])
    def __init__(self, name, param):
        dataprocess.C2dImageTask.__init__(self, name)
        self.model = None
        self.class_names = []
        # Detect if we have a GPU available
        self.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
        # Remove graphics input
        self.removeInput(1)
        # Segmentation mask output
        self.setOutputDataType(core.IODataType.IMAGE_LABEL, 0)
        # Result image
        self.addOutput(dataprocess.CImageIO(core.IODataType.IMAGE))
        # Add graphics output
        self.addOutput(dataprocess.CGraphicsOutput())
        # Add numeric output
        self.addOutput(dataprocess.CNumericIO())

        # Create parameters class
        if param is None:
            self.setParam(MaskRcnnParam())
        else:
            self.setParam(copy.deepcopy(param))
Exemple #8
0
    def __init__(self, name, param):
        dataprocess.C2dImageTask.__init__(self, name)

        # Add input/output of the process here
        self.setOutputDataType(core.IODataType.IMAGE_LABEL, 0)
        self.addOutput(dataprocess.CImageIO(core.IODataType.IMAGE))
        # Add graphics output
        self.addOutput(dataprocess.CGraphicsOutput())
        self.net = None
        self.class_names = []

        # Create parameters class
        if param is None:
            self.setParam(InferYolactParam())
        else:
            self.setParam(copy.deepcopy(param))

        # Load class names
        model_folder = os.path.dirname(os.path.realpath(__file__)) + "/models"
        with open(model_folder + "/Coco_names.txt") as f:
            for row in f:
                self.class_names.append(row[:-1])
    def __init__(self, name, param):
        dataprocess.C2dImageTask.__init__(self, name)

        # Create parameters class
        if param is None:
            self.setParam(RetinanetParam())
        else:
            self.setParam(copy.deepcopy(param))

        # get and set config model
        self.LINK_MODEL = "COCO-Detection/retinanet_R_101_FPN_3x.yaml"
        self.threshold = 0.5
        self.cfg = get_cfg()
        self.cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = self.threshold
        self.cfg.merge_from_file(model_zoo.get_config_file(
            self.LINK_MODEL))  # load config from file(.yaml)
        self.cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url(
            self.LINK_MODEL)  # download the model (.pkl)
        self.loaded = False
        self.deviceFrom = ""

        # add output
        self.addOutput(dataprocess.CGraphicsOutput())
    def __init__(self, name, param):
        dataprocess.C2dImageTask.__init__(self, name)

        # Create parameters class
        if param is None:
            self.setParam(DensePoseParam())
        else:
            self.setParam(copy.deepcopy(param))
        
        # get and set config model
        self.folder = os.path.dirname(os.path.realpath(__file__)) 
        self.MODEL_NAME_CONFIG = "densepose_rcnn_R_50_FPN_s1x"
        self.MODEL_NAME = "model_final_162be9"

        self.cfg = get_cfg()
        add_densepose_config(self.cfg)
        self.cfg.merge_from_file(self.folder + "/DensePose_git/configs/"+self.MODEL_NAME_CONFIG+".yaml") # load densepose_rcnn_R_101_FPN_d config from file(.yaml)
        self.cfg.MODEL.WEIGHTS = self.folder + "/models/"+self.MODEL_NAME+".pkl"   # load densepose_rcnn_R_101_FPN_d config from file(.pkl)
        self.loaded = False
        self.deviceFrom = ""
        
        # add output graph
        self.addOutput(dataprocess.CGraphicsOutput())
    def __init__(self, name, param):
        dataprocess.C2dImageTask.__init__(self, name)
        # Add graphics output
        self.addOutput(dataprocess.CGraphicsOutput())
        # Add numeric output
        self.addOutput(dataprocess.CNumericIO())

        # Create parameters class
        if param is None:
            self.setParam(CovidNetParam())
        else:
            self.setParam(copy.deepcopy(param))

        param = self.getParam()
        self.covid_model = CovidNet(model_path=param.model_path)

        # Load class names
        self.class_names = []
        class_names_path = os.path.dirname(os.path.realpath(__file__)) + "/models/class_names"

        with open(class_names_path) as f:
            for row in f:
                self.class_names.append(row[:-1])
    def __init__(self, name, param):
        dataprocess.C2dImageTask.__init__(self, name)
        if param is None:
            self.setParam(KeyptsRcnnParam())
        else:
            self.setParam(copy.deepcopy(param))

        # get and set config model
        self.LINK_MODEL = "COCO-Keypoints/keypoint_rcnn_X_101_32x8d_FPN_3x.yaml"
        self.cfg = get_cfg()
        self.threshold = 0.5
        self.cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = self.threshold
        self.cfg.merge_from_file(model_zoo.get_config_file(
            self.LINK_MODEL))  # load config from file(.yaml)
        self.cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url(
            self.LINK_MODEL)  # download the model (.pkl)
        self.loaded = False
        self.deviceFrom = ""

        # add output
        self.addOutput(dataprocess.CGraphicsOutput())

        # keypoint threshold
        self._KEYPOINT_THRESHOLD = 0.05