Face Mask Detection with ARC

Mickey666Maus

Germany

I had this in my head for some time now, and finally found some nice datasets to turn this into a project... Just follow me on the video if you would like to build the training data yourself, or just use this code here, for the prebuild model!

Have fun!!:)

By — Last update

ARC Pro

Upgrade to ARC Pro

ARC Pro will give you immediate updates and new features needed to unleash your robot's potential!

#1   — Edited

Just use the index.html that you can download over here... https://we.tl/t-SjWXr18jg4 And run it locally!!

It will be sending the label results to the Super EZ ARC REST Server, so make sure you got it running... https://synthiam.com/Community/Robots/Super-EZ-ARC-REST-Server-20073

In ARC you can use that data to build something...eg drive a servo, like this!

from System.Net import HttpWebRequest
uri = "http://127.0.0.1:5000/get_positions";
webRequest = HttpWebRequest.Create(uri)
response = webRequest.GetResponse()

from System.IO import StreamReader
import clr
clr.AddReference('System.Web.Extensions')
from System.Web.Script.Serialization import JavaScriptSerializer
streamReader = StreamReader(response.GetResponseStream())

def readData():
  jsonData = streamReader.ReadToEnd()
  js = JavaScriptSerializer()
  dataDict = js.DeserializeObject(jsonData)
  return dataDict

dataDict = readData()
print(dataDict)

checkMask =(dataDict)
for evaluation in checkMask:
    print(evaluation)

if evaluation == "WithoutMask":
  print("Please wear a mask!")
  Servo.SetPosition(D0, 150, 0);

if evaluation == "WithMask":
  print("Thanks for wearing a mask!")
  Servo.SetPosition(D0, 50, 0);

So help us all to stay safe and build something cool into your ARC project!!:)

PRO
Synthiam
#3  

Your super ez rest server is really stretching it’s legs! Nice work. The datasets are interesting. Hmmm I wonder if I can import those into my yolo engine because it uses onyx that allows it. So the documentation says

#4  

I never really checked into this, I only used some transfer learning on Teachable Machine and on ml5.js... But it should be possible I guess!!

It kinda cool... gives the robot a purpose, by telling people, that its nice to wear a mask!!:)

#5  

Nomad is sending Me his 3d printed Dalek, 23 cm not that big but still could be fun to have it check people for masks and scream at them ," By order of The Dalek high command, you will wear a mask ,you must comply...or be Exxxxxterminated!"xD

#6  

That would definitely be a good use case for that project!! Make a clip, and keep me posted!!:D