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

Add "Get Bounding Box" node #1884

Merged
merged 8 commits into from
Jun 23, 2023
Merged

Conversation

zeptofine
Copy link
Contributor

@zeptofine zeptofine commented Jun 22, 2023

This essentially does the same thing as the 'crop content' node but instead returns the dimensions needed to do such an operation.
box
The threshold represents the minimum value a pixel must be to be considered part of the mask.
This example uses the data to simply crop the original image, like 'crop content': simple-preview
Having these as separate node operations give access to more complex node setups, like this version:
full-preview
This crops the image, superscales the specific section then moves it back into place.

Edit: changed the complex example to use the mask as transparency.

@zeptofine zeptofine changed the title add "Get Bounding Box" node Add "Get Bounding Box" node Jun 22, 2023
This reverts part of commit 0e3ab2a.
Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

Good idea for a node!

- changed the minimum and default to 0, and explicitly set a maximum
- renamed the function
- added output_types to the outputs
The output type for width and height is also more explicit.
if there are no rows in the threshold, then there can't be any columns.
Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

I finally tested it, and it works well. Thank you @zeptofine!

@joeyballentine joeyballentine merged commit c975719 into chaiNNer-org:main Jun 23, 2023
10 checks passed
@zeptofine zeptofine deleted the bbox-node branch June 23, 2023 23:39
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