ESPCN
This repository's model is generated with the code here. And this repository is inspired by the repository. And some code is originally in the repository.
init: (config: SuperResolutionConfig | null) => Promise<void>;
predict: (src: HTMLCanvasElement | HTMLImageElement | HTMLVideoElement, params?: SuperResolutionOperationParams) => Promise<Uint8Array | null>;
export interface SuperResolutionConfig{
browserType : BrowserType
processOnLocal : boolean
modelPath : string
workerPath : string
enableSIMD : boolean
}
export interface SuperResolutionOperationParams{
inputWidth : number
inputHeight : number
scaleFactor : number
interpolation : number
useSIMD : boolean
}
export const InterpolationType = {
INTER_NEAREST :0,
INTER_LINEAR :1,
INTER_AREA :2,
INTER_CUBIC :3,
INTER_LANCZOS4 :4,
INTER_ESPCN :100,
CANVAS :200,
}
$ npx create-react-app demo --template typescript
$ cd demo/
$ npm install
$ npm install @dannadori/super-resolution-worker-js
$ cp node_modules/\@dannadori/super-resolution-worker-js/dist/super-resolution-worker-worker.js public/
$ mkdir -p public/static/js
$ cp node_modules/\@dannadori/super-resolution-worker-js/resources/tflite.wasm public/static/js
$ cp node_modules/\@dannadori/super-resolution-worker-js/resources/tflite-simd.wasm public/static/js
In this time, the name is "srcImage.jpg"
TBD
$ npm run start