Skip to content

Commit

Permalink
Fix README
Browse files Browse the repository at this point in the history
  • Loading branch information
bhky committed Jun 22, 2024
1 parent 2b06380 commit dfbdd7e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,12 @@ affine_transform = TFCombineAffine(

# Apply transformations.
auto_tune = tf.data.AUTOTUNE
ds = ds
.map(TFRandomCrop(probability=0.5), num_parallel_calls=auto_tune)
.map(affine_transform, num_parallel_calls=auto_tune)
.map(TFResize((256, 256)), num_parallel_calls=auto_tune)
ds = (
ds
.map(TFRandomCrop(probability=0.5), num_parallel_calls=auto_tune)
.map(affine_transform, num_parallel_calls=auto_tune)
.map(TFResize((256, 256)), num_parallel_calls=auto_tune)
)

# In the Dataset `map` call, the parameter `num_parallel_calls` can be set to,
# e.g., tf.data.AUTOTUNE, for better performance. See docs for TensorFlow Dataset.
Expand Down Expand Up @@ -340,11 +342,13 @@ from targetran.utils import image_only
```
```python
# TensorFlow.
ds = ds \
.map(image_only(TFRandomCrop())) \
.map(image_only(affine_transform)) \
.map(image_only(TFResize((256, 256)))) \
ds = (
ds
.map(image_only(TFRandomCrop()))
.map(image_only(affine_transform))
.map(image_only(TFResize((256, 256))))
.batch(32) # Conventional batching can be used for classification setup.
)
```
```python
# PyTorch.
Expand Down

0 comments on commit dfbdd7e

Please sign in to comment.