Skip to content

Commit 09ebe84

Browse files
committed
refactor(ml)!: cloud ML APIs removed upstream, use auth+functions+cloud ML
Firebase native SDKs no longer contain specific cloud APIs, the suggestion is to use a serverless cloud function gateway with auth for user restriction, to the Google Cloud APIs
1 parent aba8fc6 commit 09ebe84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+24
-3754
lines changed

.spellcheck.dict.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ SDK
123123
SDK.
124124
SDKs
125125
SDKs.
126+
serverless
126127
SHA1
127128
SHA-256
128129
SIGABRT

docs/ml/image-labeling.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

docs/ml/landmark-recognition.md

Lines changed: 0 additions & 63 deletions
This file was deleted.

docs/ml/text-recognition.md

Lines changed: 0 additions & 65 deletions
This file was deleted.

docs/ml/usage/index.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ML
33
description: Installation and getting started with ML.
44
icon: //static.invertase.io/assets/firebase/ml-kit.svg
5-
next: /ml/text-recognition
5+
next: /remote-config/usage
66
previous: /in-app-messaging/usage
77
---
88

@@ -22,35 +22,29 @@ yarn add @react-native-firebase/ml
2222
cd ios/ && pod install
2323
```
2424

25+
> **This package is mostly discontinued** since these APIs are no longer available in the latest Firebase SDKs.
26+
> To call the Cloud Vision API from your app the recommended approach is using Firebase
27+
> Authentication and Functions, which gives you a managed, serverless gateway to Google Cloud Vision APIs. For an example
28+
> Functions project see the [vision-annotate-images](https://github.com/firebase/functions-samples/tree/master/vision-annotate-images) sample project.
29+
2530
If you're using an older version of React Native without autolinking support, or wish to integrate into an existing project,
2631
you can follow the manual installation steps for [iOS](/ml/usage/installation/ios) and [Android](/ml/usage/installation/android).
2732

2833
# What does it do
2934

30-
ML makes use of Firebase Machine Learning's [Text Recognition](https://firebase.google.com/docs/ml/recognize-text),
31-
[Image Labeling](https://firebase.google.com/docs/ml/label-images) & [Landmark Recognition](https://firebase.google.com/docs/ml/recognize-landmarks) features.
32-
3335
All Firebase ML services are cloud-based, with on-device APIs handled by the new, separate [Google MLKit](https://developers.google.com/ml-kit/) (Usable in react-native
3436
as a set of [react-native-mlkit modules](https://www.npmjs.com/org/react-native-mlkit))
3537

36-
<Youtube id="ejrn_JHksws" />
38+
Firebase has introduced a custom model downloading API, but the module does not have support for it yet. PRs always welcome!
3739

3840
## Support table
3941

4042
The table below outlines the current module support for each available service, and their support status here
4143

42-
| API | Cloud Model |
43-
| --------------------------------------------------------------------------------- | ----------- |
44-
| [Text Recognition](https://firebase.google.com/docs/ml/recognize-text) ||
45-
| [Document Text Recognition](https://firebase.google.com/docs/ml/recognize-text) ||
46-
| [Image Labeling](https://firebase.google.com/docs/ml/label-images) ||
47-
| [AutoML Vision Edge](https://firebase.google.com/docs/ml/automl-image-labeling) ||
48-
| [Object Detection/Tracking](https://firebase.google.com/docs/ml/object-detection) ||
44+
| API | Status |
45+
| ------------------------ | ------ |
46+
| Custom Model Downloading ||
4947

5048
# Usage
5149

52-
To get started, you can find the documentation for the individual ML Kit services below:
53-
54-
- [Text Recognition](/ml/text-recognition)
55-
- [Landmark Recognition](/ml/landmark-recognition)
56-
- [Image](/ml/image-labeling)
50+
Current no public APIs

docs/remote-config/usage/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Remote Config
33
description: Installation and getting started with Remote Config.
44
icon: //static.invertase.io/assets/firebase/remote-config.svg
55
next: /perf/usage
6-
previous: /ml/image-labeling
6+
previous: /ml/usage
77
---
88

99
# Installation

docs/sidebar.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@
9696
- - ML
9797
- - - Usage
9898
- '/ml/usage'
99-
- - Text Recognition
100-
- '/ml/text-recognition'
101-
- - Landmark Recognition
102-
- '/ml/landmark-recognition'
103-
- - Image Labeling
104-
- '/ml/image-labeling'
10599
- '//static.invertase.io/assets/firebase/ml-kit.svg'
106100
- - Remote Config
107101
- - - Usage

packages/ml/RNFBML.podspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ Pod::Spec.new do |s|
3535
end
3636

3737
# Firebase dependencies
38-
s.dependency 'Firebase/MLVision', firebase_sdk_version
38+
# s.dependency 'Firebase/MLModelDownloader', firebase_sdk_version
3939

4040
if defined?($RNFirebaseAsStaticFramework)
4141
Pod::UI.puts "#{s.name}: Using overridden static_framework value of '#{$RNFirebaseAsStaticFramework}'"
4242
s.static_framework = $RNFirebaseAsStaticFramework
4343
else
44+
# raise "#{s.name}: Underlying Firebase/MLModelDownloader requires $RNFirebaseAsStaticFrameworks = true and !use_frameworks in your Podfile"
4445
s.static_framework = false
4546
end
4647
end

packages/ml/android/build.gradle

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ buildscript {
1111
}
1212

1313
dependencies {
14-
classpath("com.android.tools.build:gradle:4.1.3")
14+
classpath("com.android.tools.build:gradle:4.2.1")
1515
}
1616
}
1717
}
@@ -90,11 +90,7 @@ repositories {
9090
dependencies {
9191
api appProject
9292
implementation platform("com.google.firebase:firebase-bom:${ReactNative.ext.getVersion("firebase", "bom")}")
93-
implementation "com.google.firebase:firebase-ml-vision"
94-
95-
implementation 'com.google.android.gms:play-services-vision:20.1.1'
96-
implementation 'com.google.android.gms:play-services-vision-common:19.1.1'
97-
implementation 'com.google.firebase:firebase-ml-model-interpreter:22.0.4'
93+
implementation "com.google.firebase:firebase-ml-modeldownloader"
9894
}
9995

10096
ReactNative.shared.applyPackageVersion()

0 commit comments

Comments
 (0)