Hi everyone. We needed to spot CCTV cameras that had been knocked or mounted crooked from a single frame, so we trained a model for it, and we’ve now opened it under Apache-2.0.
RightWayUp predicts how far an image is rotated (0–359°) with a confidence score, and abstains when it can’t tell which way is up. All six sizes, Pico to Max, are in one repo as ONNX (FP32, FP16, INT8) and Core ML. You don’t need our package: tiers.json in the repo has the preprocessing and thresholds for every file, so you can call the ONNX files directly. Pico also has builds for ONNX Runtime Web.
pip install rightwayup
rightwayup fix photo.jpg
The 3,586 Blender renders we trained on are up as a dataset too (CC BY 4.0), with the roll and camera details for every image. They’re a small part of the training data, added to make the model more robust on CCTV-style scenes. All the images used for training are in the manifests, with corresponding links, authors, and licences.
Most useful to us: images where it’s confidently wrong. Thermal and fisheye are the ones we’re least sure about.
Model: ortusai/rightwayup · Hugging Face (renders are in ortusai/rightwayup-renders next to it).