scripts/examples: Remove person detection code.

This commit is contained in:
Kwabena W. Agyeman 2023-12-23 13:23:02 -08:00
parent 198dd33379
commit e3913c5bd6
2 changed files with 0 additions and 23 deletions

View File

@ -77,12 +77,6 @@ def exe_face_detection():
)
def exe_person_detection():
result = interface.call("person_detection")
if result is not None:
print(bytes(result).decode())
def exe_qrcode_detection():
result = interface.call("qrcode_detection")
if result is not None and len(result):
@ -171,7 +165,6 @@ def exe_jpeg_snapshot():
while True:
exe_face_detection() # Face should be about 2ft away.
# exe_person_detection()
# exe_qrcode_detection() # Place the QRCode about 2ft away.
# exe_all_qrcode_detection() # Place the QRCode about 2ft away.
# exe_apriltag_detection()

View File

@ -15,7 +15,6 @@ import math
import rpc
import sensor
import struct
import tf
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
@ -134,20 +133,6 @@ def face_detection(data):
return struct.pack("<HHHH", out_face[0], out_face[1], out_face[2], out_face[3])
# When called returns if there's a "person" or "no_person" within view.
#
# data is unused
labels, net = tf.load_builtin_model("person_detection")
def person_detection(data):
global net
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
scores = net.classify(sensor.snapshot())[0].output()
return labels[scores.index(max(scores))].encode()
# When called returns the payload string for the largest qrcode
# within the OpenMV Cam's field-of-view.
#
@ -300,7 +285,6 @@ def jpeg_snapshot(data):
# Register call backs.
interface.register_callback(face_detection)
interface.register_callback(person_detection)
interface.register_callback(qrcode_detection)
interface.register_callback(all_qrcode_detection)
interface.register_callback(apriltag_detection)