Depth estimation is of critical interest for scene understanding and accurate3D reconstruction. Most recent approaches in depth estimation with deeplearning exploit geometrical structures of standard sharp images to predictcorresponding depth maps. However, cameras can also produce images with defocusblur depending on the depth of the objects and camera settings. Hence, thesefeatures may represent an important hint for learning to predict depth. In thispaper, we propose a full system for single-image depth prediction in the wildusing depth-from-defocus and neural networks. We carry out thorough experimentsto test deep convolutional networks on real and simulated defocused imagesusing a realistic model of blur variation with respect to depth. We alsoinvestigate the influence of blur on depth prediction observing modeluncertainty with a Bayesian neural network approach. From these studies, weshow that out-of-focus blur greatly improves the depth-prediction networkperformances. Furthermore, we transfer the ability learned on a synthetic,indoor dataset to real, indoor and outdoor images. For this purpose, we presenta new dataset containing real all-focus and defocused images from a DigitalSingle-Lens Reflex (DSLR) camera, paired with ground truth depth maps obtainedwith an active 3D sensor for indoor scenes. The proposed approach issuccessfully validated on both this new dataset and standard ones as NYUv2 orDepth-in-the-Wild. Code and new datasets are available athttps://github.com/marcelampc/d3net_depth_estimation.