Developer Andrew Moses has been engaged on upgrading a lab occupancy system that began life as a webcam within the Nineteen Nineties — and, regardless of having a pc imaginative and prescient system with particular person detection at hand, discovered that typically the best options are the very best.
“For nearly so long as the Undergraduate Tasks Lab on the College of Wisconsin has existed, there’s been a digicam of some type peering on the room,” Moses explains. “There’s proof of a system present even way back to the Nineteen Nineties, with a prehistoric revision of the location mentioning that an previous iteration was: ‘…a $15 video digicam hooked up to the wall with duct tape, related to a VCR, related to a video spigot in a Mac IIcx, operating Timed Video Grabber (TVG), and FTPd. Dax, an HP workstation ran a script that might attempt to FTP the most recent picture each 60 seconds.”
25 years in the past, a lab’s occupancy sensor was a easy webcam; right now, 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 lately it is rather a lot smarter. Initially developed by Michael Berkey utilizing a Logitech C920 webcam, the brand new system places Python and machine studying to work to categorise folks and supply a dwell rely of the lab’s occupancy. After counting the variety of folks utilizing the YOLOv7 mannequin, the script updates a Discord channel — although typically has an issue with telling the distinction between an individual and an unoccupied chair.
As with its Nineteen 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 typically the lab might have occupants, that does not at all times 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 change hooked up to a Raspberry Pi. Reed switches are small, bodily parts which are capable of detect a magnetic subject. For those who put one on a doorframe, after which connect a tiny magnet to the door itself, you could have an efficient method 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 House Assistant with the lab’s standing. (📷: Andrew Moses)
It is a a lot easier answer than a pc imaginative and prescient mannequin able to telling the distinction between folks and chairs, however it’s additionally way more sturdy: if the door is open for something apart 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 appropriate radio related to a Raspberry Pi, Moses was lastly capable of remedy the issue — updating a House Assistant set up and informing potential customers of the lab’s standing through Discord.
The complete venture write-up is on the market on Moses’ web site.