# 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
    lbl_gt[lbl_gt == 255] = -1

    lbl_pred = lbl_gt.copy()
    lbl_pred[lbl_pred == -1] = 0
    lbl_pred = skimage.transform.rescale(
        lbl_pred,
        1 / 16.,
        order=0,
        mode='constant',
        preserve_range=True,
        anti_aliasing=False,
        multichannel=True,
    )
    lbl_pred = skimage.transform.resize(
        lbl_pred,
        lbl_gt.shape,
        order=0,
        mode='constant',
        preserve_range=True,
        anti_aliasing=False,
    )
    lbl_pred = lbl_pred.astype(lbl_gt.dtype)

    acc, acc_cls, mean_iu, fwavacc = utils.label_accuracy_score(
        [lbl_gt], [lbl_gt], n_class=21)
    assert acc == 1
    assert acc_cls == 1
    assert mean_iu == 1
    assert fwavacc == 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

    lbl_gt[lbl_gt == 255] = -1

    lbl_pred = lbl_gt.copy()
    lbl_pred[lbl_pred == -1] = 0
    lbl_pred = skimage.transform.rescale(
        lbl_pred,
        1 / 16.,
        order=0,
        mode='constant',
        preserve_range=True,
        anti_aliasing=False,
        multichannel=True,
    )
    lbl_pred = skimage.transform.resize(
        lbl_pred,
        lbl_gt.shape,
        order=0,
        mode='constant',
        preserve_range=True,
        anti_aliasing=False,
    )
    lbl_pred = lbl_pred.astype(lbl_gt.dtype)

    acc, acc_cls, mean_iu, fwavacc = utils.label_accuracy_score(
        [lbl_gt], [lbl_gt], n_class=21)
    assert acc == 1
    assert acc_cls == 1
    assert mean_iu == 1
    assert fwavacc == 1


    acc, acc_cls, mean_iu, fwavacc = utils.label_accuracy_score(