예제 #1
0
파일: __init__.py 프로젝트: zawecha1/pylib
def sit(img, path=None, name=""):
    if path is None:
        _count = get_count()
        path = '~/temp/no-use/images/%s_%d_%s.jpg' % (log.get_date_str(),
                                                      _count, name)

    if type(img) == list:
        plt.show_images(images=img,
                        path=path,
                        show=False,
                        axis_off=True,
                        save=True)
    else:
        plt.imwrite(path, img)

    return path
예제 #2
0
                def sit(img=None, format='rgb', path=None, name=""):
                    if path is None:
                        path = get_temp_path(name)
                    if img is None:
                        plt.save_image(path)
                        return path

                    if format == 'bgr':
                        img = _img.bgr2rgb(img)
                    if type(img) == list:
                        plt.show_images(images=img,
                                        path=path,
                                        show=False,
                                        axis_off=True,
                                        save=True)
                    else:
                        plt.imwrite(path, img)

                    return path
예제 #3
0
def sit(img=None, name=''):

    path = get_temp_path(name)

    if img is None:
        plt.save_image(path)
        return path

    img = _img.bgr2rgb(img)
    if type(img) == list:
        print "hehe"
        plt.show_images(images=img,
                        path=path,
                        show=False,
                        axis_off=True,
                        save=True)
    else:
        plt.imwrite(path, img)
    return path