How to add class filter in yolov8 tracker and zone counting #1100
Replies: 10 comments
-
Hi @Rizwanali324 👋 What versions of supervision are you using? If you do upgrade, here's the changes you'd need to make in the code:
Let me know how it goes! |
Beta Was this translation helpful? Give feedback.
-
I'm using |
Beta Was this translation helpful? Give feedback.
-
which version should i used |
Beta Was this translation helpful? Give feedback.
-
That is very old. I suggest the latest one - |
Beta Was this translation helpful? Give feedback.
-
ok. I updated it. one more question is my end goal is to only track and count the user input class and process the frame. which i implement later . I'm trying it . but i searched a lot and watched many videos on Robflow and supervision. its only works on images like only show users input classes and displaying the bounding box. but in CLI all the classes are displayed. will it affect the goal that i want to achieve |
Beta Was this translation helpful? Give feedback.
-
Good to hear it worked! Happy to help with your problem as well 🙂 I see you're already doing Can you explain in more details, how the "user input class" is created? Is that something the user selects? How much choice do users have? I don't understand the situation well enough, but upon guessing what you might mean, my intuition says that either a model that differentiates from different classes is needed, or a classification model to further distinguish between results. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
here is review paper. its my fyp . |
Beta Was this translation helpful? Give feedback.
-
I see the method for user selection - thanks. So there's one class at-a-time. Unfortunately, I won't have time to go through the paper :) Is the problem that all classes are detected? |
Beta Was this translation helpful? Give feedback.
-
Hi @LinasKo and @Rizwanali324 👋🏻 I'm converting this issue into a discussion and putting it in the Q&A section. |
Beta Was this translation helpful? Give feedback.
-
Search before asking
Question
How to add class filter in yolov8 tracker and zone counting
here is my code
I'm getting the following error
C:\Users\RizwanMLE\anaconda3\envs\yolov8\lib\site-packages\supervision\detection\core.py:175: FutureWarning: In the future
np.bool
will be defined as the corresponding NumPy scalar.if isinstance(index, np.ndarray) and index.dtype == np.bool:
Traceback (most recent call last):
File "c:/Users/RizwanMLE/Desktop/freelancing projects/cv/waleed_fyp/app/test2.py", line 157, in
detections = detections[detections.class_id == 0]
File "C:\Users\RizwanMLE\anaconda3\envs\yolov8\lib\site-packages\supervision\detection\core.py", line 175, in getitem
if isinstance(index, np.ndarray) and index.dtype == np.bool:
File "C:\Users\RizwanMLE\anaconda3\envs\yolov8\lib\site-packages\numpy_init_.py", line 305, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'bool'.
np.bool
was a deprecated alias for the builtinbool
. To avoid this error in existing code, usebool
by itself. Doing this will not modify any behaviorand is safe. If you specifically wanted the numpy scalar type, use
np.bool_
here.The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Additional
No response
Beta Was this translation helpful? Give feedback.
All reactions