Image Classification
LiteRT
LiteRT
ONNX
English
mobilenetv5
mobilenetv4
gemma-3
edge-ai
quantization
w4a8
int8
npu
qualcomm-snapdragon
google-tensor
geology
Instructions to use GeoStratum/quantification-MobileNetV5-V4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use GeoStratum/quantification-MobileNetV5-V4 with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
File size: 3,302 Bytes
2248c41 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | import os
import sys
import time
import glob
import subprocess
import pandas as pd
import numpy as np
from PIL import Image
# Benchmark harness for Qualcomm Snapdragon X Plus Copilot+ PC (Surface Pro 11)
# Fully portable using environment variables or relative paths to current directory
BASE_DIR = os.environ.get("BENCH_WORK_DIR", os.path.dirname(os.path.abspath(__file__)))
MODELS_DIR = os.environ.get("MODELS_DIR", os.path.join(BASE_DIR, "models", "qairt_bin"))
DATASET_DIR = os.environ.get("DATASET_DIR", os.path.join(BASE_DIR, "dataset"))
OUTPUT_DIR = os.environ.get("OUTPUT_DIR", os.path.join(BASE_DIR, "bench_output"))
os.makedirs(OUTPUT_DIR, exist_ok=True)
# QAIRT SDK ARM64 Binaries
QAIRT_ROOT = os.environ.get("QAIRT_ARM64_ROOT", os.path.join(BASE_DIR, "QAIRT_SDK", "2.51"))
QAIRT_BIN = os.path.join(QAIRT_ROOT, "bin", "qnn-net-run.exe")
QAIRT_LIB = os.path.join(QAIRT_ROOT, "lib", "aarch64-windows-msvc")
QAIRT_SKEL = os.path.join(QAIRT_ROOT, "lib", "hexagon-v73", "unsigned")
BACKEND = os.path.join(QAIRT_LIB, "QnnHtp.dll")
env = os.environ.copy()
env["PATH"] = f"{QAIRT_LIB};{QAIRT_SKEL};" + env.get("PATH", "")
env["ADSP_LIBRARY_PATH"] = QAIRT_SKEL
image_files = sorted(glob.glob(os.path.join(DATASET_DIR, "*.jpg")))[:25]
CONFIGS = [
{
"model_name": "MobileNetV4",
"task": "Rock_Classification",
"format": "W4A8",
"bin_file": os.path.join(MODELS_DIR, "rock_model_w4a8_MobileNetV4.bin"),
"input_name": "input",
"input_size": (256, 256),
"precision": "W4A8_INT4_HTP",
"accuracy": "91.20%"
},
{
"model_name": "MobileNetV4",
"task": "Rock_Classification",
"format": "INT8",
"bin_file": os.path.join(MODELS_DIR, "rock_model_w8a8_MobileNetV4.bin"),
"input_name": "input",
"input_size": (256, 256),
"precision": "W8A8_INT8_HTP",
"accuracy": "91.80%"
},
{
"model_name": "MobileNetV5",
"task": "Rock_Classification",
"format": "W4A8",
"bin_file": os.path.join(MODELS_DIR, "rock_model_w4a8_MobileNetV5.bin"),
"input_name": "input",
"input_size": (512, 512),
"precision": "W4A8_INT4_HTP",
"accuracy": "80.33%"
},
{
"model_name": "MobileNetV5",
"task": "Rock_Classification",
"format": "INT8",
"bin_file": os.path.join(MODELS_DIR, "rock_model_w8a8_MobileNetV5.bin"),
"input_name": "input",
"input_size": (512, 512),
"precision": "W8A8_INT8_HTP",
"accuracy": "83.33%"
},
{
"model_name": "ScaleDetection_MobileNetV4",
"task": "Scale_Metrology",
"format": "W4A8",
"bin_file": os.path.join(MODELS_DIR, "v4_small_scale_w4a8.bin"),
"input_name": "serving_default_input:0",
"input_size": (1024, 1024),
"precision": "W4A8_INT4_HTP",
"accuracy": "98.45%"
},
{
"model_name": "ScaleDetection_MobileNetV4",
"task": "Scale_Metrology",
"format": "INT8",
"bin_file": os.path.join(MODELS_DIR, "v4_small_scale_int8.bin"),
"input_name": "serving_default_input:0",
"input_size": (1024, 1024),
"precision": "W8A8_INT8_HTP",
"accuracy": "98.70%"
}
]
# Run benchmark and output CSVs
|