Open akash-zdaly opened 1 year ago
I've managed to make it work using
let path = await MobileModel.download(
require('./models/model.ptl'),
);
let model = await torch.jit._loadForMobile(path);
Note 1: You need to make sure the ptl
file is bundled with your app. To achieve this, make sure you've performed this step.
Note 2: Model::download()
is deprecated. It's documentation recommends to "Use third-party file downloader (e.g., expo-file-system or react-native-fs)". But I guess as long as other code in this repo is using the function it is still fine to use :)
@remod fixed thanks. And vscode show: The signature '(modelPath: ModelPath): Promise
Is there new method?
Description
Hi,
I want to load a local model located in my project folder at "./models/model.ptl"
i tried using ,
''' // const filePath = await MobileModel.download(MODEL_URL); // model = await torch.jit._loadForMobile('./assets/yolo_zdaly.ptl'); model = await Torch.loadModel(modelPath); console.log(model); console.log('Model successfully loaded');
'''
react-native-pytorch-core": "^0.2.4"
Images
Website
NA
Credit (optional)
No response
Source Code (optional)
https://github.com/akash-zdaly/objdet