Most dogs signal friendly or hostile intentions through vocalizations, and their body language.
Very few dogs attack without giving warning.
That’s not good enough, because by then, the dog may be so close that it can close the gap in a second, lighting may not be optimal, and it may have a physical or mental problem, or training, that makes it hyperaggressive.