Motion detection, face recognition - no?

A few days ago, I discovered DroidScript and think it is really fantastic how fast I can create something usable in a couple of hours. Then I got introduced to Expo, and it too feels very intriguing, because I can make cross browser apps.
One feature I need, does only seem to be available on DroidScript though.
I need to be able to detect motion in front of the phone. It can be from camera motion detection, or through the use of the ambient light sensor - though I prefer the camera (as not all phones have the light sensor).
Am I correct that this is not possible yet with Expo?

Another possibility would be face recognition (not detection), but there seems to be no really easy way to do this. OpenCV can do this - and it’s also possible through a Microsoft Image API.

we might add face detection in the future, but i don’t know of a good way to do motion detection. i think you’d probably need to detach and write native code.

https://docs.expo.io/versions/latest/guides/detach.html

Face recognition would be fantastic. It would give many exciting new possibilities. At the earliest, when could the feature be integrated, if it will be integrated at all?

I just released react-native-opencv3 v1.0.5 on github for face detection using OpenCV and a bunch of other stuff. Check out https://github.com/adamgf/react-native-opencv3

@adamgf how do you use react-native-opencv3 with expo? I’m having loads of trouble… because of dependencies of react-native-fs

Hi Pedro,
Try installing react-native-fs separately in expo first and then try installing react-native-opencv3. But I am not sure if react-native-opencv3 will work in expo anyways I do not know if it has been tested in expo. It uses native code so I think it might have to be built into expo? These entitled facebook react native people just kind of ignored me when I asked for some help with this despite that I spent eight months it of my own time and have not earned a penny from it. I am not really sure.

Best regards,

Adam

I really find wicked this community… it seems like expo is taking over all the open source code and libraries already developed… and then cherry picking the ones they like, so that they can decide what people can use? and be dependent on them?
it’s a scary software this expo…

Sorry for ranting. I worked on this for eight months without making any money on it because I thought it would help people out. And I contacted a couple people who work at facebook through twitter and they either ignored me or told me basically they did not really care (the guy who wrote redux basically told me he wasn’t going to do anything) so … I thought it was a pretty cool project and helpful to react native developers but I cannot keep working on this for free you know? If other people want to take over that is why I wrote it as a community thing.
Best regards,

Adam

Hi @iamspam

I feel your characterisation of the Expo team (and the rest of the community) is unfair. They are trying to improve the developer experience for people building React Native apps. To do this they had to make choices about what libraries would be included in Expo, while still allowing users an “escape hatch”. i.e. you can eject. Of course they could not just include everything.

They are currently working hard to make ejecting less painful and in addition they are working to make it possible to customise standalone builds so that you don’t have to just accept their decisions about what libraries will be included in your app.

Of course sometimes things take a long time and that can be frustrating, but things are improving with each SDK version.

Hi @adamgf

You are right that using it in a “managed workflow” app would require the native code to be built into Expo by the Expo team.

But if you eject to the bare workflow, your app is basically a plain React Native app and you can use and library that works with React Native. Of course, ejecting does mean you lose some of the benefits of Expo’s managed workflow.

Regarding the rest of your posts, I’m not sure what exactly you were asking them for, so it’s a little hard to comment. But maybe some people in the OpenCV community would have been the better ones to contact.

For anyone else looking at this thread Expo does support face detection out of the box these days, but not motion detection.

Where can I read more about ejecting an app? Sounds interesting… so I could install all expo libraries I need using expo… and then eject it and install the opencv dependency?
Im sorry this is extremely complex for me, all this incompatibilities of expo and react-native and libraries… I can’t make any sense out from it… Why there are so many breaking changes between react-native and expo? Why did react-native quit so many libraries to expo, and is now fully depedent on expo, without giving an answer to all those other libraries?

and i have to apologize for my ranting… I don’t known so much about all of this to be able to have a minded opinion, its just an opinion after this first 2 weeks trying this stuff out.

Hi

Please bear in mind that while reading your comments we can’t determine your intentions or tone, so your words might seem hurtful towards people who are working hard to improve the React Native environment. So it might be better to ask questions about how to do certain things (e.g. how to do face detection or motion detection) using the Expo managed workflow, or the Bare workflow or maybe just React Native or something else entirely instead.

I think it would probably help your understanding to read the following from the Expo docs:

How do I add custom native code to my Expo project?

Managed Expo projects don’t support custom native code, including third-party libraries which require custom native components. In a managed project, you only write JavaScript.

In our SDK, we give you a large set of commonly desired, high-quality native modules. We recommend doing as much in JavaScript as possible, since it can immediately deploy to all your users and work across both platforms, and will always continue to benefit from Expo SDK updates.

However, if you need something custom that isn’t possible with the native modules provided in the SDK, like on-the-fly video processing or low-level control over the Bluetooth radio to do a firmware update and other features requested here, you can run expo eject and have full control over the underlying native projects.

Also there’s a lot more info on the menu under Managed Workflow

And here’s a list of reasons why you might not want to use Expo:
https://docs.expo.io/versions/v36.0.0/introduction/why-not-expo/

There are a few things that Expo’s managed workflow provides that are not yet available in the Bare workflow. The Expo team has been working hard over the last several SDK versions to reduce this number. The next SDK version (37) will have extracted the OTA updates module to a Unimodule so that it can be used in the Bare workflow. The OTA updates is one of the main ones that would be painful to lose when ejecting.

So at the moment if you eject to the Bare workflow you will lose access to some of Expo’s functionality. The reason for this is purely because Expo has not yet had the time to make everything available in the Bare workflow. And as I said, they have been actively working to fix this.

Your comment is full of confusion, though. I hope the info pointed to above helps. Yes, if you have only been exposed to all of this for two weeks it can be very confusing, but it will get better! Try not to get too frustrated. This ranting just makes it sound like you’re trying to bad mouth Expo and/or React Native for no apparent reason.

This comment doesn’t really make sense. Expo is built on top of React Native. So Expo has to be compatible with React Native. I think what you mean is that you can’t just install some random React Native module in an Expo managed workflow app. However many React Native modules are written in pure JavaScript and do not need any native code which means they should work just as well in Expo as they do in a plain React Native app. Even some JavaScript code that is not written specifically for React Native will work in React Native or Expo (as long as it does not depend on things like the DOM or other certain things that are only available in a browser or a NodeJS environment.)

I don’t understand what you mean by this.

What do you mean by this? The React Native team did no such thing. There is no requirement to use Expo when developing a React Native app and Expo is making it easier with each new SDK to use parts of Expo in otherwise plain React Native apps.

1 Like

Here’s an article that might also help: