{'fraction_non_alphanumeric': 0.032122943016455865, 'fraction_numerical': 0.011179110567115463, 'mean_word_length': 4.926176660219213, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Learning Depth via Interaction

Motivated by the astonishing capabilities of natural intelligent agents and inspired by theories from psychology, this paper explores the idea that perception gets coupled to 3D properties of the world via interaction with the environment. Existing works for depth estimation require either massive amounts of annotated training data or some form of hard-coded geometrical constraint. This paper explores a new approach to learning depth perception requiring neither of those. Specifically, we train a specialized global-local network architecture with what would be available to a robot interacting with the environment: from extremely sparse depth measurements down to even a single pixel per image. From a pair of consecutive images, our proposed network outputs a latent representation of the observer's motion between the images and a dense depth map. Experiments on several datasets show that, when ground truth is available even for just one of the image pixels, the proposed network can learn monocular dense depth estimation up to 22.5% more accurately than state-of-the-art approaches. We believe that this work, despite its scientific interest, lays the foundations to learn depth from extremely sparse supervision, which can be valuable to all robotic systems acting under severe bandwidth or sensing constraints.


I. INTRODUCTION
Understanding the three-dimensional structure of the world is crucial for the functioning of robotic systems: for instance, it supports path planning and navigation, as well as motion planning and object manipulation. Animals, including humans, obtain such three-dimensional understanding naturally, without any specialized training. By observing the environment and interacting with it [1], they learn to estimate (possibly non-metric) distances to objects using stereopsis and a variety of monocular cues [2], [3], including motion parallax, perspective, defocus, familiar object sizes. Could a robotic system acquire a metric understanding of its surrounding from a similar feedback?
Endowing robots with such an ability would be valuable for several applications. Consider for example a swarm of nano aerial vehicles, whose task is to explore a previously unseen environment [4], [5]. Constrained by the size and battery life, each robot can only carry limited sensing, e.g. a camera or a 1D distance sensor. Learning to estimate dense metric depth maps from such on-board sensors during operation would allow efficient exploration and obstacle avoidance [6].
Classically, multi-view geometry methods are used to reconstruct the 3D coordinates of points given their corresponding projections in multiple images. These geometric approaches, carefully engineered over decades, demonstrate impressive results in a variety of settings and applications [8]. One We train a depth perception system with what would be avaialbe to a robot interacting with the environment: very sparse depth measurements. When trained in such sparse regimes (up to a single pixel per image), our approach learns to perceive depth with higher accuracy than state-of-the-art methods.
downside of this class of approaches is that they are using only some of the depth cues (mainly stereo and motion parallax), but typically do not exploit more subtle monocular cues, such as perspective, defocus or known object size. Unsupervised learning approaches to depth estimation [9], [10], [7] combine geometry with deep learning, with the hope that deep networks can learn to utilize the cues not used by the classic methods. In these approaches, depth estimators are trained from monocular or stereo video streams, using photometric consistency between different images as a loss function. Unsupervised learning approaches are remarkably successful in many cases, but they are fundamentally based on hard-coded geometry equations, which makes them potentially sensitive to the camera model and parameters, as well as difficult to tune.

A. Contributions
The present work is motivated by the following question: how can three-dimensional perception be learned by a robot interacting with an environment? To make the problem tractable, we make two assumptions. First, motivated by the extensive evidence from psychology and neuroscience on the fundamental importance of motion perception [11], [12], [13], [14], we provide pre-computed optical flow as an input to the depth estimation system. Optical flow estimation can be learned either from synthetic data [15], [16], [17] or from real data in an unsupervised fashion [18], [19]. Second, we assume at training time the availability of only very sparse depth ground truth (just few pixels per image), similar to what a robot might collect with a 1-D distance sensor while navigating an environment.
In order to learn a generalizable depth estimator from such assumptions, we design a specialized global-local deep architecture consisting of two modules -global and localtasked with estimating the observer's motion and the dense per-pixel depth, respectively. The global module takes as input two images and optical flow between them and outputs a compact latent vector of "global parameters", which we expect to encode the observer's motion between the frames. The local module then generates a compact fully convolutional network, conditioned on the "global parameters", and applies it to the optical flow field to generate the final depth estimate. The global and the local modules are trained jointly end-toend with the available sparse depth labels and without camera pose ground truth.
Since the method is inspired by learning via interaction, we evaluate it on several indoor scenarios. We compare against both generic deep architectures and classic geometrybased methods. Standard convolutional networks show good results when trained with dense depth ground truth, but their performance degrades dramatically in the very sparse data regime. Classic methods are generally strong, but their performance in the challenging monocular two-frame indoor scenario suffers from suboptimal correspondence estimation due to homogeneous surfaces and occlusions. The proposed approach outperforms baselines of both types, thanks to its ability to effectively train with very sparse depth labels and its robustness to imperfections in optical flow estimates.

II. RELATED WORK
The problem of recovering the three-dimensional structure of a scene from its two-dimensional projections has been long studied in computer vision [20], [21], [22], [23]. Classic methods are based on multi-view projective geometry [24]. The standard approach is to first find correspondences between images and then use these together with geometric constraints to estimate the camera motion between the images (for instance, with the eight-point algorithm [22]) and the 3D coordinates of the points (e.g., via triangulation [21]). Numerous advanced variations of this basic pipeline have been proposed [25], [26], [27], [28], improving or modifying various its elements. However, key characteristics of these classic methods are that they crucially rely on projective geometry, require laborious hand-engineering, and are not able to exploit non-motion-related depth cues.
To make optimal use of all depth cues, machine learning methods can either be integrated into the classic pipeline, or replace it altogether. The challenge for supervised learning methods is the collection of training data: obtaining ground truth camera poses and geometry for large realistic scenes can be extremely challenging. An alternative is to train on simulated data, but then generalization to diverse real-world scenes can become an issue. Therefore, while supervised learning methods have demonstrated impressive results [29], [30], [31], [32], it is desirable to develop algorithms that function in the absence of large annotated datasets.
Unsupervised (or self-supervised) learning provides an attractive alternative to the label-hungry supervised learning. The dominant approach is inspired by classic 3D reconstruction techniques and makes use of projective geometry and photometric consistency across frames. Existing works use various depth representations for this task: voxel grids [33], [34], point clouds [35], [36], triangular meshes [37] or depth maps [9], [10], [38], [39]. In this work we focus on the depth map representation. Among the methods for learning depth maps, some operate in the stereo setup (given a dataset of images recorded by a stereo pair of cameras) [9], [38], while others address the more challenging monocular setup, where the training data consists of monocular videos with arbitrary camera motions between the frames [10], [39]. Reprojection-based approaches can often yield good results, but they crucially rely on geometric equations and precisely known camera parameters (one notable exception being the recent technical report in [40], which learns the camera parameters automatically). In contrast, we do not require knowing the camera parameters in advance and do not rely on projective geometry. Also related to our work are depth completion methods [41], which learn to predict full depth maps given sparse ground-truth annotations. However, while they assume to observe ground-truth also at test time, we use ground-truth annotations only at training time. At test time, we predict depth maps from two images only. Using sparse annotations only for training has been applied mainly to semantic segmentation [42], where additional cues, e.g., object masks, can facilitate learning.
Several works, similar to ours, aim to learn 3D representations without explicitly applying geometric equations [43], [44], [45]. A scene, represented by one or several images, is encoded by a deep network into a latent vector, from which, given a target camera pose, a decoder network can generate new views of the scene. A downside of this technique is that the 3D representation is implicit and therefore cannot be directly used for downstream tasks such as navigation or motion planning. Moreover, at training time it requires knowing camera pose associated with each image. Our method, in contrast, does not require camera poses, and grounds its predictions in the physical world via very sparse depth supervision. This allows us to learn an explicit 3D representation in the form of depth maps.

III. METHODOLOGY
Given two monocular RGB images I 1 , I 2 , with unknown camera parameters and relative pose, as well as the optical flow w between them, we aim to estimate a dense depth map corresponding to the first image. We assume to have an artificial agent equipped with a range sensor, which navigates through an indoor environment. By doing so, it collects a training dataset of image pairs, with depth ground truth d available only for extremely few pixels. Using this sparsely annotated dataset, we train a deep network F θ (I 1 , I 2 , w), with parameters θ, that predicts a dense depth mapd over the whole image plane. We now describe the network architecture in detail. An overview of the global-local network architecture is provided in Figure 2. The system operates on an image pair I 1 , I 2 and the optical flow (dense point correspondences) w between them. In this work, we estimate the flow field with an off-the-shelf optical flow estimation algorithm, which is neither trained nor tuned on our data.
The rest of the model is composed of two modules: a global module G that processes the whole image and outputs a compact vector of "global parameters" and a local module L that applies a compact fully convolutional network, conditioned on the global parameters, to the optical flow field. This design is motivated both by classic 3D reconstruction methods and by machine learning considerations. Establishing an analogy with classic pipelines, the global module corresponds to the relative camera pose estimation, while the local module corresponds to triangulation -estimation of depth given the image correspondences and the camera motion. These connections are described in more detail in the supplement. From the learning point of view, we aim to train a generalizable network with few labels, and therefore need to avoid overfitting. The local module is very compact and operates on a transferable representation -optical flow. The global network is bigger and takes raw images as input, but it communicates with the rest of the model only via the low-dimensional bottleneck of global parameters, which prevents potential overfitting.
The "global module" G is implemented by a convolutional encoder with global average pooling at the end. The network outputs a low-dimensional vector of "global parameters" g = G(I 1 , I 2 , w). The idea is that the vector represents the motion of the observer, although no explicit supervision is provided to enforce this behavior. While the optical flow alone is in principle sufficient for ego-motion estimation, we also feed the raw image pair to the network to supply it with additional cues.
The "local module" L takes as input the generated global parameters g, as well as the optical flow field. First, the global parameter vector is processed by a linear perceptron that outputs several convolutional filters banks, collectively denoted by ϕ = LP (g). Then, these filter banks are stacked into a small fully convolutional network C ϕ that is applied to the optical flow field. We append two channels of xand yimage coordinates to the input w of C ϕ , as in CoordConv [46].
This design of the local module is motivated by classic geometric methods: for estimating the depth of a point it is sufficient to know its displacement between the two images, its image plane coordinates, and the camera motion. In contrast to this standard formulation of triangulation, we intentionally make the receptive field of the network larger than 1 × 1 pixel, so that the network has the opportunity to correct for small inaccuracies or outliers in the optical flow input.

A. Loss function
Similarly to previous work [31], [30], we define the loss on the inverse depthẑ . This is a common representation in computer vision and robotics [47], [26], which allows to naturally handle points and their uncertainty over a large range of depths. We use the L 1 loss on the inverse depth, averaged over the subset P of the pixels that have associated ground truth inverse depth z: To encourage the local smoothness of the predicted depth maps, we add an L 1 regularization penalty on the gradient ∇ẑ = (∂ xẑ , ∂ yẑ ) of the estimated inverse depth. Similarly to classic structure from motion methods and unsupervised depth learning literature [38], we modulate this penalty according to the image gradients ∂I 1 , allowing depth discontinuities to Abs-Inv be larger at points with large ∂I 1 : with Ω representing the full image plane. The full training loss of our network is a weighted sum of these two terms L total = λ p L depth + λ s L smooth .

B. Model details
In all our experiments the input images have resolution 256 × 192 pixels. Unless mentioned otherwise, ground truth depth is provided for a single pixel of each image, but we also experiment with denser ground-truth signals. We use a pre-trained PWC-Net [17] for optical flow estimation.
We use the Leaky ReLU non-linearity in all networks. The global module is implemented by a 5-layer convolutional encoder with the number of channels growing from 16 to 256, with stride 2 in the first 4 layers. The last 256-channel hidden layer is followed by a convolution with 6 channels and global average pooling, resulting in the 6-dimensional predicted global parameter vector g. The local module consists of a single linear perceptron which transforms g linearly to a 3.9K vector. Empirically, we did not find an advantage in utilizing a multi-layer non-linear perceptron in place of the linear operation. The resulting vector is split into three parts, which are reshaped into filter banks with kernel size 3 × 3 and number of output channels 20, 10, 20, respectively. These filter banks, with Leaky ReLUs in between, constitute the compact fully-convolutional depth estimation network C ϕ .
The 20-channel network output is then processed by a single 3 × 3 convolutional layer to shrink the channels to 1. The design of this compact fully convolutional network has been inspired by the refinement layer used by previous works on supervised depth estimation [31], [30].
We train the model with the Adam optimizer [48] with an initial learning rate of 10 −4 for a total of approximately 94K iterations with a mini-batch size of 16. We apply data augmentation during training. Further details are provided in the supplement.

IV. EXPERIMENTS
Navigating a physical agent in the real world to collect interaction data is challenging due to problem spanning perception, planning, and control. Therefore, in order to isolate the contribution of our proposed method, we simulate distance observations from a navigation agent, e.g. nanodrones [5], by masking out all depth ground truth except for a single one on several depth estimation benchmarks. Specifically, we test the approach on three datasets collected in cluttered indoor environments, either real or simulated: Scenes11, Sun3D, and RGB-D. Scenes11 [31] is a large synthetic dataset with randomly generated scenes composed of objects from ShapeNet [51] against diverse backgrounds composed of simple geometric shapes. SUN3D [52] is a large collection of RGB-D indoor videos collected with a Kinect sensor. RGB-D SLAM [53] is another RGB-D dataset collected with Kinect in indoor spaces.
For all datasets, we use the splits proposed by [31]. As commonly done in two-view depth estimation methods and in structure-from-motion methods [8], [31], we resolve the inherent scale ambiguity by normalizing the depth values such that the norm of the translation vector between the two views is equal to 1. To quantitatively evaluate the generated depth maps, we adopt three standard error metrics summarized in Table I. We compare to both standard convolutional neural networks, unsupervised methods, and classic structure from motion methods. Additional quantitative and qualitative comparisons are provided in the supplementary material.

A. Learning from very sparse ground truth
We compare the proposed global-local architecture to strong generic deep models -the encoder-decoder architecture of Eigen et al. [29], the popular fully convolutional architecture DispNet [49], and the multi-scale encoder-decoder of Laina et al. (FCRN) [50]. Note that for a fair comparison with our method, we provide all the baselines with both the image pair and the optical flow field. We additionally tune the models to reach best performance on our task. The details of the tuning process are reported in Section 6.2.1 in the Appendix. We also compare to a reduced-sized DispNet [49] (Small Enc-Dec), that has a number of parameters similar to our model (including both the global and the local module). Its encoder consists of 4 convolutions with (16,32,54,128) filters, with sizes of (7, 5, 3, 3), and stride 2. Its decoder is composed of 4 up-convolutions with (128, 64, 32, 16) filters of size 3 and stride 1. Encoder and decoder layers are connected through skip connections. Finally, we compare against Struct2Depth [7], current state-of-the-art system for unsupervised depth estimation.
As shown in Table II, our approach outperforms all the baselines in the sparse supervision regime. Specifically, we outperform the architecture of Eigen et al. [29] on average by 53%, the architecture of Laina et al. [50] by 22.5%, and the fully convolutional DispNet by 20%. Indeed, due to over-parametrization, these baselines tend to overfit to the training points, failing to generalize to unobserved images and locations. This is empirically demonstrated in Fig. 4, where we plot the depth loss on training points as a function of the number of iterations. Decreasing the size of the architecture to address overfitting does not however solve the problem: the Small Enc-Dec, with number of parameters similar to our network, achieves poor results, mainly due to its limited capacity. Our approach also achieves on average 24% better error than the unsupervised depth estimation baseline [7] over all datasets and metrics. Indeed, the considered datasets represent a challenge for geometry-based methods given the presence of large homogeneous regions, occlusions, and small baselines between views, which are typical factors encountered in indoor scenes. Noticeably, the performance of Struct2Depth on the SUN3D dataset is relatively good, boosted by the larger baseline between views and the abundance of features. Fig. 5 analyzes the performance of our and the DispNet architectures (our strongest baseline) as a function of the number of observed ground-truth pixels per image. Unsurprisingly, both methods learn to predict accurate depth maps when dense annotations (D) are available. Decreasing the amount of supervision obviously leads to performance drops. However, for our method the error increases on average by only 5% when going to sparser supervision, compared to 12% for the baseline, which leads to a large advantage over the baseline in the single-pixel supervision regime. This shows that the global-local architecture provides an appropriate inductive bias for learning from extremely sparse depth ground-truth.

B. Robustness to Dynamically Changing Camera Parameters
In practical applications camera internal parameters, such as focal length, may change through time. Indeed, environmental changes like temperature, humidity and pressure could cause   severe variations to their nominal value. Due to these variations, methods based on projective geometry, which are sensitive to the accuracy of calibration parameters, can experience large performance drops. Although the problem could be alleviated by automatic re-calibration, these changes would have to be detected in the first place and would require either collecting multiple views of an object [54], [55] or additional sensing [56]. We empirically study the robustness of our method and the baselines to dynamically changing camera intrinsics. In particular, we randomly change, for each image pair, the horizontal and vertical focal lengths, as well as the center of projection, by up to 20% of their nominal value. The unsupervised depth estimation baseline suffers the most from the uncertainty in the camera intrinsics. Indeed, its estimation error increases on average by 26% with respect to the case in which camera parameters are correctly set. In contrast, as our approach does not explicitly rely on projective geometry, it does not exhibit such sensitivity to the camera parameters. Indeed, it experiences only a small decrease in performance, of approximately 5% with respect to the case where the intrinsics are fixed, since the learning problem becomes more challenging.

C. Global parameters and the camera motion
According to the intuition behind our model, the global parameters should have information about the observer's egomotion between the frames, and as such should be related to the actual metric camera motion. Here we study this relation empirically, by training a camera pose predictor on the output of our global module, in supervised fashion. Note that this is done for analysis purposes only, after our full model has been trained: at training time the model has no access to the ground truth camera poses. Specifically, we add a small two-layer MLP with 256 hidden units on top of the global module that is either pre-trained with our method or randomly initialized. We then either train the full network or only the appended small MLP to predict the camera motion in supervised fashion (details of the training process are provided in the supplement).
Results in Table IV show that the global parameters indeed contain information about the camera pose. In both training setups pre-trained network substantially outperforms the random initialization: 17% to 64% error reduction across datasets and metrics when only tuning the MLP and up to 11% error reduction when training the full system. Interestingly, our method is also competitive against classic state-of-the-art baselines for motion estimation [31].

D. Ablation study
Our architecture is based on several design choices that we now validate through an ablation study. In particular, we ablate the following components: (i) the use of optical flow as an intermediate representation, (ii) the estimation of global variables to generate convolutional filters, (iii) the use of coordinate convolution in the fully convolutional network and (iv) the use of the image pair, in addition to optical flow, for the estimation of global parameters.
The results in Table V show that all components are important and some have larger impact than others. The use of optical flow and coordinate convolution are crucial since they both provide essential cues for depth estimation. However, a basic encoder-decoder architecture (i.e. without global variables or coordinate convolutions) underperforms even when provided with optical flow. Unsurprisingly, the least important factor is providing the image pair to the global module, since, when camera parameters are fixed, the optical flow is a sufficient statistics of the observer's ego-motion. V. CONCLUSION Motivated by the way natural agents learn to predict depth, we propose an approach for training a dense depth estimator from two unconstrained images given only very sparse supervision at training time and without the explicit use of geometry. We show that in cluttered indoor environments our global-local model outperforms state-of-the-art architectures for depth estimation by up to 22.5% in the sparse data regime.
We see several potential ways for further improving the performance of our approach. The method suffers from outliers in the flow field or when the baseline between views is very small (see Appendix for detailed evaluation). The former problem could be solved by learning depth estimation not only from the sparse ground truth, but also from the photometric reprojection error. This raises the question of how to make use of photometric error from interaction feedback only. In addition, exploiting non-motion cues without compromising generalization would likely help improving the performance. We see these directions as exciting avenues for future work.

A. Connection with Two-View Triangulation
The problem of triangulation consists of computing the 3D coordinates of a point given its (noisy) projections on two or more views and the camera parameters of the views. Hence, it is a geometric problem. Following the usual formalism of homogeneous coordinates [24], the perspective projection of a 3D point M on two cameras with projection matrices P 1 , P 2 (comprising the intrinsic and extrinsic parameters of both views) is given by λ 1 m 1 = P 1 M and λ 2 m 2 = P 2 M , where λ 1 , λ 2 are the projective scaling factors.
Given P 1 , P 2 , m 1 , m 2 , the linear triangulation algorithm [24,Sec.12.2], which tackles the triangulation problem in its most general setting (projective cameras), computes the 3D point M by minimizing the Rayleigh quotient AM / M , where A is the matrix and [u] × is the cross product matrix (such that [u] × v = u×v, for all v).
In case of multiple point correspondences {m i 1 ↔ m i 2 } for i = 1, . . . , N , the camera matrices P 1 , P 2 appear in the triangulation equations (3) of all of them, and hence, are "global" variables. If the camera matrices are known, then (i) every 3D point M i can be triangulated independently from the rest, and (ii) the triangulated point is a function of the point correspondences m i 1 ↔ m i 2 .
This intuition inspired the design of our modular architecture: First, a neural network regresses global variables which depend only on the two views, and then those global variables are used by a local module to generate a fully-convolutional net which transforms point correspondences (optical flow) into depth.

B. Training Process
We train our model from scratch on the Scenes11 dataset for approximately 150K steps using Adam as optimizer with an initial learning rate of 1e − 4. We normalize all losses with the number of points used to compute them. The loss weights for depth and smoothness λ p , λ s are 5.0 and 2.0 respectively. To increase generalization, we perform data augmentation at training time by mirroring pairs on the xaxis and rotating them 180 degrees, both 50% probability. For a fair comparison, we trained all baselines with exactly the same strategy and hyper-parameters on a desktop PC equipped with an NVIDIA-GeForce 940MX.
For the pose experiments in Sec. 4.4, we trained a 2 hidden layer MLP with 20 nodes and leaky ReLU activation function to predict relative camera motion between frames from the global parameters estimated by our global network. For all datasets and all variations, we trained with an L 1 loss between estimated and real camera poses for 50K steps.

1) Tuning of Baselines:
To fairly study the sparse training setting, we tuned the baseline to reach the best performance on the sparse training task. First, we changed the input layer of each baseline architecture. Exactly as for ours, the baselines' input consists of the concatenation of the image pair and the optical flow on the last channel. Given the very sparse supervision signal, we noticed that the ReLu activation function generated extremely sparse and noisy gradients. Therefore, we modified the original activation function of DispNet [49], FCRN [50] and Eigen [29] from ReLu to LeakyRelu. This change improved the performance of the baselines of up to 50% on average over metrics.

C. Comparison with structure from motion methods
Dense Structure from Motion (SfM) methods [26], [25] can recover the depth map of a scene from two or more views using projective geometry [24]. We now compare our global-local architecture to two SfM baselines proposed by Ummenhofer et al. [31]: one that computes correspondences between images by matching SIFT keypoints (SfM-SIFT) and another that uses optical flow instead [57] (SfM-Flow). Given the correspondences, the essential matrix is estimated with the normalized 8-point algorithm and RANSAC [24], and further refined by minimizing the reprojection error with the ceres library. Finally, the depth maps are computed by plane sweep stereo and optimized with the variational approach of Hirshmueller et al. [8].
Results in Table VI show that our approach achieves on average 63% better error than SfM-SIFT and 43% better error than SfM-Flow over all datasets and metrics. Indeed, the considered datasets represent a challenge for geometry-based methods given the presence of large homogeneous regions, occlusions, and small baselines between views, which are typical factors encountered in indoor scenes. In addition, geometry-based methods are known to be subject to correspondence errors, which the aforementioned factors generally worsen. Nonetheless, our method remains competitive against the geometry-based techniques, outperforming them on two out of three metrics. Furthermore, as we show in the next section, our method is much more robust to errors in the optical flow estimates than classic triangulation.

D. Experiments with ground truth
The main intuition driving the design of our architecture consists of the fact that the relative pose between two images control the conversion of correspondences to depth. Since depth can be computed analytically given the correspondences (in non-degenerate cases), can also our model learn this relation when correspondences are perfect or the relative pose between cameras is given? How does it compare to the triangulation equations in term of performance and ability to handle false correspondences?
To answer these questions, we trained our network with either perfect flow or given pose. As baselines, we used both the simple triangulation equation and the SfM-pipeline presented in Sec. 4.3, but provided with ground-truth camera motion. In addition, we also compare our approach to linear triangulation with the pose predicted by our global parameter network after supervised refinement on ground-truth poses (see Sec. 4.4). The results of this analysis are reported in Table VII.
Performances on Scenes11 show that, when the optical flow generated by PWCNet are very precise, naive triangulation performs very competitively, even outperforming the more complex SfM method. Our network perform comparably to this baseline, showing indeed its ability to learn the mathematical relation between flow and depth. However, triangulation is very sensitive to its inputs: when the precision of the extrinsic parameters or of the correspondences decreases, its performance drastically drops. This can be observed from the results on the SUN3D and RGB-D datasets (Table VII), where the optical flow generated from PWCNet is significantly worse than the one on Scenes11. In contrast, as we show in Fig. 6, our network can cope against these inaccuracies, outperforming triangulation in the real datasets. However, our approach is still not competitive with the SfM pipeline with given extrinsic parameters on the SUN3D and RGB-D datasets: this is an indicator of the difficulty coming from estimating good global and local parameters when both training flows and depths are noisy, but not of our network ability to learn the relationship between these two modalities. Indeed, when the network is provided with perfect correspondences, performance generally increases.

E. Fine-tuning Optical Flow
For all our experiments above, we have always assumed a pre-computed optical flow field is provided as input. This optical flow, generated by the off-the-shelf PWCNet architecture [17], was fixed throughout training. In this section, we study the case when also the parameters of PwCNet are fine-tuned during training with the sparse depth loss. Table VIII shows the results of this evaluation. Interestingly, finetuning the parameters of PWCNet performs worse than fixing them. Such finding can be explained by the fact that the sparse depth loss is not sufficient to train the large number of PWCNet parameters. Indeed, we noticed a decrease in the training error of approximately 10%, indicating an over-fitting to the observed training points. As an additional baseline, we add to PWCNet a small convolutional head to convert flow to depth and train everything with the sparse depth loss. The convolutional head consists of three convolution with (32,16,1) number of filters, stride 1 and filter size 3. The result of this approach, presented in the first row of Table VIII, confirms that the sparse loss does not provide enough feedback to fine-tune correspondences.

F. Qualitative Results
We show more qualitative results of depth estimation on the test set of our evaluation datasets in Fig. 7, Fig. 8 and Fig. 9. Despite being trained with very sparse supervision, our approach learns to predict smooth depth maps with sharp  edges, comparable to the ones an encoder-decoder architecture learns with dense supervision. In contrast, an encoder-decoder architecture fails to learn smooth depths when trained with sparse supervision. Fig. 10 shows some of the filters produced by the local network to convert optical flow into depth. Since converting flow to depth depends on the relative transformation between the two views, those filters are input-dependent. Generally, filters are different for each image pair. However, when the relative transformation between the input views is similar, filters also tend to be similar (first and second row of Fig. 10). In contrast, when the relative transformation between views is completely different, filters tend to acquire a dissimilar pattern (first and third row of Fig. 10). Qualitative results on RGB-D. Also this dataset represents a challenge for all methods, given the large baseline between views, noisy correspondences and noisy training depth maps. Nonetheless, our approach is still able to estimate sharp depth maps, sometimes capturing fine details which even an encoder-decoder trained with dense supervision fails to catch (bottom-row).
Image Pair and Local Network Filters Fig. 10. Local network filters generated by several image pairs. Generally, filters are different for each image pair. However, when the relative transformation between the two views is similar, filters also tend to be similar (first and second row). In contrast, when the relative transformation is completely different, filters tend to have a dissimilar pattern (first and third row).