本文整理汇总了Python中object_detection.core.preprocessor._rgb_to_grayscale方法的典型用法代码示例。如果您正苦于以下问题:Python preprocessor._rgb_to_grayscale方法的具体用法?Python preprocessor._rgb_to_grayscale怎么用?Python preprocessor._rgb_to_grayscale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object_detection.core.preprocessor
的用法示例。
在下文中一共展示了preprocessor._rgb_to_grayscale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testRgbToGrayscale
# 需要导入模块: from object_detection.core import preprocessor [as 别名]
# 或者: from object_detection.core.preprocessor import _rgb_to_grayscale [as 别名]
def testRgbToGrayscale(self):
images = self.createTestImages()
grayscale_images = preprocessor._rgb_to_grayscale(images)
expected_images = tf.image.rgb_to_grayscale(images)
with self.test_session() as sess:
(grayscale_images, expected_images) = sess.run(
[grayscale_images, expected_images])
self.assertAllEqual(expected_images, grayscale_images)
示例2: testRgbToGrayscale
# 需要导入模块: from object_detection.core import preprocessor [as 别名]
# 或者: from object_detection.core.preprocessor import _rgb_to_grayscale [as 别名]
def testRgbToGrayscale(self):
def graph_fn():
images = self.createTestImages()
grayscale_images = preprocessor._rgb_to_grayscale(images)
expected_images = tf.image.rgb_to_grayscale(images)
return grayscale_images, expected_images
(grayscale_images, expected_images) = self.execute_cpu(graph_fn, [])
self.assertAllEqual(expected_images, grayscale_images)