kaylode/vehicle-counting

colab error

VYRION-Ai opened this issue · 3 comments

`content/main
Traceback (most recent call last):
File "run.py", line 1, in
from utilities.getter import *
File "/content/main/utilities/init.py", line 1, in
from .getter import *
File "/content/main/utilities/getter.py", line 1, in
from networks import *
File "/content/main/networks/init.py", line 1, in
from .yolo import get_model
File "/content/main/networks/yolo.py", line 6, in
from augmentations import MEAN, STD
File "/content/main/augmentations/init.py", line 1, in
from .transforms import *
File "/content/main/augmentations/transforms.py", line 1, in
import cv2
File "/usr/local/lib/python3.7/dist-packages/cv2/init.py", line 9, in
from .cv2 import _registerMatType
ImportError: cannot import name '_registerMatType' from 'cv2.cv2' (/usr/local/lib/python3.7/dist-packages/cv2/cv2.cpython-37m-x86_64-linux-gnu.so)

`

i got this error when running your colab , and also it didnot work in my pc

According to this https://stackoverflow.com/questions/70537488/cannot-import-name-registermattype-from-cv2-cv2
Please try this on colab

!pip uninstall opencv-python-headless
!pip install opencv-python-headless==4.1.2.30

i add the code , it run but it create a other error after finishing , it did not create the video successfully , but it create the csv file

`Fusing layers... 
Model Summary: 213 layers, 7020913 parameters, 0 gradients
Adding AutoShape... 
100% 885/885 [02:39<00:00,  5.54it/s]
/content/main/main/utilities/counting/bb_polygon.py:124: RuntimeWarning: invalid value encountered in double_scalars
  return tmp1/tmp2
  0% 0/885 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "run.py", line 48, in <module>
    main(args, config)
  File "run.py", line 30, in main
    pipeline.run()
  File "/content/main/main/modules/__init__.py", line 98, in run
    polygons=videocounter.polygons)
  File "/content/main/main/modules/datasets.py", line 145, in write_full_to_video
    outvid=self.outvid
  File "/content/main/main/utilities/counting/utils.py", line 319, in visualize_merged
    img = draw_anno(img, zones, directions)
  File "/content/main/main/utilities/counting/utils.py", line 116, in draw_anno
    image = draw_arrow(image, points[0], points[1], colors[5])
  File "/content/main/main/utilities/counting/utils.py", line 8, in draw_arrow
    image = cv2.line(image, start_point, end_point, color, 3)
SystemError: new style getargs format but argument is not a tuple`

i have fixed the issue in the recently commit.