diff --git a/__mocks__/vision-camera-plugin-inatvision.ts b/__mocks__/vision-camera-plugin-inatvision.ts index e9dc7056e..55711bac3 100644 --- a/__mocks__/vision-camera-plugin-inatvision.ts +++ b/__mocks__/vision-camera-plugin-inatvision.ts @@ -2,7 +2,7 @@ export const getPredictionsForImage = jest.fn( () => Promise.resolve( { predicti export const getPredictionsForLocation = jest.fn( () => Promise.resolve( { predictions: [] } ) ); export const removeLogListener = jest.fn( ); export const resetStoredResults = jest.fn( ); -export const lookUpLocation = jest.fn( location => ( { +export const getCellLocation = jest.fn( location => ( { ...location, elevation: 12 } ) ); diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 82e492230..8942fdcc7 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1204,7 +1204,7 @@ PODS: - VisionCamera/React (4.0.5): - React-Core - VisionCamera/FrameProcessors - - VisionCameraPluginInatVision (4.2.0): + - VisionCameraPluginInatVision (4.2.1): - React-Core - Yoga (1.14.0) @@ -1610,7 +1610,7 @@ SPEC CHECKSUMS: RNVectorIcons: 102cd20472bf0d7cd15443d43cd87f9c97228ac3 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 VisionCamera: f02de0b1b6b1516b327bd8215237a97e7386db8a - VisionCameraPluginInatVision: fcf3a3da9272def9014735257e065726c2d66d4f + VisionCameraPluginInatVision: f2e065009ed10375293fe343834c6d946e884a8a Yoga: c716aea2ee01df6258550c7505fa61b248145ced PODFILE CHECKSUM: eff4b75123af5d6680139a78c055b44ad37c269b diff --git a/package-lock.json b/package-lock.json index e2fae9073..a3508db52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -103,7 +103,7 @@ "realm": "^12.6.2", "sanitize-html": "^2.13.0", "ts-jest": "^29.1.2", - "vision-camera-plugin-inatvision": "github:inaturalist/vision-camera-plugin-inatvision#b905ff2b9ce1cf64797d600c6cd22fc7617b2389", + "vision-camera-plugin-inatvision": "github:inaturalist/vision-camera-plugin-inatvision#dcad11b1532cb8b777eaaf78d6df0a704e8c71d3", "zustand": "^4.5.2" }, "devDependencies": { @@ -20685,9 +20685,9 @@ } }, "node_modules/vision-camera-plugin-inatvision": { - "version": "4.2.0", - "resolved": "git+ssh://git@github.com/inaturalist/vision-camera-plugin-inatvision.git#b905ff2b9ce1cf64797d600c6cd22fc7617b2389", - "integrity": "sha512-8mw2Txnv5zxu2VcsQuEMVfbYP4aoi75XmeqM4Z2SbhFUOsQSnL4GGsTvTlxKPF2mNGJjeC4+NYZRlh6+tVPu9w==", + "version": "4.2.1", + "resolved": "git+ssh://git@github.com/inaturalist/vision-camera-plugin-inatvision.git#dcad11b1532cb8b777eaaf78d6df0a704e8c71d3", + "integrity": "sha512-PRgGpmWL6/XIYAh6xS50YrHxoUQxSlWWzPdDYHzcYBct9gBESCF0NUeFctWeqCJGjDcmL7RKlCYdizivZyiPmQ==", "license": "MIT", "dependencies": { "h3-js": "^4.1.0" diff --git a/package.json b/package.json index 8159b809e..6f30e7346 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "realm": "^12.6.2", "sanitize-html": "^2.13.0", "ts-jest": "^29.1.2", - "vision-camera-plugin-inatvision": "github:inaturalist/vision-camera-plugin-inatvision#b905ff2b9ce1cf64797d600c6cd22fc7617b2389", + "vision-camera-plugin-inatvision": "github:inaturalist/vision-camera-plugin-inatvision#dcad11b1532cb8b777eaaf78d6df0a704e8c71d3", "zustand": "^4.5.2" }, "devDependencies": { diff --git a/src/components/Camera/AICamera/FrameProcessorCamera.js b/src/components/Camera/AICamera/FrameProcessorCamera.js index 26b4808b4..aed397e6d 100644 --- a/src/components/Camera/AICamera/FrameProcessorCamera.js +++ b/src/components/Camera/AICamera/FrameProcessorCamera.js @@ -136,8 +136,8 @@ const FrameProcessorCamera = ( { // unfortunately, I was not able to run this new function in the worklets directly, // so we need to do this here before calling the useFrameProcessor hook. // For predictions from file this function runs in the vision-plugin code directly. - const location = hasUserLocation - ? InatVision.lookUpLocation( userLocation ) + const geoModelCellLocation = hasUserLocation + ? InatVision.getCellLocation( userLocation ) : null; const frameProcessor = useFrameProcessor( frame => { @@ -173,9 +173,9 @@ const FrameProcessorCamera = ( { useGeomodel: hasUserLocation, geomodelPath, location: { - latitude: location?.latitude, - longitude: location?.longitude, - elevation: location?.altitude + latitude: geoModelCellLocation?.latitude, + longitude: geoModelCellLocation?.longitude, + elevation: geoModelCellLocation?.elevation } } ); const timeAfter = Date.now(); @@ -198,7 +198,7 @@ const FrameProcessorCamera = ( { lastTimestamp, fps, hasUserLocation, - location + geoModelCellLocation ] );