BlendArMocap icon indicating copy to clipboard operation
BlendArMocap copied to clipboard

MacOS dramas and a [partial] fix

Open shayneoneill opened this issue 3 years ago • 2 comments

Hey!

Trying to get this puppy running on MacOs on a Macbookpro M1 Max unit.

So, first thing that comes up is getting dependencies running. Mediapipe isn't officially packaged for arm64 based macs. However an unofficial package exists called "mediapipe-silicon". AFAIK it should be possible to fix that on a mac by editing BlendArMocap-release/src/cgt_blender/utils/install_dependencies.py

And change the lines after import bpy.app to

Dependency = namedtuple("Dependency", ["module", "package", "name"])
dependencies = (Dependency(module="mediapipe", package="mediapipe-silicon", name=None),
                Dependency(module="opencv-python", package=None, name="cv2"))

It should install after this. I think.

if it doesn't a command something like

/Applications/Blender.app/Contents/Resources/3.1/python/bin/pip3 install opencv-python
/Applications/Blender.app/Contents/Resources/3.1/python/bin/pip3 install mediapipe-silicon

ought do the job.

Now. What I've found from here is that Blender launched from the desktop by mashing the Blender.app (or launching it from spotlight) will crash out completely when running "start detection". My guess is its colliding with sandboxing and permissions for some reason.

HOWEVER

Running it from the command line seemed to work fine (Though I did do a xattr -d -r somethingorother.sandbox type thingo to remvoe sandboxing, not sure if necessary), however it is fairly buggy. Im not sure if its stuff others are seeing, if its something fixed in the github already, or its a side effect of my particular arangement of things. Its erratic though. Often if it fails, trying again works.

There are bugs about not enough, or too many values, unplugging from the observer (I wasnt actually aware this abstract base class stuff was actually in python, figured that was more a Java curse lol.

If you wish I can provide error dumps.

WITH ALL THAT SAID. Good work my dude! This is actually really good stuff. Its already more featureful than some commercial mocap things. Sure its buggy, but glory does come overnight, it takes work. And I really applaud what your doing. This true open-source integrated hands and face and body mocap from a single camera, built into blender could turn out a real game changer for this industry.

Some nice-to-haves: Multi camera! Dont know if OpenCV and your own algorithms could be coerced to do this, but 3-4 $30 webcams + an aligment method would push this over the edge into a truly production useful solution. Un-enumerate the camera drop down so we can work out what option refers to what camera (I have 5 cameras in my studio)

Havent checked out the transfer stuff yet. Will report back if its borked.

shayneoneill avatar May 27 '22 10:05 shayneoneill

Just checked, it all works really well on my windows machine. So I'm guessing the issue must be the google-pipeline and/or OpenCV on the M1 chip. Maybe I just have to wait till Google put an official port of pipeline out :(

shayneoneill avatar May 27 '22 13:05 shayneoneill

Thanks a lot! Multicams seem interesting but will mostly take a while!

So far there is no proper support for blenders silicone version. However, try downloading the "intel-version" for blender and retry - it should run on silicone macs and as far as I know should allow to use the "supported" mediapipe module!

cgtinker avatar May 30 '22 11:05 cgtinker

mediapipe now supports silicon macs - the current version on the main branch may be installed w/o rosetta. Multicam tracking is possible using Freemocap the created session data can be imported using blendarmocap. If you face issues with dependencies on macOS please refer to #130

cgtinker avatar Feb 22 '23 12:02 cgtinker