Views
No views yet
webnn-graph (https://github.com/tarekziade/webnn-graph), it's composed of 3 files:model.webnn : Graph definitionmodel.weights : Model weightsmanifest.json: metadata, describes tensor shapes, data types and other thingspip install pywebnn pillow onnxruntime➜ python demo.py test.jpg
======================================================================
MobileNetV2 Image Classification (Hugging Face Hub)
======================================================================
Image: test.jpg
Model: tarekziade/mobilenet-webnn
Backend: ONNX CPU
Downloading model from Hugging Face Hub...
[CACHED] model.webnn
[CACHED] model.weights
[CACHED] manifest.json
[OK] Downloaded (0.37ms)
- Graph: model.webnn
Loading graph...
[OK] Loaded (8.97ms)
Preprocessing image...
[OK] (1, 3, 224, 224) (16.05ms)
Creating WebNN context...
[OK] Context created (accelerated=False)
Running inference...
[OK] Done (67.80ms)
Top 5 Predictions:
----------------------------------------------------------------------
1. lesser panda 99.60%
2. polecat 0.20%
3. weasel 0.09%
4. black-footed ferret 0.02%
5. kit fox 0.01%
======================================================================
Performance Summary:
- Model Download: 0.37ms
- Graph Load: 8.97ms
- Preprocessing: 16.05ms
- Inference: 67.80ms
- Total Time: 93.19ms
======================================================================
[OK] Done. Cache dir: /Users/tarekziade/.cache/webnn