Replies: 2 comments 5 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Just made 2 checkins:
ds, steps = data.prepare_dataset('/datasets/faces_casia_112x112_folders/', random_status=100, random_cutout_mask_area=0.5, batch_size=64)
data.show_batch_sample(ds) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hello ~
I modified your code a little to randomly generate the mask.
Is there any problem with this code in your view?
#=====================================================
if random_cutout_mask_area > 0:
print(">>>> random_cutout_mask_area provided:", random_cutout_mask_area)
mask_height = img_shape[0] * 2 // 5
mask_func = lambda images, labels: (
tf.cond(
tf.random.uniform(()) < random_cutout_mask_area,
lambda: tf.concat([images[:68, :], tf.zeros_like(images[68:, :]) + 128], axis=0),
# lambda: tf.concat([images[:, :-mask_height], tf.zeros_like(images[:, -mask_height:]) + 128], axis=1),
lambda: images,
),
labels,
)
ds = ds.map(mask_func, num_parallel_calls=AUTOTUNE)
#=====================================================

-> result
And another strange thing happens to me.

In the upgraded version of "Tensorflow 2.8,
Loss is normally reduced as before, but this area of accuracy improves accuracy very slowly.
My tensorflow Version : 2.6
Beta Was this translation helpful? Give feedback.
All reactions