Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.10 : TypeError #1

Open
aminalaghband opened this issue Jun 9, 2024 · 5 comments
Open

Python 3.10 : TypeError #1

aminalaghband opened this issue Jun 9, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@aminalaghband
Copy link

/workspace/vehicle_detection_tracker/examples/OpenCvTrackerTest.py", line 19, in

vehicle_detection.process_video(video_path, result_callback = result_callback)

File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/VehicleDetectionTracker/VehicleDetectionTracker.py", line 291, in process_video

response = self.process_frame(frame, timestamp)

File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/VehicleDetectionTracker/VehicleDetectionTracker.py", line 195, in process_frame

delta_t = int(t2) - int(t1)

TypeError: int() argument must be a string, a bytes-like object or a real number, not 'datetime.datetime'

we need to change the package code,
delta_t = t2.timestamp() - t1.timestamp()

@sergio11 sergio11 self-assigned this Jun 9, 2024
@sergio11 sergio11 added the bug Something isn't working label Jun 9, 2024
@sergio11
Copy link
Owner

sergio11 commented Jun 9, 2024

Hi @cryptoer-satoshi,

Thanks for reporting this issue. It seems that the error is related to converting datetime objects to integers in the VehicleDetectionTracker.py file.

To assist you better, could you please provide examples of the data you're working with when this error occurs? This will help us understand the context in which it's happening and how we can address it more effectively.

Looking forward to your response so we can continue working on a solution.

Thank you!

@aminalaghband
Copy link
Author

Hi sergio11

I was working with mp4 file which was the input, so I get this error :
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'datetime.datetime'
then I tried to change package line from:
delta_t = int(t2) - int(t1)
to this :
delta_t = t2.timestamp() - t1.timestamp()
so, it works well,

by the way, thank you for great work.

@wimdecorte
Copy link

Same issue for me:

File "/Users/wdecorte/Documents/GitHub/vehicle-detection-fastapi/.venv/lib/python3.9/site-packages/VehicleDetectionTracker/VehicleDetectionTracker.py", line 195, in process_frame delta_t = int(t2) - int(t1) TypeError: int() argument must be a string, a bytes-like object or a number, not 'datetime.datetime' INFO: Shutting down

I was processing an mp4 file locally.

@sergio11
Copy link
Owner

Hi @wimdecorte

Could you test with the last version 0.0.32? This issue is already fixed in this version which I just launched

@wimdecorte
Copy link

Hi @sergio11 ,

That was using 0.0.32. Changing line 195 fixes the issue as per @cryptoer-satoshi 👍

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants