About the return type of BaseImageProcessor preprocess method implementations

So, I was reading the source code of the Clip model, and noticed that the type of the output of ClipImageProcessor.preprocess() is declared to be Pil.Image.Image (see e.g. here). Such a method is an implementation of the corresponding method in the BaseImageProcessor class. However, the original method declares its output type to be BatchFeature.

Since the very same thing happens in other models (e.g. XClip and vilt), this appear to be intentional, but I don’t understand why. Shouldn’t the type of the overriding method stay BatchFeature?

Many thanks for any clarification.

The change in the return type of the preprocess() method in the ClipImageProcessor class was probably made to more explicitly describe the data returned. Apparently, the developers decided that in this case it would be more appropriate to return an object of type Pil.Image.Image, which represents the image being processed. Perhaps this approach makes the code more understandable for other developers who may use this method.