Downloads · 30 days
21
14% of all-time downloads
onnx-community/mobilenet_v2_1.4_224-ONNX
mobilenet_v2_1.4_224-ONNX is a image classification model from onnx-community. Use it when you need a label for an image. It is set up for transformers.js.
This is an ONNX version of google/mobilenetv21.4224. It was automatically converted and uploaded using this space.
Downloads · 30 days
21
14% of all-time downloads
All-time downloads
151
Public
Repo size
99.1 MB
Likes
1
Public
Click a slice to open those files.
.onnx117 MB · 100%
From the Hugging Face model README
This is an ONNX version of google/mobilenet_v2_1.4_224. It was automatically converted and uploaded using this space.
Serve this HTML from a static server. Select a local image to get the top three ImageNet labels. The browser downloads the quantized model and runs inference through WebAssembly. The selected image is read from a local object URL.
<label>Image <input id="image" type="file" accept="image/*"></label>
<pre id="result" role="status"></pre>
<script type="module">
import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/[email protected]";
const input = document.querySelector("#image");
const result = document.querySelector("#result");
let classifier;
input.addEventListener("change", async () => {
const file = input.files[0];
if (!file) return;
const url = URL.createObjectURL(file);
input.disabled = true;
result.textContent = "Loading model or running inference…";
try {
classifier ??= await pipeline(
"image-classification",
"onnx-community/mobilenet_v2_1.4_224-ONNX",
{ device: "wasm", dtype: "q8" }
);
const labels = await classifier(url, { top_k: 3 });
result.textContent = JSON.stringify(labels, null, 2);
} catch (error) {
result.textContent = error.message;
} finally {
URL.revokeObjectURL(url);
input.disabled = false;
}
});
</script>