mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
scripts/examples: Remove person detection code.
This commit is contained in:
parent
198dd33379
commit
e3913c5bd6
@ -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():
|
def exe_qrcode_detection():
|
||||||
result = interface.call("qrcode_detection")
|
result = interface.call("qrcode_detection")
|
||||||
if result is not None and len(result):
|
if result is not None and len(result):
|
||||||
@ -171,7 +165,6 @@ def exe_jpeg_snapshot():
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
exe_face_detection() # Face should be about 2ft away.
|
exe_face_detection() # Face should be about 2ft away.
|
||||||
# exe_person_detection()
|
|
||||||
# exe_qrcode_detection() # Place the QRCode about 2ft away.
|
# exe_qrcode_detection() # Place the QRCode about 2ft away.
|
||||||
# exe_all_qrcode_detection() # Place the QRCode about 2ft away.
|
# exe_all_qrcode_detection() # Place the QRCode about 2ft away.
|
||||||
# exe_apriltag_detection()
|
# exe_apriltag_detection()
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import math
|
|||||||
import rpc
|
import rpc
|
||||||
import sensor
|
import sensor
|
||||||
import struct
|
import struct
|
||||||
import tf
|
|
||||||
|
|
||||||
sensor.reset()
|
sensor.reset()
|
||||||
sensor.set_pixformat(sensor.RGB565)
|
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])
|
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
|
# When called returns the payload string for the largest qrcode
|
||||||
# within the OpenMV Cam's field-of-view.
|
# within the OpenMV Cam's field-of-view.
|
||||||
#
|
#
|
||||||
@ -300,7 +285,6 @@ def jpeg_snapshot(data):
|
|||||||
# Register call backs.
|
# Register call backs.
|
||||||
|
|
||||||
interface.register_callback(face_detection)
|
interface.register_callback(face_detection)
|
||||||
interface.register_callback(person_detection)
|
|
||||||
interface.register_callback(qrcode_detection)
|
interface.register_callback(qrcode_detection)
|
||||||
interface.register_callback(all_qrcode_detection)
|
interface.register_callback(all_qrcode_detection)
|
||||||
interface.register_callback(apriltag_detection)
|
interface.register_callback(apriltag_detection)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user