test_quantizer.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:image-quantizer 作者: se7entyse7en 项目源码 文件源码
def test_compare(self):
        q = quantizer.ImageQuantizer()

        qimages = q.quantize_multi([
            {'n_colors': 8, 'method': 'random'},
            {'n_colors': 16, 'method': 'random'},
            {'n_colors': 8, 'method': 'kmeans'},
            {'n_colors': 16, 'method': 'kmeans'},
            {'n_colors': 8, 'method': 'random+lab'},
            {'n_colors': 16, 'method': 'random+lab'},
            {'n_colors': 8, 'method': 'kmeans+lab'},
            {'n_colors': 16, 'method': 'kmeans+lab'},
        ], image_filename=self._get_image_path('Lenna.png'))

        with mock.patch('image_quantizer.quantizer.plt.show', lambda: None):
            quantizer.compare(*qimages)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号