Amaljith Cf
Published © MIT

Illegal Human Entry Detection and Alert

Detects and alerts authorities about human entry into restricted areas such as wildlife sanctuaries, protected forests, or sensitive zones.

IntermediateFull instructions provided2 hours533
Illegal Human Entry Detection and Alert

Things used in this project

Story

Read more

Schematics

Lora to Sheets

Code

human detection code

Arduino
to be uploaded to xiao esp32c3
//gh0stgl1tch
#include <Seeed_Arduino_SSCMA.h>
SSCMA AI;
void setup()
{
AI.begin();
Serial.begin(115200);
}
void loop()
{
if (!AI.invoke(1, false, true))
{
Serial.println("invoke success");
Serial.print("perf: prepocess=");
Serial.print(AI.perf().prepocess);
Serial.print(", inference=");
Serial.print(AI.perf().inference);
Serial.print(", postpocess=");
Serial.println(AI.perf().postprocess);
int numHumans = 0;
for (int i = 0; i < AI.boxes().size(); i++)
{
if (AI.boxes()[i].target == 0) // 0 means 1 person, 1 means 2 people, etc.
{
numHumans += AI.boxes()[i].target + 1;
}
}
Serial.print("Number of humans detected: ");
Serial.println(numHumans);
if (numHumans > 0) // only print image data if at least one person is detected
{
if (AI.last_image().length() > 0)
{
Serial.print("Last image:");
Serial.println(AI.last_image());
}
}
}
}

Credits

Amaljith Cf
13 projects • 31 followers
Technology enthusiast

Comments