Send Motion-user mailing list submissions to motion-user@lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/motion-user or, via email, send a message with subject or body 'help' to motion-user-requ...@lists.sourceforge.net You can reach the person managing the list at motion-user-ow...@lists.sourceforge.net When replying, please edit your Subject line so it is more specific than "Re: Contents of Motion-user digest..." Today's Topics: 1. Re: Python object-detection post-hook repo (Peter Torelli) ---------------------------------------------------------------------- Message: 1 Date: Sun, 15 Aug 2021 11:18:22 -0700 From: Peter Torelli <peter.j.tore...@gmail.com> To: Motion discussion list <motion-user@lists.sourceforge.net> Subject: Re: [Motion-user] Python object-detection post-hook repo Message-ID: <CABGiWyudmj1NAUeo=5deq-tawmnoahyz0hqpn5qowsawguj...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Hi Greg, Yep, we had exactly the same idea. The reason why I wrote a queueing server is because both the Pi4 & my Intel-i5 just can't handle the load: the call to the movie_end event with the object detection throttles the cameras. I haven't run into an issue with nighttime: it still detects me taking the garbage out, but it could be my camera which uses active IR illumination. If you want to pick this up offline, just drop me an email so we don't spam the mailing list. I do get some false negatives though, which is why I periodically check the normal capture folder. Hi Yash, The core of the server script actually works on images. First you tell it which movie you want to analyze. Then it globs (searches) for all the images associated with that movie event by using the event number (%v). The function is called `process_file`, here : https://github.com/petertorelli/motion-nnet/blob/8d42aa8523769b60026232986dc01e9a8cb91471/server.py#L90-L99 ... If any component image in the movie contains a class, that movie is moved to another folder. If there are no class hits, that movie is just ignored (and later deleted by another cleanup script). If you email me offline I can help you rework it to just segregate pictures and ignore the movies. But I don't think COCO is trained to spot enough types of insects, it is a rather small classification set (90 vs ResNet's 1000). There are other options, like maybe use OpenCV's feature extraction and then send the bounding boxes to a beefier ResNet, but I'm not aware of any classifiers or image datasets tuned for insects. You could be the first to make one, I'm sure you could find enough entomologists out there to provide labelled images! ... Huh.. that actually sounds like a fun project. BugNet-9000... Peter On Sun, Aug 15, 2021 at 5:03 AM Greg Thomas <geete...@gmail.com> wrote: > Hi Yash, > Happy to share, but honestly after looking at Peter's coffee, I'm > somewhat embarrassed with my code. I'm not a phyton developer so I've > probably taken an excruciatingly painful route and made it way more complex > that it needs to be, but with that caveat, I'll post a link in a day or so. > > Regards > > Greg > > On Sun, 15 Aug 2021, 9:55 pm Yash Sondhi, <ysond...@fiu.edu> wrote: > >> Hi Greg, >> That sounds super useful, would you be able to share the code for that? >> Cheers >> >> >> On Sun, 15 Aug 2021, 03:59 Greg Thomas, <geete...@gmail.com> wrote: >> >>> Hi Peter, >>> I did something similar, I'm running a Pi4 with the coral TPU. I send >>> the images rather than the movies (publishing the filename) to the Pi via >>> MQTT, and I built a small server application to handle multiple cameras, >>> using the Coco SSDMobilenet model from the Google TPU example site. I also >>> limited the objects detected to those in interested in so only a subset of >>> the standard 90 in the COCO set. >>> >>> Works pretty well generally speaking, but I'm having difficulty with >>> night time images - does you setup handle night time images/movies reliably? >>> >>> Regards >>> >>> >>> >>> On Fri, 13 Aug 2021, 8:13 am Peter Torelli, <peter.j.tore...@gmail.com> >>> wrote: >>> >>>> A few months ago I asked this list if there was a way to natively >>>> perform object detection inside the main motion code. Since that isn't >>>> feasible, and since I didn't get a response with existing projects, I wrote >>>> a quick post-processor that uses SSD Mobilenet trained on COCO running on >>>> the Google Coral USB Accelerator. I got tired of wrangling the DeepStream >>>> SDK additions to GStreamer on my Xavier AGX, so this is a nice compromise. >>>> >>>> https://github.com/petertorelli/motion-nnet >>>> >>>> Basically it is a server that analyzes the component pictures of an >>>> event movie, and if it detects one of the 90 classes, it moves that MP4 to >>>> another folder (or you could push it to the cloud, or whatever). It cuts >>>> back on having to look at lots of shadows during the day, or bugs and rain >>>> at night. The server is triggered by a call from motion after a movie write >>>> event to the client python script that takes %f as the input parameter. The >>>> files must start with %v for the event so that the server knows which >>>> pictures to scan. >>>> >>>> Hopefully someone finds this useful, as I'm glad to not have to sort >>>> through hundreds of bogus movies (Caveat: SSDMobileNet isn't as good as a >>>> big ResNet with classical feature extraction, so you won't get >>>> everything... this is just a first shot at cutting back on noise). >>>> >>>> Peter >>>> >>>> >>>> >>>> _______________________________________________ >>>> Motion-user mailing list >>>> Motion-user@lists.sourceforge.net >>>> https://lists.sourceforge.net/lists/listinfo/motion-user >>>> https://motion-project.github.io/ >>>> >>>> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user >>> >>> _______________________________________________ >>> Motion-user mailing list >>> Motion-user@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/motion-user >>> https://motion-project.github.io/ >>> >>> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user >> >> _______________________________________________ >> Motion-user mailing list >> Motion-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/motion-user >> https://motion-project.github.io/ >> >> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user > > _______________________________________________ > Motion-user mailing list > Motion-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/motion-user > https://motion-project.github.io/ > > Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ ------------------------------ Subject: Digest Footer _______________________________________________ Motion-user mailing list Motion-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/motion-user ------------------------------ End of Motion-user Digest, Vol 182, Issue 10 ********************************************