def __init__(self, task_id, api: Api, v_model, project_meta: ProjectMeta):
     self._task_id = task_id
     self._api = api
     self._v_model = v_model
     self._project_meta = project_meta.clone()
     self._image_url = None
     self._ann = None
     self._options_initialized = False
     self.set_options()
示例#2
0
    def __init__(self,
                 task_id,
                 api: Api,
                 v_model,
                 project_meta: ProjectMeta,
                 col_number: int,
                 preview_info=False,
                 enable_zoom=False,
                 resize_on_zoom=False,
                 sync_views=False,
                 show_preview=True,
                 selectable=False,
                 opacity=0.5,
                 show_opacity_header=True,
                 fill_rectangle=False,
                 border_width=3):
        self._task_id = task_id
        self._api = api
        self._v_model = v_model
        self._project_meta = project_meta.clone()
        self._data = {}
        self.col_number = col_number
        self.preview_info = preview_info
        self._need_zoom = False
        self._with_title_url = False
        if not isinstance(self.col_number, int):
            raise ValueError("Columns number must be integer, not {}".format(
                type(self.col_number).__name__))

        self._options = {
            "enableZoom": enable_zoom,
            "syncViews": sync_views,
            "resizeOnZoom": resize_on_zoom,
            "showPreview": show_preview,
            "selectable": selectable,
            "opacity": opacity,
            "showOpacityInHeader": show_opacity_header,
            "fillRectangle": fill_rectangle,
            "borderWidth": border_width
        }
        self._options_initialized = False
示例#3
0
    def __init__(self, task_id, api: Api, v_model: str,
                 project_meta: ProjectMeta):
        self._task_id = task_id
        self._api = api
        self._v_model = v_model
        if self._v_model.startswith("data.") is False:
            new_v_model = v_model.replace('state.', 'data.', 1)
            raise KeyError(
                f"Data for this widget has to be stored in data field due to potential performance issues. "
                f"Please, change value of v_model argument "
                f"from {v_model} to {new_v_model} manually and also check html template"
            )

        self._project_meta = project_meta.clone()
        self._options = {
            "enableZoom": True,
            "syncViews": True,
            "showPreview": True,
            "selectable": True,
            "opacity": 0.5,
            "showOpacityInHeader": True,
            #"viewHeight": 450,
        }
        self._num_cols = 3

        self._gt_annotations = {}
        self._pred_annotations = {}
        self._order = []

        self._infos = {}
        self._min_time_index = None
        self._max_time_index = None
        self._active_time = None

        self._items_to_upload = {
            "gt": [],
            #"pred": {}
        }
    def __init__(self, task_id, api: Api, v_model, project_meta: ProjectMeta):
        self._task_id = task_id
        self._api = api
        self._v_model = v_model
        self._project_meta = project_meta.clone()

        self._left_title = None
        self._left_image_url = None
        self._left_ann = None

        self._right_title = None
        self._right_image_url = None
        self._right_ann = None

        self._options = {
            "enableZoom": True,
            "syncViews": True,
            "showPreview": False,
            "selectable": False,
            "opacity": 0.5,
            "showOpacityInHeader": True,
            # "viewHeight": 450,
        }
        self._options_initialized = False
 def update_project_meta(self, project_meta: ProjectMeta):
     self._project_meta = project_meta.clone()