-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Add: TensorFlow example for semantic segmentation task guide #21223
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: TensorFlow example for semantic segmentation task guide #21223
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
amyeroberts
left a comment
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.
Nice - LGTM! Thanks for adding ❤️
|
|
||
| >>> def transforms(image): | ||
| ... image = tf.keras.utils.img_to_array(image) | ||
| ... image = tf.transpose(image, (2, 0, 1)) |
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.
Just as a note (not a request for a change), you can also this in the image processor with:
image_processor(images, labels, data_format="channels_first")
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.
Thanks, @amyeroberts ! I didn't know I could do this.
stevhliu
left a comment
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.
Whoo, great job! Thanks for the addition 🔥
Co-authored-by: Steven Liu <[email protected]>
Co-authored-by: Steven Liu <[email protected]>
sgugger
left a comment
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.
Thanks for adding this!
| Pass your `compute_metrics` function to [KerasMetricCallback](./main_classes/keras_callbacks#transformers.KerasMetricCallback), | ||
| and use the [PushToHubCallback](./main_classes/keras_callbacks#transformers.PushToHubCallback) to upload the model: |
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.
Small nit, but linking to the doc with [`KerasMetricCallback`] and [`PushToHubCallback`] would make the links more resilient (in case we move those pages in the future).
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.
Thank you, fixed :)
This PR adds a TensorFlow example to the existing Semantic Segmentation task guide using the same dataset and fine-tuning steps.
This example supplements the existing guide and can be helpful to those who choose TensorFlow over PyTorch and would like to use Transformers for semantic segmentation.