SteveMacenski / jetson_nano_detection_and_tracking

Jetson Nano ML install scripts, automated optimization of robotics detection models, and filter-based tracking of detections
GNU Lesser General Public License v2.1
226 stars 66 forks source link

Self.rate allows negative values #8

Closed Tdoe4321 closed 5 years ago

Tdoe4321 commented 5 years ago

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.

SteveMacenski commented 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

Tdoe4321 commented 5 years ago

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.

Tdoe4321 commented 5 years ago

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.

SteveMacenski commented 5 years ago

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:

SteveMacenski commented 5 years ago

10 merged