swittk / react-native-mediapipe-facemesh

Natively built Mediapipe Facemesh for React Native (Currently iOS Only)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-mediapipe-facemesh

Mediapipe Facemesh fplugin or React Native

WIP Currently can build, but crashes due to glog mutex somehow being stupid and throwing SIGABRT (abort()) when calling inside the react native bridge. I suspect MediaPipe usage of glog might conflict with React Native's extensive usage.

Changing this zone at /ios/Pods/glog/src/base/mutex.h makes it work (Basically making glog's mutex useless). From

#define SAFE_PTHREAD(fncall)  do {   /* run fncall if is_safe_ is true */  \
  if (is_safe_ && fncall(&mutex_) != 0) abort();                           \
} while (0)

to

#define SAFE_PTHREAD(fncall)  do {   /* run fncall if is_safe_ is true */  \
if (is_safe_ && fncall(&mutex_) != 0) {} /*{ printf("killing app because is safe and fncall is not zero :("); abort();}*/\
} while (0)

Installation

npm install react-native-mediapipe-facemesh

Usage

import MediapipeFacemesh from "react-native-mediapipe-facemesh";

// ...

const result = await MediapipeFacemesh.multiply(3, 7);

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

About

Natively built Mediapipe Facemesh for React Native (Currently iOS Only)

License:MIT License


Languages

Language:Objective-C 53.7%Language:Java 21.2%Language:TypeScript 15.9%Language:Ruby 5.0%Language:JavaScript 3.8%Language:C 0.3%Language:Swift 0.2%