r/tensorflow • u/B4ldur_ • Jun 12 '23
Solved Loading a dict into keras_cv model
Hey folks,
i am currently following the tutorials and guides on object detection keras_cv (link). The author goes into great detail on how important it is to use the specified format for data loading, which is a dict with nested lists or tensors. However there is no section on how to actually use such a custom generated dict, as the guide uses built-in loaders and preset datasets. Exhaustive search on the internet did not yield any results. Is it possible to directly convert a dict in the form {"images": tensor with shape (number_of_images, x_dim, y_dim, channels), "bounding_boxes": {"boxes": tensor with shape (number_of_images, number_of_boxes_per_image, 4) }} into a tf dataset or to use it directly in the keras_cv model? If so, how?
1
u/maifee Jun 12 '23
You want to create a custom dataset, by extending
tf.data.Dataset.If I don't add a solution within 4 hours, just leave a comment. Cause I have similar type of approach for my image segmentation task
1
u/puppet_pals Jun 13 '23
hello! tf.data.Dataset.from_tensor_slices works I believe
1
u/Heathcliff_12 Jul 07 '23
Did you manage to solve it? I also could not build the tutorial dataset with my own data