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.