Developer Andrew Moses has been engaged on upgrading a lab occupancy system that began life as a webcam within the Nineties — and, regardless of having a pc imaginative and prescient system with individual detection at hand, discovered that generally the best options are the perfect.
“For nearly so long as the Undergraduate Tasks Lab on the College of Wisconsin has existed, there’s been a digicam of some kind peering on the room,” Moses explains. “There’s proof of a system present even way back to the Nineties, with a prehistoric revision of the positioning mentioning that an previous iteration was: ‘…a $15 video digicam connected to the wall with duct tape, related to a VCR, related to a video spigot in a Mac IIcx, working Timed Video Grabber (TVG), and FTPd. Dax, an HP workstation ran a script that may attempt to FTP the newest picture each 60 seconds.”
25 years in the past, a lab’s occupancy sensor was a easy webcam; in the present day, it is a Python-powered laptop imaginative and prescient system… fed by a webcam. (📷: Andrew Moses/College of Wisconsin)
Now, practically 30 years later, there’s nonetheless a digicam pointing on the lab’s denizens — solely today it is loads smarter. Initially developed by Michael Berkey utilizing a Logitech C920 webcam, the brand new system places Python and machine studying to work to categorise individuals and supply a stay depend of the lab’s occupancy. After counting the variety of individuals utilizing the YOLOv7 mannequin, the script updates a Discord channel — although generally has an issue with telling the distinction between an individual and an unoccupied chair.
As with its Nineties equal, the digicam system is greater than only a toy: it is designed to assist customers of the lab know whether or not it is open or not. There’s an issue, although: whereas generally the lab could have occupants, that does not all the time imply it is open — a non-public assembly would present up as an occupied lab however not present a customer with entry, a lot to their dismay.
“It was round this time that I stumbled upon the homepage of MITERS, a makerspace at MIT,” Moses explains. “On their web site, they broadcast whether or not the door to the area is open utilizing a reed swap connected to a Raspberry Pi. Reed switches are small, bodily elements which might be in a position to detect a magnetic area. In the event you put one on a doorframe, after which connect a tiny magnet to the door itself, you’ve an efficient approach of detecting whether or not a door is open or closed!”
A easy magnetic door sensor sends its indicators to a Raspberry Pi, which updates Residence Assistant with the lab’s standing. (📷: Andrew Moses)
It is a a lot easier resolution than a pc imaginative and prescient mannequin able to telling the distinction between individuals and chairs, but it surely’s additionally far more strong: if the door is open for something aside from a short interval, then the lab is open; if it is closed, then the lab is shut. Utilizing an off-the-shelf Zigbee magnetic door sensor and a suitable radio related to a Raspberry Pi, Moses was lastly in a position to resolve the issue — updating a Residence Assistant set up and informing potential customers of the lab’s standing by way of Discord.
The complete undertaking write-up is accessible on Moses’ web site.