# Path: pycoral/adapters/common.py
# def output_tensor(interpreter, i):
# def input_details(interpreter, key):
# def input_size(interpreter):
# def input_tensor(interpreter):
# def set_input(interpreter, data):
# def set_resized_input(interpreter, size, resize):
# 
# Path: pycoral/adapters/segment.py
# def get_output(interpreter):
# 
# Path: pycoral/utils/edgetpu.py
# _EDGETPU_SHARED_LIB = {
#   'Linux': 'libedgetpu.so.1',
#   'Darwin': 'libedgetpu.1.dylib',
#   'Windows': 'edgetpu.dll'
# }[platform.system()]
# def load_edgetpu_delegate(options=None):
# def make_interpreter(model_path_or_content, device=None, delegate=None):
# def _is_valid_ctypes_input(input_data):
# def _gst_buffer_map(buffer):
# def _check_input_size(input_size, expected_input_size):
# def run_inference(interpreter, input_data):
# class _GstMapInfo(ctypes.Structure):
# 
# Path: tests/test_utils.py
# _TEST_DATA_DIR = ''
#   _TEST_DATA_DIR = args.test_data_dir
# def get_test_tmpdir():
# def test_data_path(path, *paths):
# def test_image(path, *paths):
# def temporary_file(suffix=None):
# def generate_random_input(seed, n):
# def prepare_images(image_list, directory, shape):
# def area(box):
# def iou(box_a, box_b):
# def prepare_data_set_from_directory(path, test_ratio, fixed_order):
# def coral_test_main():


import numpy as np
import unittest
from PIL import Image
from pycoral.adapters import common
from pycoral.adapters import segment
from pycoral.utils import edgetpu
from tests import test_utils
            segment_image(
                deeplab_model_dm10(tpu), self.delegate, 'bird_segmentation.bmp',
                'bird_segmentation_mask.bmp'), 0.90)

  def test_deeplab_dm05(self):
    for tpu in [False, True]:
      with self.subTest(tpu=tpu):
        self.assertGreater(
            segment_image(
                deeplab_model_dm05(tpu), self.delegate, 'bird_segmentation.bmp',
                'bird_segmentation_mask.bmp'), 0.90)

  def test_keras_post_training_unet_mv2_128(self):
    for tpu in [False, True]:
      with self.subTest(tpu=tpu):
        self.assertGreater(
            segment_image(
                keras_post_training_unet_mv2(tpu, 128), self.delegate,
                'dog_segmentation.bmp', 'dog_segmentation_mask.bmp'), 0.86)

  def test_keras_post_training_unet_mv2_256(self):
    for tpu in [False, True]:
      with self.subTest(tpu=tpu):
        self.assertGreater(
            segment_image(
                keras_post_training_unet_mv2(tpu, 256), self.delegate,
                'dog_segmentation_256.bmp', 'dog_segmentation_mask_256.bmp'),
            0.81)



# Path: pycoral/adapters/common.py
# def output_tensor(interpreter, i):
# def input_details(interpreter, key):
# def input_size(interpreter):
# def input_tensor(interpreter):
# def set_input(interpreter, data):
# def set_resized_input(interpreter, size, resize):
# 
# Path: pycoral/adapters/segment.py
# def get_output(interpreter):
# 
# Path: pycoral/utils/edgetpu.py
# _EDGETPU_SHARED_LIB = {
#   'Linux': 'libedgetpu.so.1',
#   'Darwin': 'libedgetpu.1.dylib',
#   'Windows': 'edgetpu.dll'
# }[platform.system()]
# def load_edgetpu_delegate(options=None):
# def make_interpreter(model_path_or_content, device=None, delegate=None):
# def _is_valid_ctypes_input(input_data):
# def _gst_buffer_map(buffer):
# def _check_input_size(input_size, expected_input_size):
# def run_inference(interpreter, input_data):
# class _GstMapInfo(ctypes.Structure):
# 
# Path: tests/test_utils.py
# _TEST_DATA_DIR = ''
#   _TEST_DATA_DIR = args.test_data_dir
# def get_test_tmpdir():
# def test_data_path(path, *paths):
# def test_image(path, *paths):
# def temporary_file(suffix=None):
# def generate_random_input(seed, n):
# def prepare_images(image_list, directory, shape):
# def area(box):
# def iou(box_a, box_b):
# def prepare_data_set_from_directory(path, test_ratio, fixed_order):
# def coral_test_main():


# Path: tests/segment_test.py
import numpy as np
import unittest
from PIL import Image
from pycoral.adapters import common
from pycoral.adapters import segment
from pycoral.utils import edgetpu
from tests import test_utils

            segment_image(
                deeplab_model_dm10(tpu), self.delegate, 'bird_segmentation.bmp',
                'bird_segmentation_mask.bmp'), 0.90)

  def test_deeplab_dm05(self):
    for tpu in [False, True]:
      with self.subTest(tpu=tpu):
        self.assertGreater(
            segment_image(
                deeplab_model_dm05(tpu), self.delegate, 'bird_segmentation.bmp',
                'bird_segmentation_mask.bmp'), 0.90)

  def test_keras_post_training_unet_mv2_128(self):
    for tpu in [False, True]:
      with self.subTest(tpu=tpu):
        self.assertGreater(
            segment_image(
                keras_post_training_unet_mv2(tpu, 128), self.delegate,
                'dog_segmentation.bmp', 'dog_segmentation_mask.bmp'), 0.86)

  def test_keras_post_training_unet_mv2_256(self):
    for tpu in [False, True]:
      with self.subTest(tpu=tpu):
        self.assertGreater(
            segment_image(
                keras_post_training_unet_mv2(tpu, 256), self.delegate,
                'dog_segmentation_256.bmp', 'dog_segmentation_mask_256.bmp'),
            0.81)



if __name__ == '__main__':