INNER CODE UNIT · Python

item_size

allenai/ai2thor · ai2thor/server.py:65

        item_size = int(len(image_ids_data) / (screen_width * screen_height))
        self._unique_integer_keys: Optional[Set[np.uint32]] = None
        self._empty_mask: Optional[np.ndarray] = None

        if item_size == 4:
            self.instance_segmentation_frame_uint32 = read_buffer_image(
                image_ids_data, screen_width, screen_height, dtype=np.uint32
            ).squeeze()
            # within ImageSynthesis.cs a RGBA32 frame is read, the alpha channel
            # is always equal to 255
            self._alpha_channel_value = 255

        elif item_size == 3:  # 3 byte per pixel for backwards compatibility, RGB24 texture
            # this is more expensive than the 4 byte variant since copying is required
            frame = read_buffer_image(image_ids_data, screen_width, screen_height)
            self.instance_segmentation_frame_uint32 = np.concatenate(
                (
                    frame,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…