Skip to content
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

Unit 3 : Vision Transformers / Transfer Learning & Fine-Tuning Chapter Content #204

Merged
merged 38 commits into from
Mar 13, 2024

Conversation

shreydan
Copy link
Contributor

@shreydan shreydan commented Feb 7, 2024

hello, this PR adds the following chapter content for Unit 3: Vision Transformers : Transfer Learning and Fine-Tuning

Contributions:

@asusevski

  • added KnowledgeDistillation.mdx
  • Changes to KnowledgeDistillation.ipynb: took a large part of the intro and moved it into the MDX so that the MDX for the chapter is a better introduction to the topic and the notebook is more succinctly focused on the example with code.

@hanouticelina

  • added Vision Transformers for Image Segmentation.mdx

@shreydan

  • added Vision Transformers for Image Classification.mdx

@sezan92

  • changes to Fine-tuning Vision Transformers for Object detection.ipynb: included an additional section on transfer learning.

@Anindyadeep

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator

@merveenoyan merveenoyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! mostly left nits. it'd be great for upcoming PRs to be atomic since it's hard to review multiple pages coming from different contributors repetitively iterating on them


![Multiple Choice Question](https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/multiple-choice-question.png)

If you had someone just tell you "the answer is Dracoy Malfoy", that doesn't teach you a whole lot about each of the characters' relative relationships with Harry Potter.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the original is correct

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's "Draco Malfoy", the typo is in the first name :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo fixed, my bad

predicted_panoptic_map = result["segmentation"]
```

## Applying Transfer learning/Finetuning to ViT-based segmentation models
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Applying Transfer learning/Finetuning to ViT-based segmentation models
## Fine-tuning Vision Transformer-based Segmentation Models

With many pretrained segmentation models available, transfer learning or finetuning are used to adapt these models to specific use cases, especially since ViT-based segmentation models, like MaskFormer, are data-hungry and challenging to train from scratch.
these techniques leverages pre-trained representations to adapt these models efficiently to new tasks. Typically for MaskFormer, the backbone, the pixel decoder and the transformer decoder are kept frozen to leverage their learned general features, while the transformer module is finetuned to adapt its class prediction and mask generation capabilities to new segmentation tasks.

This notebook will walk you through a transfer learning tutorial on image segmentation using MaskFormer:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This notebook will walk you through a transfer learning tutorial on image segmentation using MaskFormer:
[This notebook](https://colab.research.google.com/github/johko/computer-vision-course/blob/main/notebooks/Unit%203%20-%20Vision%20Transformers/transfer-learning-segmentation.ipynb) will walk you through a transfer learning tutorial on image segmentation using MaskFormer.


This notebook will walk you through a transfer learning tutorial on image segmentation using MaskFormer:

<a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the HTML link


## References

1. [MaskFormer Hugging Face documentation](https://huggingface.co/docs/transformers/en/model_doc/maskformer)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. [MaskFormer Hugging Face documentation](https://huggingface.co/docs/transformers/en/model_doc/maskformer)
- [MaskFormer Hugging Face documentation](https://huggingface.co/docs/transformers/en/model_doc/maskformer)

## References

1. [MaskFormer Hugging Face documentation](https://huggingface.co/docs/transformers/en/model_doc/maskformer)
2. [Image Segmentation Hugging Face Task Guide](https://huggingface.co/docs/transformers/en/tasks/semantic_segmentation)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. [Image Segmentation Hugging Face Task Guide](https://huggingface.co/docs/transformers/en/tasks/semantic_segmentation)
- [Image Segmentation Hugging Face Task Guide](https://huggingface.co/docs/transformers/en/tasks/semantic_segmentation)


![Multiple Choice Question](https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/multiple-choice-question.png)

If you had someone just tell you "the answer is Dracoy Malfoy", that doesn't teach you a whole lot about each of the characters' relative relationships with Harry Potter.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the original is correct

@asusevski
Copy link
Contributor

Thanks a lot! mostly left nits. it'd be great for upcoming PRs to be atomic since it's hard to review multiple pages coming from different contributors repetitively iterating on them

Very sorry about that @merveenoyan !! We were just concerned about timelines, that we wouldn't get all of our individual changes merged in time. We realize this must have been super annoying to go through!

@shreydan shreydan requested a review from merveenoyan February 12, 2024 13:44
Copy link

Looks good to me 👍🏽 (granted noted grammatical correction occur)

@Anindyadeep
Copy link
Contributor

Hi I am adding the reference for PR #218 where I added the mdx file for fine-tuning for object detection.

@merveenoyan
Copy link
Collaborator

@shreydan @asusevski I think the table of contents is not up to date, can you merge the main of this repository into your branch? then we can merge

@shreydan
Copy link
Contributor Author

shreydan commented Mar 1, 2024

@merveenoyan merged and update table of contents! Thank you!

@merveenoyan
Copy link
Collaborator

@asusevski can you approve so we can merge? I'll fix CI afterwards, the previously merged PR broke that

Copy link
Contributor

@asusevski asusevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved!

@merveenoyan
Copy link
Collaborator

merveenoyan commented Mar 7, 2024

@asusevski @shreydan I fixed a bunch of LaTex errors and more, once they're merged, you can merge the main branch into this one and we can merge this one
OR if you don't want to wait, feel free to incorporate following changes:
8b410ff
8b410ff
bd5673b
63cabaa

@merveenoyan
Copy link
Collaborator

@asusevski I fixed bunch of grammar errors and made the CI green, if you can approve we can merge

Copy link
Collaborator

@merveenoyan merveenoyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix link

Copy link
Contributor

@asusevski asusevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved

@merveenoyan
Copy link
Collaborator

@asusevski had to solve merge conflict, sorry, can you approve again?

Copy link
Contributor

@asusevski asusevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@merveenoyan 🫡🫡🫡 approved right away

@ATaylorAerospace ATaylorAerospace self-requested a review March 13, 2024 00:47
Copy link
Collaborator

@ATaylorAerospace ATaylorAerospace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

@ATaylorAerospace ATaylorAerospace merged commit 1fb2b05 into johko:main Mar 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants