Cooling an iPhone 12 Mini for Face Tracking
While software face tracking is always making improvements, hardware (iPhone) tracking is still generally recognized as the best, and frees your CPU utilization while letting you avoid the privacy implications of webcams.
Before buying a used iPhone specifically for tracking, I did a bunch of research, and there was a lot of talk about how the iPhone X has overheating issues, but it was supposedly solved with iPhone 11. So basically: get anything but the X. Supposedly.
I found an iPhone 12 Mini for a great price. First testing: everything's great, wow iPhones are kind of nice. Then, after about 30 minutes of continuous tracking, the submitted frames dropped from 60 FPS to about 30. After 45 minutes, I'm down to around 15.
It turns out the internet was just kind of wrong, and I don't think it's because of the mini in 12 Mini: iPhones have this awesome — and by awesome I mean shitty — design feature where they cover both sides with an insulator known as glass. iPhones dissipate a lot of heat through the metal frame around the edge, despite it being a much smaller surface area, because glass is total bullshit at transferring heat.
Point being, there's not that much difference between the 12 and 12 Mini when it comes to the perimeter metal, and this isn't a subtle overheat to begin with. Frankly, I think a lot of people's phones actually are overheating while they track and they just don't realize it, because 30 FPS is still watchable.
My first idea was to stick some heatsinks on it because it's in the name, duh. I found an X-ray image of the 12 Mini to see where the components were, and hoped that I understood which side of the phone the X-ray was taken from, which was all much smarter than using my finger to feel where the hot parts were.
At first I put a line of sinks right on top of the components, as seen in the first phone mount I made (which turned out to be a piece of shit):

I was extremely pleased with how aligned the heatsinks were despite eyeballing it, until I turned my light on and realized it looked like a fucking toddler put them on. But looks don't matter in this house or I'd be homeless: how did it perform?
Not that great. There honestly wasn't that much improvement to how long it took to reach an elevated thermal state. It was better, but it didn't seem proportional to the amount of surface area I just added, which was probably around 3 football fields, based on how long my middle school teacher told me my intestines are.
So, I added three heatsinks to the metal frame despite that it made the Mini not very mini anymore, just under the buttons on the hot side. It was a significant improvement, but not enough. After an hour I was still getting too hot for TV. The goal is to have full tracking performance and no time limit.
So my next thought was: all right fine bitch, computers use fans, surely they do something. I bought a 40mm fan because the math says that's infinite times bigger than the 0mm fan the phone came with.
I'll never know how good the 40mm fan cooled the phone, because, when I plugged it in, it started buttfucking my ears to Hell. There was no way I was putting this thing that sounded like a rollercoaster for mandrakes 10 inches away from my head for hours, not once not never.
I used my big brain this time and remembered: small fan fast and loud, big fan slow and quiet. Eureka! Make it big like Texas and slow like the Trump voters in it.
I found an old 80mm ball bearing PC fan. 80mm is double 40mm on both sides, which means it's quad-bigly compared to the first fan. Wow, it's wider than the phone.
No matter, having a phone with a giant fan stuck on it is okay because my phone is already cringemaxxed and Frankenpilled with heatsinks coming out of the side. I bought a USB to fan header adapter. PC fans are 12V but USB is 5V, which means the fan will run very slow compared to its maximum rating, which is great because slow is quiet and quiet is good. I plugged it in and folladora de payaso! — it was as silent as Republicans when the Epstein files aren't released. All that was left was to figure out how to get it on the phone.
It was around this same time I got a microphone arm, a phone clamp, and a threaded adapter to connect the two, so that I could position the phone without it being a complete pain in the dick. Out come the calipers and Autodesk Fusion. The key design goals were that it should be nondestructive, follow the phone without obscuring the screen, leave room for the heatsinks on the back, work upside-down, and print in as few parts as possible (ideally one). A couple ideas later, this was the result:

This S-shape thing is held between the mounting clamp and the back of the phone. It also has a gap between the long vertical part and the front of the fan so that it doesn't obscure airflow, which probably makes no fucking difference but it was gonna take four hours to print and I wasn't about to do it again.

Et voila, all it took to cool down the iPhone 12 Mini, perpetually and silently while face tracking, was a bunch of heatsinks and a fan the size of the phone. The entire setup starting without a phone at all was about ~$200 USD. Do simpler solutions exist? Probably. Could a desk fan pointed at the stock phone work? Maybe. But I think there's something important in owning your own solution sometimes.

