alfredplpl/Japanese-photos
Viewer β’ Updated β’ 756 β’ 318 β’ 4
document (scans, receipts, papers, invoices)photo (regular phone photos: scenes, people, nature, etc.)documentphotomobilenetv2_doc_photo.onnx β Standard float32 for maximum accuracy (best for ARM/CPU)mobilenetv2_doc_photo_quant.onnx β Quantized int8 for even faster inference and smaller file size (best for low-power or edge devices)onnxruntime-react-native), Android (ONNX Runtime), and iOS.@vlad-m-dev Built for edge-ai/phone/tablet offline image classification: document vs photo Telegram: https://t.me/dwight_schrute_engineer
import onnxruntime as ort
import numpy as np
session = ort.InferenceSession("mobilenetv2_doc_photo_quant.onnx")
img = np.random.randn(1, 3, 224, 224).astype(np.float32) # Replace with your image preprocessing!
output = session.run(None, {"input": img})
pred_class = np.argmax(output[0])
print(pred_class) # 0 = document, 1 = photo```