Code Monkey home page Code Monkey logo

Comments (31)

ChampionTej05 avatar ChampionTej05 commented on August 18, 2024 4

from vehicle_counting_tensorflow.

ChampionTej05 avatar ChampionTej05 commented on August 18, 2024 1

There are 3 files, which are concerned with change in ROI. Firstly, since the code provided in vehicle_detection.py is done hardcoded for sample video, as written in comments. So to make it work for your own video,

  1. find the below in vehicle_detection.py file. Here in putline function, instead of (640,200) write (widthOfFrame, ROI_Location).
if counter==1:
cv2.putline(...)
  1. The second change needed is in utils.visualization file, change the value of ROI to your suitable values
  2. Somehow, utils.speed_prediction.predict_speed function is not been able to get the ROI value passed to it by utils.visualization file, hence just manually set roi_position=200 in the function.
    With above 3 steps you will be able to do it for your own video.

In the sample video, Direction of vehicles is DOWN, so if your video has UP direction (Back Face of Vehicle) then you have to change the logic in utils.speed_prediction.predict_speed function. Find the line
where is_vehicle_detected.insert(0,1) is written. In the IF condition, instead of (bottom) just write (top) and also 10 lines down, where speed is calculated, change bottom_position_of_detected_vehicle.insert(0,top)

If you need the modified code, let me know.

from vehicle_counting_tensorflow.

venkateshbabusekar avatar venkateshbabusekar commented on August 18, 2024 1

Hi @ChampionTej05 It would be great if you could share the modified code.

Looking forward to hearing from you.
Best,
Venkatesh

from vehicle_counting_tensorflow.

ChampionTej05 avatar ChampionTej05 commented on August 18, 2024 1

@venkateshbabuekar this is the link for the zip file of the folder. Make sure you place the files in this folder in the research directory of object api. The accuracy of counting solely depends upon whether your model is able to detect the vehicle near the ROI. So analyze your video once and see which line in the frame is best suited where you get maximum detection.

https://drive.google.com/a/rknec.edu/file/d/1-6KgDYd1HPOdJc4okgcfDgpscbhNfItP/view?usp=drivesdk

from vehicle_counting_tensorflow.

ChampionTej05 avatar ChampionTej05 commented on August 18, 2024 1

from vehicle_counting_tensorflow.

ChampionTej05 avatar ChampionTej05 commented on August 18, 2024 1

Video on which I am running my project is confidential, so I can't share it. You can use any video of traffic.

from vehicle_counting_tensorflow.

ChampionTej05 avatar ChampionTej05 commented on August 18, 2024 1

Leave your email, I will share you personally.

from vehicle_counting_tensorflow.

tech123master avatar tech123master commented on August 18, 2024

Hi. I am having the same issue. When I use a different video I am not able to get any output. I tried to change ROI values but even then it did not work.

Would be nice to get a guide on how to run our own traffic videos using this project. Thanks :)

from vehicle_counting_tensorflow.

harshsp31 avatar harshsp31 commented on August 18, 2024

@venkateshbabusekar @ahmetozlu Did you get any solutions for this?

from vehicle_counting_tensorflow.

venkateshbabusekar avatar venkateshbabusekar commented on August 18, 2024

@harshsp31 Nope. I didn't have time to look into the code. Please do let me know if you're able to find the solution for the problem.

from vehicle_counting_tensorflow.

amaadmirza avatar amaadmirza commented on August 18, 2024

@ChampionTej05 give me access of your google drive to download code ....

from vehicle_counting_tensorflow.

amaadmirza avatar amaadmirza commented on August 18, 2024

@ChampionTej05 i want to change the ROI line vertically to detect vehicles and counting not horizontally kindly suggest possible settings .... waiting for your reply

from vehicle_counting_tensorflow.

amaadmirza avatar amaadmirza commented on August 18, 2024

@ChampionTej05 waiting for your reply....

from vehicle_counting_tensorflow.

amaadmirza avatar amaadmirza commented on August 18, 2024

@ChampionTej05 thanks for your help .... kindly share your sample video through google drive

from vehicle_counting_tensorflow.

amaadmirza avatar amaadmirza commented on August 18, 2024

ok no problem.. any other link of other traffic video that related to sample code .....!!

from vehicle_counting_tensorflow.

amaadmirza avatar amaadmirza commented on August 18, 2024

my email id: [email protected]

from vehicle_counting_tensorflow.

amaadmirza avatar amaadmirza commented on August 18, 2024

@ChampionTej05 where we can add kalman filter in this code ? i need to add kalman filter...

from vehicle_counting_tensorflow.

ChampionTej05 avatar ChampionTej05 commented on August 18, 2024

Provided you know how to add the kalman filter on Open CV Frame, you can just go and check out the line 200 in roi_detection.py file. input_frame variable is your Frame. Just add filter to this frame.

from vehicle_counting_tensorflow.

amaadmirza avatar amaadmirza commented on August 18, 2024

my question is about how to use because the object is bumping in the frame... is it apply to the frame or bounding boxes like this

            newboxes = []
            for box in boxes:
                box=kf.KalmanFilter.predict(box)
                kf.KalmanFilter.update(box)
                newboxes.append(box)
            boxes = newboxes 

from vehicle_counting_tensorflow.

ChampionTej05 avatar ChampionTej05 commented on August 18, 2024

According to the Documentation it should be applied to the boxes.

from vehicle_counting_tensorflow.

amaadmirza avatar amaadmirza commented on August 18, 2024

@ChampionTej05 i am using this github code

https://github.com/zziz/kalman-filter

for kalman filter but not successful could you plz help me to put kalman filter in your code...

from vehicle_counting_tensorflow.

amaadmirza avatar amaadmirza commented on August 18, 2024

@ChampionTej05 tried this kalman filter but not successfully integrate in it ..... need your help

from vehicle_counting_tensorflow.

i-am-manish avatar i-am-manish commented on August 18, 2024

This are the listed changes you would need. Roi_detection.py : ROI_POSITION= 1300 (you can set according to your frame size, if your frame size 1920 then set it to 1300) Around 277 line : cv2.line(input_frame, ( ROI_POSITION,0), (ROI_POSITION,height_img), (0, 0, 0xFF), 5) Visualization_utils.py: ROI_POSITION: should be same as above Around 181: Change the IF condition to : left < ROI_POSITION Speed_Prediction.py: Roi_position: Same as above Changes around line 39: many changes hence I am attaching file for it. I have attached other files also. You can check. Vehicle_tensorflow

This are the listed changes you would need. Roi_detection.py : ROI_POSITION= 1300 (you can set according to your frame size, if your frame size 1920 then set it to 1300) Around 277 line : cv2.line(input_frame, ( ROI_POSITION,0), (ROI_POSITION,height_img), (0, 0, 0xFF), 5) Visualization_utils.py: ROI_POSITION: should be same as above Around 181: Change the IF condition to : left < ROI_POSITION Speed_Prediction.py: Roi_position: Same as above Changes around line 39: many changes hence I am attaching file for it. I have attached other files also. You can check. Vehicle_tensorflow

Sir, can u provide access to this drive link
mailto : [email protected]
thanks

from vehicle_counting_tensorflow.

ChampionTej05 avatar ChampionTej05 commented on August 18, 2024

I have made the link public

from vehicle_counting_tensorflow.

i-am-manish avatar i-am-manish commented on August 18, 2024

from vehicle_counting_tensorflow.

sidharthskumar avatar sidharthskumar commented on August 18, 2024

I have made the link public

Sir, couldn't access says it requires permission

from vehicle_counting_tensorflow.

haiqalma avatar haiqalma commented on August 18, 2024

@ChampionTej05 i have changed all the roi position in vehicle_detection_main.py, speed_prediction.py and visualization_utils.py but still cannot counting vehicles, help me please :(
error

from vehicle_counting_tensorflow.

linchunmian avatar linchunmian commented on August 18, 2024

hi, @ChampionTej05 please give me access of your google drive to download code. Thanks in advanced.

from vehicle_counting_tensorflow.

ZIKO94ZIKO avatar ZIKO94ZIKO commented on August 18, 2024

@ChampionTej05 could you explain this lines please :

if isInROI: pixel_length = bottom - bottom_position_of_detected_vehicle[0] scale_real_length = pixel_length * 44 # multiplied by 44 to convert pixel length to real length in meters (chenge 44 to get length in meters for your case) total_time_passed = current_frame_number - current_frame_number_list[0] scale_real_time_passed = total_time_passed * 24 # get the elapsed total time for a vehicle to pass through ROI area (24 = fps) if scale_real_time_passed != 0: speed = scale_real_length / scale_real_time_passed / scale_constant # performing manual scaling because we have not performed camera calibration speed = speed / 6 * 40 # use reference constant to get vehicle speed prediction in kilometer unit current_frame_number_list.insert(0, current_frame_number) bottom_position_of_detected_vehicle.insert(0, right)

from vehicle_counting_tensorflow.

AbdullahKhanML avatar AbdullahKhanML commented on August 18, 2024

@ChampionTej05 i have changed all the roi position in vehicle_detection_main.py, speed_prediction.py and visualization_utils.py but still cannot counting vehicles, help me please :(
error

Did you find any solution to this, please?

from vehicle_counting_tensorflow.

lizhi501 avatar lizhi501 commented on August 18, 2024

https://drive.google.com/open?id=1i9_K06xxP_k5qBJ7QGFdvKMWwbzcq0J3
This are the listed changes you would need. Roi_detection.py : ROI_POSITION= 1300 (you can set according to your frame size, if your frame size 1920 then set it to 1300) Around 277 line : cv2.line(input_frame, ( ROI_POSITION,0), (ROI_POSITION,height_img), (0, 0, 0xFF), 5) Visualization_utils.py: ROI_POSITION: should be same as above Around 181: Change the IF condition to : left < ROI_POSITION Speed_Prediction.py: Roi_position: Same as above Changes around line 39: many changes hence I am attaching file for it. I have attached other files also. You can check. Vehicle_tensorflow

Hi @ChampionTej05, I was just wondering if you are still able to share the files what what else needs to change around line 39 in the speed_prediction.py file to change the ROI. I'm having trouble getting it to count vehicles when I change the ROI (either on the sample video, or on my own video).

Many thanks for all your help with this, you've done so much for people so far!

from vehicle_counting_tensorflow.

Related Issues (20)

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.