Giter VIP home page Giter VIP logo

Comments (2)

am15h avatar am15h commented on June 6, 2024

Thanks a lot, @mdejeans.

In such way with a variable number of parametrizable crop positions, we can do other crops that centered ones, even if we only need one crop.
So here is the discussion about how to do realize such function and. Is creating a new function into image/ops/ the best way to do or it would be easier if ResizeWithCropOrPadOp can take crop parameters as arguments?

Having the flexibility to choose crop positions other than the center is definitely useful. We can add an optional parameter to ResizeWithCropOrPadOp for this purpose.

So, if I want to extract 4 crops of a 200x200 image I can set cropsPosition=[[0,0], [0,100], [100,0], [100, 100]], cropHeight = 100 and cropWidth = 100 to get a TensorImage of shape (4, 100, 100, 3).

It might not be possible, because the image processing pipeline and TensorImage are designed for a single image only, https://github.com/am15h/tflite_flutter_helper/blob/master/lib/src/image/tensor_image.dart#L90.

For multiple crops, a better option might be to manually create multiple TensorImage objects processed using different parameters in ResizeWithCropOrPadOp.

Please let me know what you think about this.

from tflite_flutter_helper.

mdejeans avatar mdejeans commented on June 6, 2024

Having the flexibility to choose crop positions other than the center is definitely useful. We can add an optional parameter to ResizeWithCropOrPadOp for this purpose.

Please see PR #16 to an answer for this part of the feature

from tflite_flutter_helper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.