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

[tfjs-core]: Add bicubic resize #1668

Closed
aptlin opened this issue Jun 16, 2019 · 9 comments
Closed

[tfjs-core]: Add bicubic resize #1668

aptlin opened this issue Jun 16, 2019 · 9 comments

Comments

@aptlin
Copy link
Contributor

aptlin commented Jun 16, 2019

TensorFlow.js version

1.1.2

Describe the problem or feature request

EfficientNet requires the support for a bicubic resize for the optimal performance, yet it is not yet in the tfjs-core toolkit. Using a bilinear resize does deteriorate the performance.

Code

As far as I understand, we need to add the corresponding op to the image ops after implementing them in all of the backends and adjust the tensor interface. Am I correct?

@nsthorat
Copy link
Contributor

The general approach we take for deciding whether it should be implemented as a backend interface method is if it shows up in ops.pbtxt.

In this case, the ops.pbtxt entry looks like this:

op {
  name: "ResizeBicubic"
  input_arg {
    name: "images"
    type_attr: "T"
  }
  input_arg {
    name: "size"
    type: DT_INT32
  }
  output_arg {
    name: "resized_images"
    type: DT_FLOAT
  }
  attr {
    name: "T"
    type: "type"
    allowed_values {
      list {
        type: DT_INT8
        type: DT_UINT8
        type: DT_INT16
        type: DT_UINT16
        type: DT_INT32
        type: DT_INT64
        type: DT_HALF
        type: DT_FLOAT
        type: DT_DOUBLE
      }
    }
  }
  attr {
    name: "align_corners"
    type: "bool"
    default_value {
      b: false
    }
  }
  attr {
    name: "half_pixel_centers"
    type: "bool"
    default_value {
      b: false
    }
  }
}

Since this appears here, you are exactly right this should be implemented as a kernel and also as an op!

High level question for you @sdll -- is there a place where you've outlined the models you want to add to tfjs-models? I think we should probably review this and make sure we'll accept them before you do all the required work. Maybe we can discuss and track on a separate issue?

@aptlin
Copy link
Contributor Author

aptlin commented Jun 17, 2019

@nsthorat, thank you for illuminating the workflow! For sure, I will create a separate issue tracking the current progress and outlining the future work, moving away from the Google Sheet I sent you a while ago. There is also a Notion board to which you have access, but gh issues do seem more robust.

@aptlin
Copy link
Contributor Author

aptlin commented Jun 17, 2019

The bicubic resize is not a major issue, EfficientNet does seem to perform quite well without it, judging from the pytorch implementation, but it would be nice to have it in the long-term.

@rthadur
Copy link
Contributor

rthadur commented Oct 15, 2019

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

@rthadur rthadur closed this as completed Oct 15, 2019
@aptlin
Copy link
Contributor Author

aptlin commented Oct 15, 2019

@rthadur, not sure if the issue should be closed until the bicubic resize is implemented. Is this tracked anywhere else?

@nsthorat
Copy link
Contributor

Let's keep this open since it's a feature request.

@nsthorat nsthorat reopened this Oct 15, 2019
@susmeet-jain
Copy link

susmeet-jain commented Oct 7, 2020

Hey @nsthorat, @rthadur
Any update on this feature request?

@pyu10055 pyu10055 assigned pyu10055 and unassigned nsthorat Oct 20, 2021
@pyu10055 pyu10055 added the P2 label Oct 20, 2021
@rthadur rthadur assigned pyu10055 and unassigned pyu10055 Oct 20, 2021
@gaikwadrahul8 gaikwadrahul8 added the type:feature New feature or request label Aug 10, 2023
@gaikwadrahul8
Copy link
Contributor

Hi, @aptlin

Thank you for opening this issue. Since this issue has been open for a long time, the code/debug information for this issue may not be relevant with the current state of the code base.

The TFJs team is constantly improving the framework by fixing bugs and adding new features. We suggest you try the latest TFJs version with the latest compatible hardware configuration which could potentially resolve the issue. If you are still facing the issue, please create a new GitHub issue with your latest findings, with all the debugging information which could help us investigate.

Please follow the release notes to stay up to date with the latest developments which are happening in the Tensorflow.js space.

Thank you for your support and cooperation.

@kevinz8866
Copy link

So do we plan to have bicubic resize or not? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants