I think Deep Purple deserves as much credit for inventing heavy metal as Black Sabbath (though I don’t think any band single-handedly invented the genre). In Rock sounds much closer to metal than Black Sabbath’s first album. Sabbath had heavy riffs and occult themes, but Deep Purple had the hardness, fast tempos, guitar solos, and high-pitched vocals, all of which are common in metal, that Black Sabbath either didn’t have (at least not on their first album) or didn’t do as well. Black Sabbath did invent doom metal (which is very small compared to other genres like thrash metal), but they don’t sound anything like progressive metal or power metal.
If you haven’t already, try listening to the song Hard Lovin’ Man. It’s main guitar riff, known as the metal gallop, would later be used in countless metal songs (including Run to the Hills, Holy Diver, Raining Blood, and several Metallica songs).