Skip to main content

Car Detection and Counting Project

In this post I'll tell about conflicting issues in vehicle detection and counting project on GitHub and its sync and run on Windows.
Original project link is here = https://github.com/ahmetozlu/vehicle_counting_tensorflow.This project written by Python language on Linux OS.

There are the versions of my PC OS ,Python Language and some Python's Libraries
Python 3.5
Windows 10 Pro
Opencv 3.4.1.15
Numpy 1.14.5
TensorFlow 1.8.0
Scipy 1.1.0

I used to Visual Studio Code as code editor

After the open the original project link click download to project then,at debugging there are the conflicting issues and solutions in ongoing lines step by step:

1.problem = TabError: inconsistent use of tabs and spaces in indentation
Solution = on the Visual Studio Code click "Alt + Shift + F"(converting tabs into spaces)

2. problem = No module name "image_utils"
Solution = I had the to add the utils directory and subfolders PYTHONPATH

3. problem = Cannot import module name "image_saver"
Solution =Let's say I have:
myapp/__init__.py
myapp/myapp.py
myapp/myapp/SomeObject.py
myapp/tests/TestCase.py

              Now if we are trying to get something like this
myapp.py
===============
from myapp import SomeObject
#operations...

TestCase.py
===============
from myapp import SomeObject
#tests

We will see that error
ImportError: No module named 'myapp'

Cause of that routine problem of Python I moved some utilies files path in utils file.

change image_saver.py path then change import lines

4.problem = Some modules same problem(no module name or cannot import module)
Solution = change the .py files path on utils folder

5.problem =Some lines in  knn_classifier.py(While running the program can see video just 3 seconds then disappear)
Solution = it depends on the Python version; read the files not "rb", be "r"  and
not "all_possible_neighbors.iteritems()" ==> "all_possible_neighbors.items"

My project(forked and with commits) project link is here = https://github.com/OnurBerkayDogan/vehicle_counting_tensorflow

Comments

  1. Instead of moving files to utils path you could add the following lines to vehicle_detection_main.py (after import sys line):

    sys.path.insert(0, './utils')
    sys.path.insert(0, './utils/image_utils')
    sys.path.insert(0, './utils/color_recognition_module')

    I tried it, it works.

    ReplyDelete

Post a Comment

Popular posts from this blog

Outmoded Opinions from Old-fashioned Basketball

      " Mehmet Okur became someone else and a player when he shots a little bit in the NBA. He escaped the harshness, wanted to play outside. Ibrahim Kutluay shoots better than you until he dies. If he misses, you will get that rebound. What if you miss, who will get the rebound?"      These words are a fragment from the interview with Bogdan Tanjevic made in January and published in Socrates magazine which one of the Turkey's leading sports magazine.  FYI, Bojdan Tanjevic was the coach of Turkey's National Basketball team between 2003 - 2014.  Tanjevic      First of all, I want to talk about the thing that attracted my attention the most in the interview. " When he shots a little bit in the NBA... "   A little??? We have to ask that little bit to Utah Jazz.  Memo is one of two or three players with the best shots in the NBA among players with 2.10 and above. I'm talking about all times, not just when he was play...

DEBRIS Pt1.

    In the first two matches of the tournament, which went with great hopes after the fantastic wins against the top countries in European football and the tactically well planned off-the-ball game plan, we encountered an unplanned, soulless and physically exhausted national team. Well, was it obvious that this would happen, did we as a nation deceive ourselves with unnecessary words and expressions, or did we not do the tactical and physical work that we needed to do in the preparation process before the tournament? Of course, it is impossible to know these as an outside observer, so it will be an article where I completely give my personal thoughts and observations.      We played the first match of the group in Rome against Italy, which had a 27-game unbeaten streak under Roberto Mancini.  Against us was Italy, who was physically strong, had a high midfield quality and played a fast paced game.  Despite being shown as one of the favorites of t...