mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Update smile detection example.
This commit is contained in:
parent
32f2e97cda
commit
5241167fb4
@ -28,6 +28,8 @@ while (True):
|
||||
|
||||
# Detect smiles
|
||||
for r in objects:
|
||||
# Resize and center detection area
|
||||
r = [r[0], r[1]+10, int(r[2]*1.1), int(r[2]*1.1)]
|
||||
img.draw_rectangle(r)
|
||||
out = net.forward(img, roi=r, softmax=True)
|
||||
img.draw_string(r[0], r[1], ':)' if (out[0]/127 > 0.8) else ':(', color=(255), scale=2)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user