TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi icon indicating copy to clipboard operation
TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi copied to clipboard

GPIO issue when using tflite detection

Open talhakhaira opened this issue 5 years ago • 1 comments
trafficstars

I have successfully trained my custom model and used it for object detection. However, I am facing a slight issue regarding the if-else condition on my custom model. I only have one object/class in my trained model, when it is detected I want to make a gpio pin to go HIGH and when the object is removed from the webcam feed the pin should go LOW. When I run the code the pin does go HIGH on a perfect detection but stays HIGH even if I remove the object from webcam feed. I used the following if-else condition:

if (object_name == labels[int(classes[i])]) and (scores[i]) >= 0.95): GPIO.output(13, GPIO.HIGH) else: GPIO.output(13, GPIO.LOW)

talhakhaira avatar May 14 '20 18:05 talhakhaira

@talhakhaira Hello, would you like to share the source code to me? Thank you

dnomyaR23 avatar Aug 15 '22 07:08 dnomyaR23