Detecting a closed eye in a well-lit frontal image is not difficult. Detecting it through polarised sunglasses, at night, with sunlight strobing through roadside trees, on a driver wearing a mask, at a seat position the calibration did not anticipate, while the cab vibrates — that is the engineering.
Near-infrared illumination is what makes it tractable. It penetrates many sunglass lenses, works in darkness without dazzling the driver, and is largely unaffected by the visible-light conditions outside. The remaining work is in the geometry: mounting position, field of view, and handling the range of body sizes and seating positions a real fleet contains.