JanMarcelKezmann / TensorFlow-Advanced-Segmentation-Models

A Python Library for High-Level Semantic Segmentation Models based on TensorFlow and Keras with pretrained backbones.
Other
151 stars 46 forks source link

Information about input #4

Closed aniketbote closed 3 years ago

aniketbote commented 3 years ago

Can you provide information on how xtrain, y_train should be. There shapes/dimensions etc. It would be better if you added any end to end trainable example using any publicly available dataset. _tensorflowdatasets has many such datasets which you can use easily.

Thank you in advance

JanMarcelKezmann commented 3 years ago

Hi, so first of all you can take a look at the examples section here, there I currently have 3 examples using the publicly available dataset CamVid. Next to that I will upload the next couple of days a new example using the caltech_birds2010 dataset from _tensorflowdatasets , so you can take a look how you can use data saved in the _tf.record__ format for segmenation.

But to be more general you can take any publicly available or custom dataset and use the functionalities of Data Generators to define yourself a generator that can be used for fitting any of the given models. In that case the generator needs to yield an array, i.e. a tf.tensor, that has the dimensions [BATCH_SIZE, HEIGHT, WIDTH, CHANNELS], where CHANNELS is in the case of the images either 1 or 3 depending on black/white or colored images and in the case of labels the number of classes you would like to segment including the background class, i.e. len(CLASSES) + 1.

But I think that this is especially well documented in the examples that's why I really recommed to take a look at them. I hope that helps, if not just feel free to ask more questions.

JanMarcelKezmann commented 3 years ago

I have now added an example using the caltech_birds2010 dataset from _tensorflowdatasets.

You can take a look here.