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

Create component for image tiling #269

Open
romeokienzler opened this issue May 31, 2024 · 4 comments
Open

Create component for image tiling #269

romeokienzler opened this issue May 31, 2024 · 4 comments
Assignees

Comments

@romeokienzler
Copy link
Member

Is your feature request related to a problem? Please describe.
The image tiling problem is part of nearly every computer vision pipeline. This component should read arbitrary image formats and create the desired tiles (also using sliding and tumbling windows and with configurable stride size
In case of geospatial image formats like geotiff/cog the tile's metadata should be kept / adjusted in the tiles. E.g. coordinates

@romeokienzler
Copy link
Member Author

@weingartlorenz and Max (max, please post your GH id here, so that I can add you) . I've merged #268 - thanks a lot for that, here are some comments (or tasks) which would improve this component:

  • Rename it accordingly, it is not called clipping anymoer
  • move from input to transform folder as the operation is a transformation
  • you can cast tile size and stride to integer already while reading, C3 will pick up the type from there and adjust the generated yaml files:
    tile_size_y = int(os.environ.get("tile_size_y"))
  • the user should be able to pass a search pattern over a path only, that way a line like:
    if item == ".DS_Store":
    becomes obsolete. I recommend using the glob.glob function, so the user can specify smthl like: /path/**/*.tiff
  • it is good practice if you select 'clear all outputs' on the notebook before pushing, so the notebook looks cleaner
  • you cloud use python logging like done in https://github.com/claimed-framework/component-library/blob/main/component-library/util/util-cos.ipynb

@creatermaker
Copy link

Hello Romeo,

Thank you for your feedback, we have improved our component and created a new pull request. All your requests for changes should be dealt with now.

Best wishes
@weingartlorenz and @creatermaker (Max)

@romeokienzler
Copy link
Member Author

romeokienzler commented Jun 13, 2024

Thanks @creatermaker I've merged, the following things are missing if you wanna have a look

  • Rename it accordingly, it is not called clipping anymore

  • move from input to transform folder as the operation is a transformation

  • you can cast tile size and stride to integer already while reading, C3 will pick up the type from there and adjust the generated yaml files:
    tile_size_y = int(os.environ.get("tile_size_y"))

  • the user should be able to pass a search pattern over a path only, that way a line like:

    if item == ".DS_Store":
    becomes obsolete. I recommend using the glob.glob function, so the user can specify smthl like: /path/**/*.tiff

  • it is good practice if you select 'clear all outputs' on the notebook before pushing, so the notebook looks cleaner
    you cloud use python logging like done in https://github.com/claimed-framework/component-library/blob/main/component-library/util/util-cos.ipynb

  • enable component to work on remote COS locations

  • use the same code to also work on a local file system/path again

@romeokienzler
Copy link
Member Author

@creatermaker @weingartlorenz done some edits, please do a 'git pull' before you start editing :)

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

No branches or pull requests

3 participants