supervision icon indicating copy to clipboard operation
supervision copied to clipboard

FPSMonitor.__call__ warning

Open MubashirWaheed opened this issue 1 year ago • 3 comments

Search before asking

  • [X] I have searched the Supervision issues and found no similar feature requests.

Question

I keep getting the following warning in my console when I run the code SupervisionWarnings: __call__ is deprecated: FPSMonitor.callis deprecated and will be removed insupervision-0.22.0. Use FPSMonitor.fps instead Here is the code

// inside the custom sink class
`       def __init__(self, weights_path: str, zone_configuration_path: str, classes: List[int]):
        self._model = YOLO(weights_path, task="segment")
        self.fps_monitor = sv.FPSMonitor()

    def on_prediction(self, result: dict, frame: VideoFrame) -> None:
        self.fps_monitor.tick()
        fps = self.fps_monitor

I tried this one as well in the on_prediction function fps = self.fps_monitor.fps() but still gettinig the warning. What can I do to fix this? My console is filled with this warning and I can't see any other log supervision version : 0.21.0 Python: 3.11.8

Additional

No response

MubashirWaheed avatar Jun 11 '24 13:06 MubashirWaheed

I'll look into it, thanks for letting us know.

Meanwhile, if it gets annoying, setting the environmental variable SUPERVISON_DEPRECATION_WARNING=0 should suppress those.

LinasKo avatar Jun 11 '24 14:06 LinasKo

Yes setting the environment variable fixed it for me

import os
os.environ['SUPERVISON_DEPRECATION_WARNING'] = '0'

MubashirWaheed avatar Jun 12 '24 06:06 MubashirWaheed

Hi @MubashirWaheed,

By any chance, could you confirm the issue still persists? It was fixed in inference, and I can't find deprecated usage in supervision.

LinasKo avatar Jun 25 '24 07:06 LinasKo

Closing this as it seems to be fixed.

LinasKo avatar Nov 04 '24 11:11 LinasKo