-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DeepLab example #1534
base: master
Are you sure you want to change the base?
Add DeepLab example #1534
Conversation
Adding Ian as reviewer and Jon for visibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good to me -- thanks for turning this into an example!
Just a few mostly minor comments
""" | ||
Title: Semantic segmentation using DeepLabV3+ | ||
Author: [Alexia Audevart](https://github.com/aaudevart) | ||
Date created: 2023/13/04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to be September 13? (13/09)?
Either way -- YYYY/MM/DD format is the standard here so let's use that.
|
||
"""shell | ||
!pip install keras-core --upgrade | ||
!pip uninstall -y keras-cv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should need this uninstall for the example
Detect hardware, return appropriate distribution strategy | ||
""" | ||
|
||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the example, I think we can exclude this bit and forego a strategy altogether. TF will just default to using the GPU in this case so we don't need to worry about distribution
train_gen = tf.data.Dataset.from_generator( | ||
generator=gen_pairs(train_img_list), | ||
output_signature=( | ||
tf.TensorSpec(shape=(IMG_WIDTH, IMG_HEIGHT, 3), dtype=tf.uint8), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not critical here, since images are square, but this should be IMG_HEIGHT, IMG_WIDTH (order reversed)
val_gen = tf.data.Dataset.from_generator( | ||
generator=gen_pairs(val_img_list), | ||
output_signature=( | ||
tf.TensorSpec(shape=(IMG_WIDTH, IMG_HEIGHT, 3), dtype=tf.uint8), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Same here re: height,width)
Adam as the optimizer. | ||
""" | ||
|
||
EPOCHS = 16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For examples, we often try to keep the number of epochs low -- how long does this take to train?
If it's possible to get decent results with fewer epochs we should do that.
Add a new example using DeepLabV3+ pretrained model for semantic segmentation in healthcare
Google colab : https://colab.research.google.com/drive/17UQr7-UM_Et0A7g7638Gq7Vb-e1171kC?usp=sharing