Gianni was born in Viareggio, Tuscany, Italy. He served as a soldier during the Italo-Turkish War and World War I, becoming a diver after seeing divers on warships. In 1911 he plugged a leak on the Italian battleship "Regina Elena" after it had collided with the "Saint-Bon" in stormy seas. In 1916 he suffered from decompression sickness after participating in a submarine recovery in La Spezia.