MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / get_color

Method get_color

detrsmpl/data/data_structures/smc_reader.py:773–817  ·  view source on GitHub ↗

Get RGB image(s) from Kinect RGB or iPhone RGB camera. Args: device (str): Device name, should be Kinect or iPhone. device_id (int): Device ID, starts from 0. frame_id (int, list or None, optional): int: fra

(self,
                  device,
                  device_id,
                  frame_id=None,
                  disable_tqdm=True,
                  vertical=True)

Source from the content-addressed store, hash-verified

771 vertical=vertical)
772
773 def get_color(self,
774 device,
775 device_id,
776 frame_id=None,
777 disable_tqdm=True,
778 vertical=True):
779 """Get RGB image(s) from Kinect RGB or iPhone RGB camera.
780
781 Args:
782 device (str):
783 Device name, should be Kinect or iPhone.
784 device_id (int):
785 Device ID, starts from 0.
786 frame_id (int, list or None, optional):
787 int: frame id of one selected frame
788 list: a list of frame id
789 None: all frames will be returned
790 Defaults to None.
791 disable_tqdm (bool, optional):
792 Whether to disable the entire progressbar wrapper.
793 Defaults to True.
794 vertical (bool, optional):
795 Only applicable to iPhone as device
796 iPhone assumes horizontal orientation
797 if True, convert data to vertical orientation
798 Defaults to True.
799
800 Returns:
801 img (ndarray):
802 An ndarray in shape [frame_number, height, width, channels].
803 """
804
805 assert device in {
806 'Kinect', 'iPhone'
807 }, f'Undefined device: {device}, should be "Kinect" or "iPhone"'
808
809 if device == 'Kinect':
810 img = self.get_kinect_color(device_id, frame_id, disable_tqdm)
811 else:
812 img = self.get_iphone_color(device_id,
813 frame_id,
814 disable_tqdm,
815 vertical=vertical)
816
817 return img
818
819 def get_keypoints_num_frames(self):
820 return self.keypoints_num_frames

Callers 1

__call__Method · 0.95

Calls 2

get_kinect_colorMethod · 0.95
get_iphone_colorMethod · 0.95

Tested by

no test coverage detected