mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Fix person detector model labels
This commit is contained in:
parent
bb1b5948e0
commit
8f880bdb83
@ -119,7 +119,7 @@ def person_detection(data):
|
|||||||
sensor.set_pixformat(sensor.GRAYSCALE)
|
sensor.set_pixformat(sensor.GRAYSCALE)
|
||||||
sensor.set_framesize(sensor.QVGA)
|
sensor.set_framesize(sensor.QVGA)
|
||||||
scores = tf.classify("person_detection", sensor.snapshot())[0].output()
|
scores = tf.classify("person_detection", sensor.snapshot())[0].output()
|
||||||
return ['unsure', 'person', 'no_person'][scores.index(max(scores))].encode()
|
return ['person', 'no_person'][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.
|
||||||
|
|||||||
@ -119,7 +119,7 @@ def person_detection(data):
|
|||||||
sensor.set_pixformat(sensor.RGB565)
|
sensor.set_pixformat(sensor.RGB565)
|
||||||
sensor.set_framesize(sensor.QVGA)
|
sensor.set_framesize(sensor.QVGA)
|
||||||
scores = tf.classify("person_detection", sensor.snapshot())[0].output()
|
scores = tf.classify("person_detection", sensor.snapshot())[0].output()
|
||||||
return ['unsure', 'person', 'no_person'][scores.index(max(scores))].encode()
|
return ['person', 'no_person'][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.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user