roboflow / roboflow-python

The official Roboflow Python package. Manage your datasets, models, and deployments. Roboflow has everything you need to build a computer vision application.
https://docs.roboflow.com/python
Apache License 2.0
271 stars 70 forks source link

Mypy error: `InferenceModel` subclasses does not respect superclass signature #270

Closed iurisilvio closed 1 month ago

iurisilvio commented 2 months ago

Hard to fix, because it probably breaks compatibility.

roboflow/models/video.py:59: error: Signature of "predict" incompatible with supertype "InferenceModel"  [override]
roboflow/models/video.py:59: note:      Superclass:
roboflow/models/video.py:59: note:          def predict(self, image_path: Any, prediction_type: Any = ..., **kwargs: Any) -> Any
roboflow/models/video.py:59: note:      Subclass:
roboflow/models/video.py:59: note:          def predict(self, video_path: str, inference_type: str, fps: int = ..., additional_models: Optional[List[Any]] = ...) -> Tuple[str, str]
roboflow/models/video.py:127: error: "VideoInferenceModel" has no attribute "inference_type"  [attr-defined]
roboflow/models/semantic_segmentation.py:21: error: Signature of "predict" incompatible with supertype "InferenceModel"  [override]
roboflow/models/semantic_segmentation.py:21: note:      Superclass:
roboflow/models/semantic_segmentation.py:21: note:          def predict(self, image_path: Any, prediction_type: Any = ..., **kwargs: Any) -> Any
roboflow/models/semantic_segmentation.py:21: note:      Subclass:
roboflow/models/semantic_segmentation.py:21: note:          def predict(self, image_path: str, confidence: int = ...) -> Any
iurisilvio commented 1 month ago

I "fixed" it ignoring the errors.