Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FPSMonitor.__call__ warning #1275

Open
1 task done
MubashirWaheed opened this issue Jun 11, 2024 · 3 comments
Open
1 task done

FPSMonitor.__call__ warning #1275

MubashirWaheed opened this issue Jun 11, 2024 · 3 comments
Labels
question Further information is requested

Comments

@MubashirWaheed
Copy link

MubashirWaheed commented Jun 11, 2024

Search before asking

  • 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 MubashirWaheed added the question Further information is requested label Jun 11, 2024
@LinasKo
Copy link
Collaborator

LinasKo commented Jun 11, 2024

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.

@MubashirWaheed
Copy link
Author

Yes setting the environment variable fixed it for me

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

@LinasKo
Copy link
Collaborator

LinasKo commented Jun 25, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants