Cv model 2.4 (#729)

* Use env var for cv model version

* Reorder code

* Specify tensorflow version to use
This commit is contained in:
Johannes Klein
2023-08-07 16:44:58 +02:00
committed by GitHub
parent f30a622720
commit 2e8665047c
4 changed files with 8 additions and 3 deletions

View File

@@ -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
}

View File

@@ -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()

View File

@@ -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"

View File

@@ -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 (