Skip to content

Commit

Permalink
[FIX](handlers) Use map instead of apply for tf.data.Dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
wbenbihi committed Aug 25, 2022
1 parent 23a8a89 commit 421d578
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hourglass_tensorflow/handlers/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ def _create_dataset(self, data: HTFDataTypes) -> tf.data.Dataset:
tf.data.Dataset.from_tensor_slices(
self._extract_columns_from_data(data=data)
)
.apply(
.map(
# Load Images
tf_train_map_build_slice
)
.apply(
.map(
# Compute BBOX cropping
lambda img, coord, vis: tf_train_map_squarify(
img,
Expand All @@ -245,13 +245,13 @@ def _create_dataset(self, data: HTFDataTypes) -> tf.data.Dataset:
bbox_factor=self.config.bbox.factor,
)
)
.apply(
.map(
# Resize Image
lambda img, coord, vis: tf_train_map_resize_data(
img, coord, vis, input_size=int(self.config.image_size)
)
)
.apply(
.map(
# Get Heatmaps
lambda img, coord, vis: tf_train_map_heatmaps(
img,
Expand All @@ -261,15 +261,15 @@ def _create_dataset(self, data: HTFDataTypes) -> tf.data.Dataset:
stddev=self.config.heatmap.stddev,
)
)
.apply(
.map(
# Normalize Data
lambda img, hms: tf_train_map_normalize(
img,
hms,
normalization=self.config.normalization,
)
)
.apply(
.map(
# Stacks
lambda img, hms: tf_train_map_stacks(
img,
Expand Down

0 comments on commit 421d578

Please sign in to comment.