transformers.js
40cdd365 - Fix channel format when padding non-square images for certain models (#655)

Comment changes are shownComment changes are hidden
Commit
1 year ago
Fix channel format when padding non-square images for certain models (#655) * Add tensor permute unit tests * Rename transpose -> permute * Fix padding for non-square images * Add vitmatte padding unit test * Create `RawImage.toTensor` helper function * Add bankers rounding test case * `.toBe()` -> `.toBeCloseTo()` for floating point numbers
Author
Parents
  • src
    • File
      models.js
    • File
      processors.js
    • utils
      • File
        image.js
      • File
        maths.js
      • File
        tensor.js
  • tests
    • File
      maths.test.js
    • File
      processors.test.js
    • File
      tensor.test.js