Flexible high-resolution object detection on edge devices with tunable latency