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

Added more transforms to benchmark #5

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Added more transforms to benchmark #5

merged 1 commit into from
Oct 28, 2024

Conversation

ternaus
Copy link
Contributor

@ternaus ternaus commented Oct 28, 2024

Summary by Sourcery

Add new transforms to the benchmark suite, including Clahe, CoarseDropout, Blur, Brightness, and Contrast. Improve the formatting of transform specifications and enhance the benchmark runner for better error handling and logging. Update documentation with new performance results.

New Features:

  • Add support for new transforms: Clahe, CoarseDropout, Blur, Brightness, and Contrast in the benchmark suite.

Enhancements:

  • Improve the formatting and readability of the transform specifications in the codebase.
  • Enhance the benchmark runner to handle new transforms and improve error handling and logging.

Documentation:

  • Update README.md to include new performance comparison results and additional transforms.

Copy link

sourcery-ai bot commented Oct 28, 2024

Reviewer's Guide by Sourcery

This pull request adds more image transforms to the benchmark suite and includes code formatting improvements. The changes focus on expanding the test coverage by implementing additional transforms in the imgaug and torchvision libraries, while also improving code quality through consistent formatting and style.

Class diagram for TransformSpec modifications

classDiagram
    class TransformSpec {
        +String name
        +dict[str, Any] params
        +String __str__()
    }
    note for TransformSpec "Base class that defines exact parameters for each transform"
    class TransformSpecList {
        +TransformSpec[] TRANSFORM_SPECS
    }
    note for TransformSpecList "List of all transform specifications based on the original implementations"
Loading

Class diagram for TorchvisionImpl modifications

classDiagram
    class TorchvisionImpl {
        +static Transform HorizontalFlip(dict[str, Any] params)
        +static Transform VerticalFlip(dict[str, Any] params)
        +static Transform Rotate(dict[str, Any] params)
        +static Transform Affine(dict[str, Any] params)
        +static Transform Equalize(dict[str, Any] params)
        +static Transform RandomCrop80(dict[str, Any] params)
        +static Transform RandomResizedCrop(dict[str, Any] params)
        +static Transform Resize(dict[str, Any] params)
        +static Transform ColorJitter(dict[str, Any] params)
        +static Transform RandomPerspective(dict[str, Any] params)
        +static Transform GaussianBlur(dict[str, Any] params)
        +static Transform Posterize(dict[str, Any] params)
        +static Transform Elastic(dict[str, Any] params)
        +static Transform Normalize(dict[str, Any] params)
        +static Transform Brightness(dict[str, Any] params)
        +static Transform Contrast(dict[str, Any] params)
        +static Transform JpegCompression(dict[str, Any] params)
    }
    note for TorchvisionImpl "Torchvision implementations of transforms"
Loading

File-Level Changes

Change Details Files
Added new transform implementations to imgaug and torchvision libraries
  • Added Clahe transform implementation to imgaug
  • Added CoarseDropout transform implementation to imgaug
  • Added Blur transform implementation to imgaug
  • Added Brightness and Contrast transforms to torchvision
  • Updated benchmark results to include new transforms
benchmark/transforms/imgaug_impl.py
benchmark/transforms/torchvision_impl.py
output/imgaug_results.json
output/torchvision_results.json
Applied code formatting and style improvements across the codebase
  • Standardized import ordering
  • Fixed line length issues
  • Added trailing commas to function parameters
  • Improved type hints and docstrings
  • Applied consistent indentation
benchmark/runner.py
benchmark/transforms/specs.py
benchmark/transforms/albumentations_impl.py
benchmark/transforms/kornia_impl.py
benchmark/transforms/augly_impl.py
benchmark/utils.py
Enhanced results presentation and documentation
  • Updated README.md with new benchmark results
  • Added comparison.md for detailed results
  • Modified run_all.sh to generate markdown output
  • Updated performance comparison table with new transforms
README.md
output/comparison.md
run_all.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a 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

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

benchmark/runner.py Show resolved Hide resolved
@ternaus ternaus merged commit b38632e into main Oct 28, 2024
1 check passed
@ternaus ternaus deleted the add_to_torchvision branch October 28, 2024 23:09
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.

1 participant