- Notifications
You must be signed in to change notification settings - Fork2
Torch and TorchVision, but for NodeJS.
License
NotificationsYou must be signed in to change notification settings
raghavmecheri/pytorchjs
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation

Torch and TorchVision, for your Node servers.Get up and running with PyTorch models within your NodeJS infrastructure in seconds.
Getting Started •Key Features •Development •Misc •License
Your models must be exported to torchscript in order to work with pytorchjs. Checkthis out for an example!
Assuming nothing's broken:yarn add pytorchjs
Run your PyTorch models in Javascript, just like you would in Python.
import{torch,torchvision}from'pytorchjs';const{ load}=torch;const{ DataLoader}=torch.utils.data;const{ ImageFolder}=torchvision.datasets;const{ Compose, Resize, InvertAxes, Normalize}=torchvision.transforms;constsqueezeNet=load("./test/resources/squeezenet_ts.pt");consttransforms=newCompose([newResize({height:224,width:224}),newNormalize([0.485,0.456,0.406],[0.229,0.224,0.225]),newInvertAxes()]);constloader=newDataLoader(newImageFolder("./test/resources/dataset"),1,transforms);constresults=awaitsqueezeNet(loader);
Additional examples of both setup and usage involving features like Torchvision Transforms and CUDA (in development) may be foundhere.
- Run your PyTorch models in a Javascript environment, without worrying about setting up Torchscript or downloading custom binaries
- Deploy your model using configurations identical to what you used during training
- Built-in CUDA support
- CUDA support is a work in progress
- Support for TorchVision, including transforms, dataset classes, and pre-trained models
- Support for TorchVision models is a work in progress
yarn installshould allow you to install project dependenciesyarn testto run the test suite for this project
- This project usesarition's fork of torch-js to run TorchScript - check the project out if you're curious about how we do it!
- Distributed under the MIT license. SeeLICENSE for more information.
- This project was originally developed as a part ofCOMSW4995 - Open Source Development atColumbia University.
About
Torch and TorchVision, but for NodeJS.
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Contributors2
Uh oh!
There was an error while loading.Please reload this page.