On-device ML models for real-time skin health analysis. Part of the
Glowlytics platform.
Unified multi-head EfficientNet-B0 that predicts 4 skin health signals from a single face image.
YOLOv8s object detection model for identifying acne lesions (comedones, papules, pustules, nodules).
1import onnxruntime as ort
2import numpy as np
3from PIL import Image
4from torchvision import transforms
5
6# Skin signals
7transform = transforms.Compose([
8 transforms.Resize((256, 256)),
9 transforms.CenterCrop(224),
10 transforms.ToTensor(),
11 transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),
12])
13
14img = Image.open("face.jpg").convert("RGB")
15input_tensor = transform(img).unsqueeze(0).numpy()
16
17sess = ort.InferenceSession("skin_signals.onnx")
18scores = sess.run(None, {"image": input_tensor})[0][0]
19
20signals = ["structure", "hydration", "sunDamage", "elasticity"]
21for name, score in zip(signals, scores):
22 print(f"{name}: {score * 100:.1f}/100")