create_mask runs without error (yay\!)
"IMG_SIZE = 128\n",
"\n",
"def reduce_expanded_mask(expanded_mask):\n",
- " return np.mean(np.mean(tf.reshape(expanded_mask, (128, 16, 128, 16)), axis=1), axis=2)"
+ " expanded_mask = tf.dtypes.cast(expanded_mask, tf.float32)\n",
+ " return tf.reduce_mean(tf.reduce_mean(tf.reshape(expanded_mask, (128, 16, 128, 16)), axis=1), axis=2)"
]
},
{
" circle_mask = get_circle_mask(bb_centre)\n",
" rect_mask = get_rect_mask(field_centre, field_rotation)\n",
" \n",
- " mask = np.concatenate([])\n",
+ " mask = tf.concat([circle_mask[:,:,None], rect_mask[:,:,None]], axis=2)\n",
" \n",
- " segmentation_mask = np.concatenate([background[:,:,None], rectangle_mask[:,:,None], within_bb[:,:,None]], axis=2)\n",
- " \n",
- " return segmentation_mask\n",
+ " return mask\n",
"\n",
"\n",
"train_dataset = get_dataset(train_keys, image_paths, labels)"
"outputs": [],
"source": []
},
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
{
"cell_type": "code",
"execution_count": null,
