-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 random shadow intensity #2124
Conversation
Reviewer's Guide by SourceryThis PR fixes the shadow intensity calculation in the RandomShadow augmentation by inverting the intensity value to properly darken the image. It also improves documentation by clarifying the relationship between shadow intensity values and shadow darkness. Sequence diagram for add_shadow functionsequenceDiagram
participant img as Image
participant vertices_list as VerticesList
participant intensities as Intensities
participant mask as Mask
participant img_shadowed as ImageShadowed
img->>add_shadow: Call function
add_shadow->>mask: Calculate shadowed_indices
add_shadow->>add_shadow: Calculate darkness = 1 - shadow_intensity
add_shadow->>img_shadowed: Apply darkness to shadowed_indices
img_shadowed-->>img: Return modified image
Updated class diagram for RandomShadowclassDiagram
class RandomShadow {
- num_shadows_limit: tuple[int, int] = (1, 2)
- shadow_dimension: int = 5
- shadow_intensity_range: tuple[float, float] = (0.5, 0.5)
- p: float = 0.5
}
note for RandomShadow "shadow_intensity_range description updated to clarify its effect on shadow darkness."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @ternaus - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2124 +/- ##
=========================================
+ Coverage 0 90.25% +90.25%
=========================================
Files 0 47 +47
Lines 0 7749 +7749
=========================================
+ Hits 0 6994 +6994
- Misses 0 755 +755 ☔ View full report in Codecov by Sentry. |
Fixes: #2070
Summary by Sourcery
Bug Fixes: