def serialize(self): data = ControlBase.serialize(self) if self.value: capture = self.value _, image = capture.read() if isinstance(image, np.ndarray): image = self.processFrame(image) if isinstance(image, list) or isinstance(image, tuple): image = tools.groupImage(image, True) if len(image.shape) > 2: image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) image = Image.fromarray(image) buff = StringIO.StringIO() image.save(buff, format="PNG") content = buff.getvalue() buff.close() data.update({'base64content': base64.b64encode(content)}) data.update({'value': self._filename}) data.update({'filename': self._filename}) data.update({'startFrame': self.startFrame}) data.update({'endFrame': self.endFrame}) data.update({'video_index': self.video_index}) return data
def serialize(self): data = ControlBase.serialize(self) data.update({ 'legend': self.legend, 'value': self._value }) return data
def serialize(self): data = ControlBase.serialize(self) if self.value: capture = self.value _, image = capture.read() if isinstance(image, np.ndarray): image = self.processFrame(image) if isinstance(image, list) or isinstance(image, tuple): image = tools.groupImage(image, True) if len(image.shape)>2: image = cv2.cvtColor(image,cv2.COLOR_BGR2RGB) image = Image.fromarray(image) buff = StringIO.StringIO() image.save(buff, format="PNG") content = buff.getvalue() buff.close() data.update({ 'base64content': base64.b64encode(content) }) data.update({ 'value': self._filename }) data.update({ 'filename': self._filename }) data.update({ 'startFrame': self.startFrame }) data.update({ 'endFrame': self.endFrame }) data.update({ 'video_index': self.video_index }) return data
def serialize(self): data = ControlBase.serialize(self) items = [] for key, value in self._items.items(): items.append({'label': str(key), 'value': str(value)}) data.update({ 'items': items, 'value': str(self._value) }) return data
def serialize(self): data = ControlBase.serialize(self) data.update({ 'horizontal_headers': self.horizontalHeaders, 'read_only': 1 if self._read_only else 0, 'selected_index': self._selected_index, 'select_entire_row': 1 if self._selectEntireRow else 0, }) return data
def serialize(self): data = ControlBase.serialize(self) image = self.value if isinstance(image, np.ndarray): if len(image.shape)>2: image = cv2.cvtColor(image,cv2.COLOR_BGR2RGB) image = Image.fromarray(image) buff = StringIO.StringIO() image.save(buff, format="PNG") content = buff.getvalue() buff.close() data.update({ 'base64content': base64.b64encode(content) }) data.update({ 'filename': self._filename }) return data
def serialize(self): data = ControlBase.serialize(self) image = self.value if isinstance(image, np.ndarray): if len(image.shape) > 2: image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) image = Image.fromarray(image) buff = StringIO.StringIO() image.save(buff, format="PNG") content = buff.getvalue() buff.close() data.update({'base64content': base64.b64encode(content)}) data.update({'filename': self._filename}) return data
def serialize(self): data = ControlBase.serialize(self) data.update({'css': self.css}) return data
def serialize(self): data = ControlBase.serialize(self) data.update({'max': self.max, 'min': self.min}) return data
def serialize(self): data = ControlBase.serialize(self) data.update({ 'css': self.css }) return data
def serialize(self): data = ControlBase.serialize(self) data.update({ 'max': self.max, 'min': self.min }) return data