andrewssobral / simple_vehicle_counting

Vehicle Detection, Tracking and Counting
496 stars 246 forks source link

Running Python Demo 'module' object has no attribute 'PixelBasedAdaptiveSegmenter' #20

Open blankered opened 7 years ago

blankered commented 7 years ago

I am having difficulties trying to get the Python Demo working. I had to change "from _-------- import ---------" lines in "build" to simply "from --------- import ---------" inorder to fix import errors. Unfortunately, I have gotten stuck at:

"from bgs.pbas import *" in the init.py file in the /bgs/pbas folder. When I try to run the demo file, I get

Traceback (most recent call last):
  File "./demo.py", line 17, in <module>
    segmenter = pbas.PixelBasedAdaptiveSegmenter()
AttributeError: 'module' object has no attribute 'PixelBasedAdaptiveSegmenter'

I am not sure how to debug this issue.

cygerts commented 6 years ago

You need to correctly install BGS library https://github.com/andrewssobral/bgslibrary. Firstly just run BGS library demo. Then import bgs into your code and it should load this method (you will just need to create empty "config" folder in project directory)