nicholaskajoh / ivy

Video-based object counting software.
MIT License
428 stars 170 forks source link

Nice Project can you add counting based on Vehicle classification type like car, Bike, Truck, Bus?? #4

Closed amaadmirza closed 5 years ago

nicholaskajoh commented 5 years ago

Can you throw more light on what exactly you want to accomplish? Some detectors (yolo, ssd) can classify vehicles, others can't (bgsub, haarc). It's just a matter of changing a few lines of code to get the classification working but I need to know what you want to do/have in mind.

amaadmirza commented 5 years ago

mean if you separate count car, separte count truck and separate count bus when they cross the ROI

nicholaskajoh commented 5 years ago

Okay. It's possible. You can return bounding boxes along with the classes of objects detected. While this is easy to do, I feel it'll complicate the application as a whole. Any specific reason why you want this? I think a better approach would be to save images of each vehicle once counted to be processed by another program solely created for vehicle classification. Images may also be used for other purposes such as vehicle identification (ANPR).

Ashlin-Siby commented 5 years ago

@nicholaskajoh it would be great if you could tell where exactly to return the claass of the object?

nicholaskajoh commented 5 years ago

You can return the classes in _detectors/yolo/yolodetector.py like so:

_classes = [] # step 1

for output in outputs:
    for detection in output:
        # ...
        if confidence > 0.5 and classes[class_id] in classes_of_interest:
            # ...
            classes.append(classes[class_id]) # step 2
# ...
return _bounding_boxes, _classes # step 3