mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-04-19 14:28:02 -04:00
Add a patch to get correct orientation for Android for frame processor
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -27239,7 +27239,7 @@
|
||||
},
|
||||
"node_modules/vision-camera-plugin-inatvision": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "git+ssh://git@github.com/inaturalist/vision-camera-plugin-inatvision.git#40d4e8de35272c92d5d17a8de696fa0f40addca2",
|
||||
"resolved": "git+ssh://git@github.com/inaturalist/vision-camera-plugin-inatvision.git#f8a965966b89b9f851546ec19bdc30c70baf49e3",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 16.0.0"
|
||||
@@ -47404,7 +47404,7 @@
|
||||
}
|
||||
},
|
||||
"vision-camera-plugin-inatvision": {
|
||||
"version": "git+ssh://git@github.com/inaturalist/vision-camera-plugin-inatvision.git#40d4e8de35272c92d5d17a8de696fa0f40addca2",
|
||||
"version": "git+ssh://git@github.com/inaturalist/vision-camera-plugin-inatvision.git#f8a965966b89b9f851546ec19bdc30c70baf49e3",
|
||||
"from": "vision-camera-plugin-inatvision@github:inaturalist/vision-camera-plugin-inatvision#vision-v3",
|
||||
"requires": {}
|
||||
},
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
} from "react-native-vision-camera";
|
||||
import { Worklets } from "react-native-worklets-core";
|
||||
import { modelPath, taxonomyPath } from "sharedHelpers/cvModel";
|
||||
import { useDeviceOrientation } from "sharedHooks";
|
||||
import * as InatVision from "vision-camera-plugin-inatvision";
|
||||
|
||||
type Props = {
|
||||
@@ -49,6 +50,8 @@ const FrameProcessorCamera = ( {
|
||||
onZoomChange,
|
||||
takingPhoto
|
||||
}: Props ): Node => {
|
||||
const { deviceOrientation } = useDeviceOrientation();
|
||||
|
||||
useEffect( () => {
|
||||
// This registers a listener for the frame processor plugin's log events
|
||||
// iOS part exposes no logging, so calling it would crash
|
||||
@@ -89,7 +92,8 @@ const FrameProcessorCamera = ( {
|
||||
version,
|
||||
modelPath,
|
||||
taxonomyPath,
|
||||
confidenceThreshold
|
||||
confidenceThreshold,
|
||||
patchedOrientationAndroid: deviceOrientation
|
||||
} );
|
||||
handleResults( results );
|
||||
} catch ( classifierError ) {
|
||||
@@ -98,7 +102,7 @@ const FrameProcessorCamera = ( {
|
||||
}
|
||||
} );
|
||||
},
|
||||
[version, confidenceThreshold, takingPhoto]
|
||||
[version, confidenceThreshold, takingPhoto, deviceOrientation]
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user