mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
Cv model 2.4 (#729)
* Use env var for cv model version * Reorder code * Specify tensorflow version to use
This commit is contained in:
@@ -126,10 +126,10 @@ android {
|
||||
versionCode 50
|
||||
versionName "0.8.1"
|
||||
setProperty("archivesBaseName", applicationId + "-v" + versionName + "+" + versionCode)
|
||||
manifestPlaceholders = [ GMAPS_API_KEY:project.env.get("GMAPS_API_KEY") ]
|
||||
// Detox Android setup
|
||||
testBuildType System.getProperty('testBuildType', 'debug')
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
manifestPlaceholders = [ GMAPS_API_KEY:project.env.get("GMAPS_API_KEY") ]
|
||||
// Detox end
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ buildscript {
|
||||
kotlinVersion = "1.6.20"
|
||||
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
|
||||
ndkVersion = "23.1.7779620"
|
||||
// This specifies which tensorflow-lite version to use for our vision-plugin.
|
||||
tensorflowVersion = "2.4.0"
|
||||
}
|
||||
repositories {
|
||||
google()
|
||||
|
||||
@@ -26,6 +26,7 @@ ANDROID_MODEL_FILE_NAME=small_inception_tf1.tflite
|
||||
ANDROID_TAXONOMY_FILE_NAME=small_export_tax.csv
|
||||
IOS_MODEL_FILE_NAME=small_inception_tf1.mlmodel
|
||||
IOS_TAXONOMY_FILE_NAME=small_export_tax.json
|
||||
CV_MODEL_VERSION=1.0
|
||||
|
||||
# Fastlane
|
||||
IOS_PROVISIONING_PROFILE_NAME="provisioning profile name"
|
||||
|
||||
@@ -5,6 +5,7 @@ import React, {
|
||||
useEffect
|
||||
} from "react";
|
||||
import { Platform } from "react-native";
|
||||
import Config from "react-native-config";
|
||||
import * as REA from "react-native-reanimated";
|
||||
import {
|
||||
useFrameProcessor
|
||||
@@ -24,6 +25,7 @@ type Props = {
|
||||
animatedProps: any
|
||||
};
|
||||
|
||||
const version = Config.CV_MODEL_VERSION;
|
||||
// Johannes: when I copied over the native code from the legacy react-native-camera on Android
|
||||
// this value had to be a string. On iOS I changed the API to also accept a string (was number).
|
||||
// Maybe, the intention would look clearer if we refactor to use a number here.
|
||||
@@ -62,7 +64,7 @@ const FrameProcessorCamera = ( {
|
||||
// Reminder: this is a worklet, running on the UI thread.
|
||||
try {
|
||||
const results = InatVision.inatVision( frame, {
|
||||
version: "1.0",
|
||||
version,
|
||||
modelPath: dirModel,
|
||||
taxonomyPath: dirTaxonomy,
|
||||
confidenceThreshold
|
||||
@@ -73,7 +75,7 @@ const FrameProcessorCamera = ( {
|
||||
REA.runOnJS( onClassifierError )( classifierError );
|
||||
}
|
||||
},
|
||||
[confidenceThreshold]
|
||||
[version, confidenceThreshold]
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user