Closed Tdoe4321 closed 5 years ago
self.rate
is defined in the constructor. https://github.com/SteveMacenski/jetson_nano_detection_and_tracking/blob/master/jetson_live_object_detection.py#L19
Shoot, you're totally right. It looks like I accidentally deleted that line when I was changing some stuff around. I added the ability to use a USB webcam instead of the MIPI one.
I also just re-added in the rate initialization line and I'm getting an error because of a negative value for
self.rate - capture_duration
meaning that my capture duration is bigger than my desired rate. You might want to add a check in there for negative values.
Fair enough -- PRs are always welcome. I didnt actually expose that parameter so really unless you're messing with code it should just work :wink:
I believe in "jetson_live_object_detection.py" you call self.rate in your main loop where you're trying to throttle the capture speed. You call:
time.sleep(self.rate - capture_duration)
But you don't initialize self.rate anywhere and it gave me an error when I tried to run it. I just took it out and it ran fine.