# Path: fcn/utils.py
# def batch_to_vars(batch, device=-1):
# def bitget(byteval, idx):
# def labelcolormap(*args, **kwargs):
# def label_colormap(N=256):
# def visualize_labelcolormap(*args, **kwargs):
# def visualize_label_colormap(cmap):
# def get_label_colortable(n_labels, shape):
# def _fast_hist(label_true, label_pred, n_class):
# def label_accuracy_score(label_trues, label_preds, n_class):
# def centerize(src, dst_shape, margin_color=None):
# def _tile_images(imgs, tile_shape, concatenated_image):
# def get_tile_image(imgs, tile_shape=None, result_img=None, margin_color=None):
#     def resize(*args, **kwargs):
#     def get_tile_shape(img_num):
# def label2rgb(lbl, img=None, label_names=None, n_labels=None,
#               alpha=0.5, thresh_suppress=0):
#         def get_text_color(color):
# def visualize_segmentation(**kwargs):
#             Y, X = np.where(mask)


import os.path as osp
import numpy as np
import PIL.Image
import skimage.io
import skimage.transform
    import matplotlib.pyplot as plt
    import skimage.color
from fcn import utils
#!/usr/bin/env python





here = osp.dirname(osp.abspath(__file__))


def test_label_accuracy_score():
    img_file = osp.join(here, '../data/2007_000063.jpg')
    lbl_file = osp.join(here, '../data/2007_000063.png')

    img = skimage.io.imread(img_file)

    lbl_gt = np.array(PIL.Image.open(lbl_file), dtype=np.int32, copy=False)
    lbl_gt[lbl_gt == 255] = -1


# Path: fcn/utils.py
# def batch_to_vars(batch, device=-1):
# def bitget(byteval, idx):
# def labelcolormap(*args, **kwargs):
# def label_colormap(N=256):
# def visualize_labelcolormap(*args, **kwargs):
# def visualize_label_colormap(cmap):
# def get_label_colortable(n_labels, shape):
# def _fast_hist(label_true, label_pred, n_class):
# def label_accuracy_score(label_trues, label_preds, n_class):
# def centerize(src, dst_shape, margin_color=None):
# def _tile_images(imgs, tile_shape, concatenated_image):
# def get_tile_image(imgs, tile_shape=None, result_img=None, margin_color=None):
#     def resize(*args, **kwargs):
#     def get_tile_shape(img_num):
# def label2rgb(lbl, img=None, label_names=None, n_labels=None,
#               alpha=0.5, thresh_suppress=0):
#         def get_text_color(color):
# def visualize_segmentation(**kwargs):
#             Y, X = np.where(mask)


# Path: tests/utils_tests/test_label_accuracy_score.py
import os.path as osp
import numpy as np
import PIL.Image
import skimage.io
import skimage.transform
    import matplotlib.pyplot as plt
    import skimage.color
from fcn import utils

#!/usr/bin/env python





here = osp.dirname(osp.abspath(__file__))


def test_label_accuracy_score():
    img_file = osp.join(here, '../data/2007_000063.jpg')
    lbl_file = osp.join(here, '../data/2007_000063.png')

    img = skimage.io.imread(img_file)

    lbl_gt = np.array(PIL.Image.open(lbl_file), dtype=np.int32, copy=False)
    lbl_gt[lbl_gt == 255] = -1


    lbl_pred = lbl_gt.copy()