Asks for the meaning of MiDaS evaluation mode

The code at MiDaS | PyTorch puts MiDaS into evaluation mode by calling

What exactly does evaluation mode do and when should you enable it?

During evaluation mode some layers will change their behavior and it’s used during the validation or test run of your model.
E.g. batchnorm layers will use the running stats to normalize the input activations instead of the batch stats (which are then used to update the running stats) as was done during training. Dropout layers will also be disabled during evaluation.

Internally, model.eval() will recursively set the flag of all nn.Modules to False and depending on the layer implementation this flag will be checked in the forward method to switch the behavior.

Note that calling model.eval() does not disable the gradient calculation. This is why your validation code usually also wraps the forward pass into the with torch.no_grad() guard in order to save memory.