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

predict() support for segmentation models and more #1708

Merged
merged 31 commits into from
Dec 20, 2023

Conversation

BloodAxe
Copy link
Collaborator

@BloodAxe BloodAxe commented Dec 15, 2023

Here we go again with predict() support for segmentation models.
What have I done on top of former PR:

  • Deprecated SegToTensor in favor of SegConvertToTensor. Old class disallow it's creation and raise an error to leave no options other than migrate. The SegToTensor was doing /255 and HWC->CHW which could cause many unwanted issues since /255 was performed only when input is byte dtype. There are many cases when image dtype can change unintentionally. Moreover, SegToTensor had to be applied first and only after SegNormalize. And it was breaking preprocessing in predict().
  • Introduce SegStandardize
  • Add missing default preprocessing params for other segmentation models
  • Improves visualization of segmentation mask when the task is binary segmentation
  • Implement missing methods across the segmentation transforms
  • All recipes updated to use SegConvertToTensor
  • SegmentationSample will convert PIL image under the hood to np.ndarray and Segmentaiton transforms will not return PIL image anymore

dafna-r and others added 18 commits August 10, 2023 17:21
Co-authored-by: Eugene Khvedchenya <ekhvedchenya@gmail.com>
remove predict from ppliteseg models (PPLiteSegBase) as it's implement in SegmentationModule
…tion_signed' into features/SG-000-predict_segmentation_signed
# Conflicts:
#	src/super_gradients/training/datasets/segmentation_datasets/segmentation_dataset.py
#	src/super_gradients/training/processing/processing.py
#	src/super_gradients/training/transforms/utils.py
#	tests/unit_tests/test_predict.py
@BloodAxe BloodAxe marked this pull request as ready for review December 15, 2023 20:51
Copy link
Collaborator

@ofrimasad ofrimasad 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!
a few minor comments.
Does this support long video (like the new implementation in object detection)?

@BloodAxe
Copy link
Collaborator Author

Very nice! a few minor comments. Does this support long video (like the new implementation in object detection)?

Yes, the way video prediction is implemented is actually pretty nice since all the tasks support long video processing automatically.

Copy link
Contributor

@Louis-Dupont Louis-Dupont left a comment

Choose a reason for hiding this comment

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

Minor notes

Copy link
Contributor

@Louis-Dupont Louis-Dupont left a comment

Choose a reason for hiding this comment

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

LGTM

@BloodAxe BloodAxe merged commit c4bbce7 into master Dec 20, 2023
6 of 7 checks passed
@BloodAxe BloodAxe deleted the features/SG-000-predict_segmentation_signed branch December 20, 2023 17:02
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

5 participants