Code Monkey home page Code Monkey logo

react-native-inat-camera's Introduction

react-native-inat-camera

React Native package that provides a camera with optional species recognition.

iOS

The ios subfolder contains the source code for the iOS library project. You should need to just npm install inaturalist/react-native-inat-camera and then perhaps react-native link react-native-inat-camera and you should be good to go. You'll need to provide the model and taxonomy files.

Android

The android sub folder contains the source code for the Android library project. This project needs to be included in React Native projects that use the library.

Integrating the Library with a React Native app

The example folder contains a React Native app that shows the different integration points (run it using npm install + react-native run-android).

  1. Open your RN project's android sub folder and edit the settings.gradle file:
include ':app', ':inatcamera'
project(':inatcamera').projectDir = new File(rootProject.projectDir, '../../android')
  1. Make sure you have the <uses-permission android:name="android.permission.CAMERA" /> permission, in your AndroidManifest.xml file.
  2. Make sure your RN code asks the user for that permission as well.
  3. Add the following to MainApplication.java:
import org.inaturalist.inatcamera.nativecamera.INatCameraViewPackage;
...
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new INatCameraViewPackage() // <-- Add this line
      );
    }
  1. Open your RN app's build.gradle file and add the following (android/app/build.gradle): Under the dependencies section:
implementation project(":inatcamera")

Troubleshooting

  1. Can't load React Native screen: Once React Native screen is open - shake phone to open dev menu -> Dev Settings -> Debug server & port for device -> write IP address and port of your computer. Make sure your computer and phone are on the same wifi network.
  2. Remember to download the .tflite and .json files into the device (e.g. /sdcard/Download folder) and initialize the INatCamera component with the correct paths.

react-native-inat-camera's People

Contributors

budowski avatar alexshepard avatar albullington avatar kueda avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.