Open sinopec opened 2 months ago
@sinopec When you are using view_img=False, then your cv2 window won't be opened then just install opencv-python-headless. If you using own user interface then install this library 'pip install opencv-python-headless'.
Search before asking
Ultralytics YOLO Component
Other
Bug
I use the solutions.ObjectCounter for object counting ,but in background app, without a user interface,. So I set view_img=False, when init ObjectCounter, But the app crashed unexpected. And I track the program, found it crash in utils/checks.py:check_imshow. I think when i set view_img=False, we should not check the imshow again.
Environment
Ultralytics YOLOv8.2.78 π Python-3.8.10 torch-2.1.1+cu121 CUDA:0 (NVIDIA GeForce RTX 3090, 24260MiB) Setup complete β (16 CPUs, 62.5 GB RAM, 433.5/467.9 GB disk)
OS Linux-5.15.0-119-generic-x86_64-with-glibc2.29 Environment Linux Python 3.8.10 Install pip RAM 62.52 GB CPU 11th Gen Intel Core(TM) i7-11700 2.50GHz CUDA 12.1
numpy β 1.24.4<2.0.0,>=1.23.0 matplotlib β 3.7.2>=3.3.0 opencv-python β 4.6.0.66>=4.6.0 pillow β 10.3.0>=7.1.2 pyyaml β 6.0>=5.3.1 requests β 2.32.2>=2.23.0 scipy β 1.8.1>=1.4.1 torch β 2.1.1>=1.8.0 torchvision β 0.16.1>=0.9.0 tqdm β 4.64.1>=4.64.0 psutil β 5.9.5 py-cpuinfo β 9.0.0 pandas β 1.4.3>=1.1.4 seaborn β 0.11.2>=0.11.0 ultralytics-thop β 2.0.3>=2.0.0
Minimal Reproducible Example
counter = solutions.ObjectCounter( view_img=False, reg_pts=roi_xy, names=self.model.names, draw_tracks=False, line_thickness=2, )
Additional
No response
Are you willing to submit a PR?