@ -331,8 +331,8 @@ def _load_images_ssd_callback(resized_shape: Sequence[int]) \
|
|||||||
"""
|
"""
|
||||||
_images = tf.map_fn(lambda path: tf.read_file(path), paths)
|
_images = tf.map_fn(lambda path: tf.read_file(path), paths)
|
||||||
|
|
||||||
def _get_images(image_data: tf.Tensor,
|
def _get_images(data: tf.Tensor) -> Tuple[tf.Tensor, Sequence[int]]:
|
||||||
_labels: Sequence[int]) -> Tuple[tf.Tensor, Sequence[int]]:
|
image_data, _labels = data
|
||||||
image = tf.image.decode_image(image_data, channels=3, dtype=tf.float32)
|
image = tf.image.decode_image(image_data, channels=3, dtype=tf.float32)
|
||||||
image_shape = tf.shape(image)
|
image_shape = tf.shape(image)
|
||||||
_labels[:, 5] = tf.cast(image_shape[0], dtype=tf.float32) / resized_shape[0]
|
_labels[:, 5] = tf.cast(image_shape[0], dtype=tf.float32) / resized_shape[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user