I am planning on building a new HA setup including several 4k cameras together with object/face detection (deepstack and frigate).
I wanted to ask for your recommendations and experiences in terms of hardware and combination of hardware for a complete setup. I am thinking about pi, server, nuc, coral stick, nvidia jetson, intel AI-stick, …
I guess this would be interesting for many.
If you want to do custom model training you might as well get something like an RTX3070, which you can then use for inference when you are not training, it is about 20X the performance of a Coral. If you want the best power efficiency, they make a PCIe card with 16 Coral chips on it, but it is very expensive. It is double the price of a 3070, but not quite double the performance, it is good for multi model inference since it is still 16 separate devices on the card. Obviously, you can also use an RTX for CUDA code.
I believe, but am not 100% sure on the details, that a Coral TPU can only process a 4K video stream at around 15FPS reliably. Large or complex models can still take a quarter of a second, and the RTX might do the same in 7ms. Depending on the latency requirements and how many inferences per second you need, the Coral may be insufficient.
You also have to consider if you are recording the camera feeds all the time or on motion, running motion detection locally instead of on the camera, at a certain point, depending on camera count, framerate, compression ratio, and scene complexity, you may max out a the storage media of the server. You do not want to record that kind of material to SSD, so you need a magnetic drive. Consider that under a multithreaded write scenario with additional reads and filesystem overhead you can lose 95% of rated performance, so a 200MB/s drive goes to 10 or less, and a 4K/30 camera may pull in up to 2MB/s… at a certain point you would need to run a RAID array to maintain the ability to playback during record of multiple cameras.
And is the HA setup going to run any other services of a complex nature? There is no substitute for CPU cores when it comes to running multiple processes without large amounts of context switches, and if you scale up, you do not want to hit any sort of limit that would require a hardware upgrade. I am at 7 years on my server and after a ram and storage upgrade am now ok on everything (so far) except storage capacity, and that is an expensive and time consuming upgrade, the kind that prompts you do build a faster, more capable, more efficient device, since 7 years is a long time, computer years are like dog years.
Oh great! just out of curiosity, if you could tell me more about your setup?
Yes, digging more into the topic, i also found out that a dedicated gpu is more capable than a usb stick. It would be a nice to have to feed frigate with a 4k stream… but tbh this exceeds my needs. Backyard and frontyard person and animal detection, these are basically my needs.
I never dealt with face recognition and thus cannot rely on it and thus am having a hard time spending money on it. If I could reliably implement it at the front door, that would be great. I wouldn’t use it just for notification. But on the other hand, face recognition does not need to be real time when I think about it.
Recording should be more or less saved for a short period of time. I don’t need to see, who was at the frontdoor 30 days ago in 4k by two cameras. Should be a ‘ just in case‘-revision.
Probably freenas should be on the same machine, but that is just a remote backup.
After seeing the prices of ‘heavy‘ machines like new i7 and the rtx you mentioned, I would start with a tiny used PC and in case upgrade my way from there (currently just using a pi…). Maybe you could share your thoughts on it @richieframe . i7-4770/90, nvidia 1050/80 (I am not sure about the CUDA levels), 16gb ram.
Something like this.
I am not using AI processing, though I was considering it for rhasspy, which has the option of a speech recognition library with CUDA support. So I had done some basic research and looked into what else it could be used for.
At some point I considered a combination of face/voice recognition as a backup to get into my house, I could look at and speak a passphrase to an exterior cam, it it would open the garage door for me. I have enough redundancy in secured access measures as it is that I did not see spending time on that as useful, in the future who knows. All my money and effort right now is going into security and environmental monitoring.
For an Nvidia card, you basically need a RTX 3000 series if you want good efficiency and performance, a 3070 has about triple the performance of a 1080, and about 8X the 1050. I had not looked at gpu prices in the last year, its nuts, and nothing seems available. For building a new system I would go with an 8-core AMD 5800X, or perhaps even a 5700G, with kernel vulnerability management there is no way I would use an Intel CPU earlier than Ice Lake (gen 10).
My 7 year old server is similar to what you described, but has 32GB of ram and the Haswell Xeon equivalent of a 4770; it had 8GB, I wanted room to grow and that was the most obvious point of contention a few years back when it became clear that I needed more (currently using 12GB), I would still go with 32GB today unless I wanted to run multiple virtual machines, then I would go 64. Lots of mem also helps if you run the device as a storage server with ZFS, or run multiple memory hungry database applications.
If you need face or object recognition on a single camera, and you do not need realtime full frame response, a single coral will probably do the trick, and a USB one will work on pretty much any system
You should not have told me about rhasspy…
But after a quick search: rhasspy is not able to detect exactly MY voice? It‘s just speech recognition, right?
Why are you investing so heavily into security and monitoring? Where are you now? What is your aim?
I was also now thinking about intel gen 10, but an i3 10100. Just to start really simple. It has the 1200 socket and around the same parameters as an 4770. (Btw 5th gen Intel CPUs and older have a hard time handling h265 streams, is that right?) From there I could easily upgrade the CPU for the next years. Ram is the same, would start with 16gb and see from there. And finally GPU, would not start with any, also easily upgraded.
I have initial costs in mind, but also running costs. i7, GPU, multiple 4k streams, realtime, etc. or what i wrote above… I guess it makes a difference at the end of the year.
Btw: maybe if you‘re into it. Do HDDs make any sense nowadays? Especially for a 24/7 system? Initial cost for SSD’s are definitely higher, but they use less power and have a longer lifespan. On top they respond faster. What do you think?
HDDs are good for bulk storage of sequentially read or written data, like video content and backups. For pretty much any thing else they are inferior. You can compensate a bit for the raw speed with a RAID controller, which can get you high sequential speeds at the cost of access time, though that can be compensated by a read/write cache on the controller if needed. Trying to get a 30TB SSD array is… expensive, and other than the lack of noise and power draw, there will not much of an advantage performance wise for reading or writing video content, unless you are dealing with uncompressed video editing.