INNER CODE UNIT · Python

__bool__

allenai/ai2thor · ai2thor/server.py:343

    def __bool__(self):
        return bool(self._active_event)

    @property
    def cv2img(self):
        return self._active_event.cv2img

    def add_third_party_camera_image(self, third_party_image_data):
        self.third_party_camera_frames.append(
            read_buffer_image(third_party_image_data, self.screen_width, self.screen_height)
        )


def read_buffer_image(
    buf, width, height, flip_y=True, flip_x=False, dtype=np.uint8, flip_rb_colors=False
):
    im_bytes = np.frombuffer(buf, dtype=dtype)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…