facebookresearch / playtorch

PlayTorch is a framework for rapidly creating mobile AI experiences.
https://playtorch.dev/
MIT License
826 stars 100 forks source link

add fromNativeJSRef method to ImageUtil #30

Closed Sxela closed 2 years ago

Sxela commented 2 years ago

Area Select

react-native-pytorch-core (core package)

Description

I've played around with Image2Image models, and I had to add the fromNativeJSRef method to ImageUtil, in order to wrap my inference result, as my model returned a NativeJSRef object. Trying to import wrapRef directly into my app.ts file resulted in import errors, which the typescript transpiler doesn't catch.

Maybe there is a more elegant solution, like wrapping the output directly in the MobileModelModule

raedle commented 2 years ago

Thanks for submitting PR #31, @Sxela. We've merged it, so I am closing this issue