
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
deeplearn-caffe
Advanced tools
Run pretrained Caffe models in the browser with GPU support via the wonderful deeplearn.js library. This package provides utility tools and a model loader for Caffe models to support the following tasks:
*.caffemodel
files into deeplearn.js weights*.binaryproto
files into deeplearn.js blobs*.prototxt
files into deeplearn.js modelsYou can use this as standalone es5 bundle like this:
<script src="https://unpkg.com/deeplearn-caffe"></script>
Then loading model is a simple as referencing the path to the caffemodel and prototxt files.
Here is an example of loading GoogLeNet:
var GITHUB_CDN = 'https://rawgit.com/';
var MODEL_DIR = 'models/';
// Caffemodel needs to be downloaded from here
var modelUrl = 'http://dl.caffe.berkeleyvision.org';
var prototxtUrl = GITHUB_CDN + 'BVLC/caffe/master/models/bvlc_googlenet/deploy.prototxt';
var caffemodelUrl = MODEL_DIR + 'bvlc_googlenet.caffemodel';
// Initialize the CaffeModel
var model = new deeplearnCaffe.CaffeModel(caffemodelUrl, prototxtUrl);
This is how you load Squeezenet directly from Github:
// The model is served entirely from Github
var GITHUB_CDN = 'https://rawgit.com/';
var prototxtUrl = GITHUB_CDN + 'DeepScale/SqueezeNet/master/SqueezeNet_v1.1/deploy.prototxt';
var caffemodelUrl = GITHUB_CDN + 'DeepScale/SqueezeNet/master/SqueezeNet_v1.1/squeezenet_v1.1.caffemodel';
// Initialize the CaffeModel
var model = new deeplearnCaffe.CaffeModel(caffemodelUrl, prototxtUrl);
To run the demo, use the following:
npm run build
# Start a webserver
npm run start
Now navigate to http://localhost:8080/demos.
Hint: some of the models are quite big (>30MB). You have to download the caffemodel files and place them into the
demos/models
directory to save bandwith.
npm install
To build a standalone bundle run
npm run build
FAQs
Run pretrained Caffe models in deeplearn.js
The npm package deeplearn-caffe receives a total of 4 weekly downloads. As such, deeplearn-caffe popularity was classified as not popular.
We found that deeplearn-caffe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.