Giter VIP home page Giter VIP logo

ivy's People

Contributors

amin-tgz avatar basedrhys avatar dependabot-preview[bot] avatar dependabot[bot] avatar jonathansamelson avatar nicholaskajoh avatar yemikudaisi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ivy's Issues

Error when running in colab: cannot connect to X server

I set the colab environment up according to instructions and when I went on to run the main file, i got this error : cannot connect to X server which is what pops up when there is no display to connect to. Is there any way to remove this display option and simply record the output somewhere, so that this might be working in a server?
Just for information, I used the --record argument as well.

recipe for target 'obj/convolutional_kernels.o' failed

Hi @nicholaskajoh,

I would like to use the demo of your repo but I'm gettin the following error when running make once I cloned the darknet repo and installed its dependencies in order to use YOLO. Also, I am using Ubuntu 18.04.1.

$ sudo make
nvcc  -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -Iinclude/ -Isrc/ -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DGPU" -c ./src/convolutional_kernels.cu -o obj/convolutional_kernels.o
nvcc fatal   : Path to libdevice library not specified
Makefile:92: recipe for target 'obj/convolutional_kernels.o' failed
make: *** [obj/convolutional_kernels.o] Error 1

I supposed it could be something wrong with CUDA's path as suggested by this comment. Since the path in the Makefile its the same in /usr/local/cuda/include/

ifeq ($(GPU), 1) 
COMMON+= -DGPU -I/usr/local/cuda/include/
CFLAGS+= -DGPU
LDFLAGS+= -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand
endif

Tried the following command export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}} as mentioned but could not fix it.

Any suggestion of what I'm doing wrong will be appreciated

Joblib Parallel is actually slowing down tracker update

First of all, I want to say that this is a wonderful project and I had a blast experimenting with it. Thank you very much.

However, one thing I noticed is that I was able to get a higher FPS (YOLO detector) when I switched out Joblib's Parallel code with just an ordinary for-loop at ObjectCounter.py (the line where you update_blob_tracker for every blob in blobs_list).

Is this a problem on my hardware (Windows, 8 core CPU, in case it is relevant)? Or is the overhead cost of parallelism outweighs the cost to update blobs' trackers?

Thank you in advance.

From where to Download all these files

WEIGHTS_PATH=/home/nicholas/dev/Vehicle-Counting/detectors/yolo/downloads/yolov3.weights
CONFIG_PATH=/home/nicholas/dev/Vehicle-Counting/detectors/yolo/downloads/yolov3.cfg
CLASSES_PATH=/home/nicholas/dev/Vehicle-Counting/detectors/yolo/downloads/coco.classes.txt
CLASSES_OF_INTEREST_PATH=/home/nicholas/dev/Vehicle-Counting/detectors/yolo/downloads/coco_interest.classes.txt

Branch for proposed module

Hey, can you create a branch for the proposed module as discussed ? I've made some progress already would be creating a PR soon.

I get this error when I clone. Can you please help?

(base) PS C:\Users\poorn\Downloads\Vehicle-Counting-master\Vehicle-Counting-master> python Vehicle_Counting.py "./videos
/sample_traffic_scene.mp4"
Traceback (most recent call last):
File "Vehicle_Counting.py", line 6, in
from detectors.detector import get_bounding_boxes
File "C:\Users\poorn\Downloads\Vehicle-Counting-master\Vehicle-Counting-master\detectors\detector.py", line 5, in
from detectors.tfoda.tfoda_detector import get_bounding_boxes as tfoda_gbb
File "C:\Users\poorn\Downloads\Vehicle-Counting-master\Vehicle-Counting-master\detectors\tfoda\tfoda_detector.py", line 13, in
with open(os.getenv('CLASSES_PATH'), 'r') as classes_file:
TypeError: expected str, bytes or os.PathLike object, not NoneType

ModuleNotFoundError: No module named 'utils.detection_roi'

Hello. Love the project so far. However, followed the readme exactly as you typed it by cloning/downloading the latest version as of today. I also installed all pre-requisites.

However, when I run it, I get the following error:
Traceback (most recent call last):
File "Vehicle_Counting.py", line 11, in
from utils.detection_roi import get_roi_frame, draw_roi
ModuleNotFoundError: No module named 'utils.detection_roi'

Because I downloaded the whole thing and am running from the folder structure as you have it layed out, I have confirmed that there is a utils folder and inside of the folder is the detection_roi file in there so I cannot figure out why it says not found.

Thanks!

Question on missing files

Hi,

would like to use your project for some local traffic analysis. I downloaded everything and followed the instructions. Installed YOLA.
I modified the .env.example file to just keep the YOLA detection stuff. However there are a number of file references that are not in the download (/data). Presumably I will need to copy from YOLA somewhere but I cannot find files with thos names and I do not know which files I should use/copy.

HAAR_CASCADE_PATH="./data/detectors/haarcascade/car.xml"
YOLO_CLASSES_PATH="./data/detectors/coco_classes.txt"
YOLO_CLASSES_OF_INTEREST_PATH="./data/detectors/coco_classes_of_interest.txt"

Please give me a clue. Thanks!

ps. Running this on Ubuntu 18.

Project license

Hey nicholas, please whats the license for the this project ?

How to run this

Hello i am very new to this can you guide me how i can run it on simple video or webcam, yolo as detector. Thanks

I got Error when i try to run code.

Path to video file not set.
YOLO_WEIGHTS_PATH, YOLO_CONFIG_PATH, YOLO_CLASSES_PATH, YOLO_CLASSES_OF_INTEREST_PATH, and/or YOLO_CONFIDENCE_THRESHOLD not set or invalid.
Traceback (most recent call last):
File "main.py", line 14, in
import settings
File "D:\Project1\ivy-master\settings.py", line 214, in
raise Exception('One or more environment variables are either invalid or not set. ' +
Exception: One or more environment variables are either invalid or not set. Please ensure all variables are properly set.

init_logger() issue

I am getting the following error when I try to run the main program -

E:\ivy>python -m main
Traceback (most recent call last):
File "C:\Users\sriks\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\sriks\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "E:\ivy\main.py", line 21, in
init_logger()
File "E:\ivy\util\logger.py", line 59, in init_logger
file_formatter = CustomJsonFormatter('(created) (logger) (level) (message)')
File "C:\Users\sriks\AppData\Local\Programs\Python\Python39\lib\site-packages\pythonjsonlogger\jsonlogger.py", line 112, in init
logging.Formatter.init(self, *args, **kwargs)
File "C:\Users\sriks\AppData\Local\Programs\Python\Python39\lib\logging_init
.py", line 570, in init
self.style.validate()
File "C:\Users\sriks\AppData\Local\Programs\Python\Python39\lib\logging_init
.py", line 423, in validate
raise ValueError("Invalid format '%s' for '%s' style" % (self._fmt, self.default_format[0]))
ValueError: Invalid format '(created) (logger) (level) (message)' for '%' style

HEADLESS=True yet recieving GStreamer warnings

@nicholaskajoh, I really appreciate your project.

An issue I am experiencing is I'm still receiving GStreamer warnings despite the HEADLESS=True setting in the .env file (I used the .env.example).

The error I received when I typed python3 -m main is as follows:

Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
[ WARN:0] global /tmp/pip-install-oxrr8sjq/opencv-contrib-python/opencv/modules/videoio/src/cap_gstreamer.cpp (1761) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module qtdemux0 reported: Internal data stream error.
[ WARN:0] global /tmp/pip-install-oxrr8sjq/opencv-contrib-python/opencv/modules/videoio/src/cap_gstreamer.cpp (888) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /tmp/pip-install-oxrr8sjq/opencv-contrib-python/opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[2021-01-13 16:12:27,023] ERROR   : Invalid video source ./data/videos/sample_traffic_scene.mp4 {'label': 'INVALID_VIDEO_SOURCE'}

The file sample_traffic_scene.mp4 is there though in the proper directory (I downloaded it from the Google Drive link given in README).

I'm running it on Ubuntu on a Jetson Nano. Python 3 version 3.6.9

Error trying to run the detector

SIr thank you for sharing this awesome project. I have a problem trying to running this project, I successfully passed the python -m pytest command even the python -m main command but when it "detects" something in this case a car I have this issue:

File "/home/davo/Downloads/TProjects/ivy/main.py", line 111, in run
object_counter.count(frame)
File "/home/davo/Downloads/TProjects/ivy/ObjectCounter.py", line 74, in count
self.blobs = add_new_blobs(_bounding_boxes, _classes, _confidences, self.blobs, self.frame, self.tracker, self.mcdf)
File "/home/davo/Downloads/TProjects/ivy/tracker.py", line 66, in add_new_blobs
_tracker = get_tracker(tracker, box, frame)
File "/home/davo/Downloads/TProjects/ivy/tracker.py", line 40, in get_tracker
return _kcf_create(bounding_box, frame)
File "/home/davo/Downloads/TProjects/ivy/tracker.py", line 30, in _kcf_create
tracker.init(frame, tuple(bounding_box))
TypeError: integer argument expected, got float

I am trying to debug this problem but I think I am stuck. I am using yolo as my detection algorithm. Thank you sir.

Error in path to 'WEIGHTS_PATH' and 'CONFIG_PATH'

It's giving error like this : Vehicle-Counting-master/detectors/yolo/yolo_detector.py", line 20, in get_bounding_boxes
net = cv2.dnn.readNet(os.getenv('WEIGHTS_PATH'), os.getenv('CONFIG_PATH'))
cv2.error: OpenCV(4.1.0) /io/opencv/modules/dnn/src/dnn.cpp:3780: error: (-2:Unspecified error) Cannot determine an origin framework of files: in function 'readNet'

Please help me to resolve this

Multi Object Tracking

How to Track multiple Objects. It is showing that cv2.cv2 has not attribute TrackerCSRT_create.

Please help

OS dependency

Hey, is it correct that .env files are only usable on Linux based distributions?

Is there a way to use this on Windows - e.g. you could determine the os at the start and then just use default variables instead of the os.getenv command. If needed, I or other users could switch these out. It would be great for a more flexible usage regarding OS.

Thanks.

Not able to run

Hi

I have tried by cloning your repository.... getting erros as follows:

(i) If i run "python -m main" in terminal --> ImportError: No module named detectors.detector

(ii) If i run "python3 main.py" in terminal --> ModuleNotFoundError: No module named 'dotenv'

Thanks in advance

Adding a custom detector

How can we add a custom detector to this module? I have a faster RCNN based detector which I added as a python file having the exact get_bounding_boxes() function which returns the bounding boxes, scores and the classes. I added it in the detectors directory but when I run the main.py file it gives:
"ERROR : Invalid detector model, algorithm or API specified (options: yolo, tfoda, detectron2, haarcascade) {'label': 'INVALID_DETECTION_ALGORITHM'}"
I checked in the .env file but I cannot seem to find what path may be added for the detector to run my fasterrcnn.py file instead of the given yolo.py, tfoda.py etc.
Could you help me out with this one?

Invalid format '(created) (logger) (level) (message)' for '%' style

Traceback (most recent call last):
File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "D:\nicholaskajoh-ivy-137884b\main.py", line 21, in
init_logger()
File "D:\nicholaskajoh-ivy-137884b\util\logger.py", line 59, in init_logger
file_formatter = CustomJsonFormatter('(created) (logger) (level) (message)')
File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pythonjsonlogger\jsonlogger.py", line 112, in init
logging.Formatter.init(self, *args, **kwargs)
File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\logging_init
.py", line 576, in init
self.style.validate()
File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\logging_init
.py", line 429, in validate
raise ValueError("Invalid format '%s' for '%s' style" % (self._fmt, self.default_format[0]))
ValueError: Invalid format '(created) (logger) (level) (message)' for '%' style

Does anyone faced with this issue when trying to run the program?

output

after all the setup then run the code we found video processing too slow. how can improve the video processing or video speed rate

The process of video detection and counting is very low

hi, thanks for your job , when I use this demo , The process of video detection and counting is very low! FPS is very low。。。 why? And I found it nothing to do with gpu。。。。My gpu is 2080TI。 I tried to reduce the detection interest category, but it can't useful
So could you help me solve this problem? Thank you very much

ERROR in debug mode

Hello! In debug mode after running for sometime your software halts and exits with the following error on the terminal.

OpenCL error CL_INVALID_COMMAND_QUEUE (-36) during call: clEnqueueNDRangeKernel('tmm', dims=2, globalsize=640x10x1, localsize=64x1x1) sync=true
OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.1.0) Error: Unknown error code -220 (OpenCL error CL_INVALID_COMMAND_QUEUE (-36) during call: clEnqueueMapBuffer(handle=2F5917C8, sz=1443360) => 00000000) in cv::ocl::OpenCLAllocator::deallocate_, file C:\projects\opencv-python\opencv\modules\core\src\ocl.cpp, line 4881

Please have a look at it. Thanks !!

Vehicle ID & exlcude counting

Dear Author,

When executing this vehicle counter, vehicle ID is in hex format. How do I use normal IDs like 1,2,3.. etc instead of this format to track the same. Could you please suggest a workaround ?

Also, I am trying to use this approach to just track the vehicle in a ROI and do not want to count at the moment. I have excluded the counting part (attempt_count module) and just based on the mctf threshold I am deleting (del self.blobs[blob_id]) or just retaining the blob as such (self.blobs[blob_id] = blob) inside the loop blob_list. Is there any thing else I just should be paying attention to so the IDs are retained and tracked ?

Thank you !

Anyone run this using YOLOv5 object detector?

Hello everyone and thank you @nicholaskajoh for this amazing repo. Wondering has anyone implemented this using the yolov5 object detector? The reason I ask is because I'm a little confused about the part mentioned to "Create a .env file (based on .env.example) in the project's root directory and edit as appropriate." How would that look like for a yolov5 model?

Regards,
Abu

TypeError: expected str, bytes or os.PathLike object, not NoneType

TypeError: expected str, bytes or os.PathLike object, not NoneType

(ivy) PS C:\Users\Administrator\ivy> python main.py
Traceback (most recent call last):
File "main.py", line 143, in
init_logger()
File "C:\Users\Administrator\ivy\util\logger.py", line 55, in init_logger
pathlib.Path(log_files_directory).mkdir(parents=True, exist_ok=True)
File "D:\ProgramData\Anaconda3\envs\ivy\lib\pathlib.py", line 983, in new
self = cls._from_parts(args, init=False)
File "D:\ProgramData\Anaconda3\envs\ivy\lib\pathlib.py", line 640, in _from_parts
drv, root, parts = self._parse_args(args)
File "D:\ProgramData\Anaconda3\envs\ivy\lib\pathlib.py", line 624, in _parse_args
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

It does not seem that the detector properly updates the tracker.

Love the project, works great for the most part. However, I have seen many times during my testing that two main things happen and I am not sure how/why:

  1. The bounding box initially will be far too large or not size properly to the vehicle but will not update and correct itself on subsequent detections.
  2. More importantly, I have seen times where cars will be tracking and leave the video frame but the bounding box gets left behind on the frame. It will stay there for a very long time, many times until another car comes by and then the bounding box that was left behind from the last car will snap to the new car.

Both of these issues lead me to believe that the detector is not updating the tracker all of the time. I have the detection interval set to 5 and the tracking failures set to 15. The tracking failures never seem to get to 15. But, if a detection happens every 5 frames and there is no car anymore, why does the tracker keep a bounding box hanging around for a very long time? It seems to me that if the detector does not detect a car anymore, the bounding box/tracker can be removed? I know we have to be careful here because the detector could normally miss a detection every so often and the goal of the tracker is to keep tracking when this happens but it seems that there should be a timeout or something where after several missed detections, we can then go ahead and remove?

These two issues are causing some cars to be missed when crossing the line.

Also, I have tried both KCF and CSRT trackers along with both SSD and YOLO detectors, in many different combinations and the issues seem to still happen which tells me that the issue isn't with the tracker or detector but rather, the code that ties the two together.

Thoughts? Thanks!

Tracker module installation

Hi,

I have gone through document. It is really interesting. I am unable tracker module. I am getting the following error.ImportError: cannot import name 'izip_longest'. Can you help me to proceed further

error of yolo weight path

Hi, Can anyone help me to solve this out?

Traceback (most recent call last):
File "Vehicle_Counting.py", line 168, in
vehicle_counter = VehicleCounter(frame, detector, tracker, droi, args.showdroi, mcdf, mctf, di, args.clposition)
File "Vehicle_Counting.py", line 38, in init
initial_bboxes = get_bounding_boxes(droi_frame, self.detector)
File "/content/drive/MyDrive/Colab Notebooks/summer1/Vehicle-Counting/detectors/detector.py", line 4, in get_bounding_boxes
return yolo_gbb(frame)
File "/content/drive/MyDrive/Colab Notebooks/summer1/Vehicle-Counting/detectors/yolo/yolo_detector.py", line 16, in get_bounding_boxes
net = cv2.dnn.readNet(os.path.join(location, 'yolov3.weights'), os.path.join(location, 'yolov3.cfg'))
cv2.error: OpenCV(4.1.0) /io/opencv/modules/dnn/src/darknet/darknet_importer.cpp:214: error: (-212:Parsing error) Failed to parse NetParameter file: /content/drive/MyDrive/Colab Notebooks/summer1/Vehicle-Counting/detectors/yolo/yolov3.weights in function 'readNetFromDarknet'

Ask about IDE

Hi nicholas,
Which IDE are you using for this code?
Best Regards,
PeterPham

Help me to run this code.

I'm new to this can u help me to run this code.when I download the zip.i got many errors .like path not set.I changed the path of video to my respective path but again showing errors.

coco_interest_class.txt

hi, thanks for your great job. When I used tfoda for vehicle detection and counting, I encounted some problems that maybe need your help. I want to how to get the file 'coco.classes.txt' and 'coco_interest.class.txt'.
Thanks a lot in advance.

Yolo+KCF is faster than Yolo + SORT

This ivy project is very good!

everyone says that SORT is faster than KCF.
But in my another project that i used Yolo + SORT, i found that the KCF in this repo is faster than SORT
Why is that?

yolov3.weights

Hi, I'm trying to run your project and followed the instruction in setup but can't seem to get it to work. Apparently, I still needs to get the pretrained Yolo3 weights from another source.

So I suggest you state it in the setup and add a source to the weight as well.
I think it can be gotten from by running wget https://pjreddie.com/media/files/yolov3.weights

Just to be sure, is it the same weight you used ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.