LemurPwned / video-sampler

Effective frame sampling for ML applications.
https://lemurpwned.github.io/video-sampler/
MIT License
16 stars 5 forks source link

updating the formatting #34

Closed LemurPwned closed 2 days ago

LemurPwned commented 2 days ago

Summary by Sourcery

Enhance the video sampler by adding a method to format output paths with options for encoding time and including filenames. Update the GitHub Actions workflow to automate release creation by extracting the version from the project configuration. Improve the README formatting for clarity.

Enhancements:

CI:

Documentation:

sourcery-ai[bot] commented 2 days ago

Reviewer's Guide by Sourcery

This pull request updates the GitHub Actions workflow to create releases automatically, modifies the frame saving format in the video sampler, and adds new configuration options for the save format. The changes improve the CI/CD pipeline and enhance the flexibility of the video sampling process.

Architecture diagram for updated GitHub Actions workflow

graph TD;
    A[GitHub Actions] -->|Trigger on PR merge or workflow dispatch| B[Build Job];
    B -->|Outputs version| C[Release Job];
    C -->|Create release with version| D[GitHub Repository];

Updated class diagram for SamplerConfig and SaveFormatConfig

classDiagram
    class SamplerConfig {
        dict summary_config
        int n_workers
        SaveFormatConfig save_format
    }
    class SaveFormatConfig {
        bool encode_time
        bool include_filename
    }
    SamplerConfig --> SaveFormatConfig

File-Level Changes

Change Details Files
Update GitHub Actions workflow to create releases automatically
  • Add a step to get the release version from pyproject.toml
  • Create a new 'release' job that depends on the 'build' job
  • Use GitHub CLI to create a new release with generated release notes
.github/workflows/build.yml
Modify frame saving format in the video sampler
  • Add a new method 'format_output_path' to handle custom frame naming
  • Implement options to encode frame time and include filename in the output
  • Update the 'queue_reader' method to use the new formatting function
video_sampler/sampler.py
Add new configuration options for save format
  • Create a new 'SaveFormatConfig' class with 'encode_time' and 'include_filename' options
  • Add 'save_format' field to the 'SamplerConfig' class
  • Update the hash_base.yaml configuration file with new save format options
video_sampler/config.py
configs/hash_base.yaml
Minor README update
  • Add asterisks to the 'Supported env' section
README.md

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](https://app.sourcery.ai) 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 - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).