An app that would alert pedestrians when they’re about to cross a street against a signal and another one that can tell when a driver is about to fall asleep using facial recognition were the winners of a contest aimed at finding technological ways to make New York City’s streets and intersections safer.

The apps, called Tug and Anti-Sleep Alarm, were among the dozens of entrants to the “Connected Intersections Challenge” cosponsored by NYU and AT&T. The contest was judged by a panel of city officials and transportation and city employees judged dozens of entries from across the globe for some of the best ways to help reduce fatalities and crashes on New York City streets.

Tug, the winning app aimed at pedestrians, would pair Bluetooth-outfitted traffic poles with pedestrians’ smartphones connections to send warnings to inattentive walkers when they’re about to step in an intersection, according to the Tug team’s contest entry. The app would run in the background and would only alert users when they’re about to walk into a crosswalk with a “Don’t Walk” sign.

The team said the app would use the city’s existing crosswalk signs and would be a low-cost way to make crosswalks safer. It could also be modified for bicyclists or drivers in the future.

Anti-Sleep Alarm, the other grand prize winner, uses a smartphone's camera along with a smartwatch to track a drivers’ facial expressions and vital signs to see if they're about to doze off behind the wheel.

Before a trip, the Anti-Sleep Alarm would ask drivers how alert they're feeling and how long they've gone without a sleep, the app's creators say. Then, during the trip, the phone’s camera checks to see if a driver's eyes are opened or closed and sounds an alarm if they doze off or stop moving the watch-wearing wrist for an extended period.

Several other apps, including one that would award drivers points for staying off their phone behind the wheel and another that would tell pedestrians when they need to look up from their phone, also took home prizes.