![](/img/trans.png)
[英]Image becomes blue masked after applying tf.image.crop_to_bounding_box and tf.image.encode_jpeg
[英]tf.image.pad_to_bounding_box VS tf.pad and tf.image.crop_to_bounding_box VS tf.slice
我想了解为什么存在两个函数tf.image.crop_to_bounding_box
和tf.image.pad_to_bounding_box
,因为这两个函数的行为实际上可以分别通过tf.slice
和tf.pad
来完成。
它们并不是那么容易理解,并且它们的范围很窄,因为它们仅接受3D和4D张量。 此外,它们往往在执行时间方面较慢。
我有什么想念的吗?
通常,您使用它们tf.image.*
为了易于使用。
crop_to_bounding_box
和pad_to_bounding_box
都在下面使用了slice
和pad
,但是还添加了检查和约束,以确保您无需花费数小时来尝试调试slice / pad的索引和偏移量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.