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

Fix and simplify semantic-segmentation example #30145

Merged
merged 9 commits into from Apr 10, 2024

Conversation

qubvel
Copy link
Member

@qubvel qubvel commented Apr 9, 2024

What does this PR do?

It seems like the semantic-segmentation example is a bit outdated and doesn't run without fixing some issues. This PR does the following to improve the current state of the example:

  1. Added instructions for accessing the sidewalk dataset to the semantic-segmentation example's README.md
  2. Fixed missing dependencies required to run the semantic-segmentation example (accelerate, Pillow)
  3. Fixed failing image transforms; replaced implemented transforms with those from albumentations
  4. It was also observed that the "mean_iou" metric computation takes a lot of time and can be optimized. To improve this, I created a PR in the Evaluate project (Speeding up mean_iou metric computation evaluate#569). As soon as the fix is merged, the time to perform training will be reduced by half.

Updated scripts have been evaluated and the fine-tuned model achieved similar metrics to the previous one:

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@amyeroberts @NielsRogge

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Very nice! Thanks for working on this and improving our examples!

@amyeroberts amyeroberts merged commit 56d001b into huggingface:main Apr 10, 2024
8 checks passed
ArthurZucker pushed a commit that referenced this pull request Apr 22, 2024
* Remove unused augmentation

* Fix pad_if_smaller() and remove unused augmentation

* Add indentation

* Fix requirements

* Update dataset use instructions

* Replace transforms with albumentations

* Replace identity transform with None

* Fixing formatting

* Fixed comment place
itazap pushed a commit that referenced this pull request May 14, 2024
* Remove unused augmentation

* Fix pad_if_smaller() and remove unused augmentation

* Add indentation

* Fix requirements

* Update dataset use instructions

* Replace transforms with albumentations

* Replace identity transform with None

* Fixing formatting

* Fixed comment place
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants