This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
private lateinit var renderScript: RenderScript | |
private lateinit var yuvToRGB: ScriptIntrinsicYuvToRGB | |
private var yuvDataLength: Int = 0 | |
private lateinit var allocationIn: Allocation | |
private lateinit var allocationOut: Allocation | |
private lateinit var bitmapOut: Bitmap | |
override fun onCreate(savedInstanceState: Bundle?) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
Fritz.configure(this) //Initialize the Fritz SDK | |
} | |
override fun onStart() { | |
super.onStart() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var avroSchema = { | |
type: 'record', | |
name: 'MyClass', | |
namespace: 'com.test.avro', | |
fields: [ | |
{ | |
name: 'anonymousId', | |
type: 'string' | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fab_take_photo.setOnClickListener { | |
// cameraView is a custom View which provides camera preview | |
cameraView.captureImage { cameraKitImage -> | |
// Get the Bitmap from the captured shot and use it to make the API call | |
getCardDetails(cameraKitImage.bitmap) | |
} | |
} | |
private fun getCardDetails(bitmap: Bitmap) { | |
val image = FirebaseVisionImage.fromBitmap(bitmap) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fatal Error] :150:34: The entity "oslash" was referenced, but not declared. | |
DEBUG: /private/var/tmp/_bazel_harshitdwivedi/5e14a8881660bff07fef13c4451c9f7c/external/bazel_tools/tools/osx/xcode_configure.bzl:87:9: Invoking xcodebuild failed, developer dir: /Applications/Xcode-beta.app/Contents/Developer ,return code 256, stderr: Process terminated by signal 15, stdout: | |
ERROR: /private/var/tmp/_bazel_harshitdwivedi/5e14a8881660bff07fef13c4451c9f7c/external/local_config_android/android.bzl:9:3: no such package '@androidsdk//': org.xml.sax.SAXParseException; lineNumber: 150; columnNumber: 34; The entity "oslash" was referenced, but not declared. and referenced by '//external:android/dx_jar_import' | |
ERROR: Analysis of target '//tensorflow/contrib/lite/java:tensorflow-lite' failed; build aborted: Analysis failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
hdrs = [ | |
"exception_jni.h", | |
"nativeinterpreterwrapper_jni.h", | |
"tensor_jni.h", | |
"tensorflow_lite_jni.h", | |
"normalize.h", | |
"predict.h", | |
"extract_feature.h", | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> Task :crash:app:preDebugBuild FAILED | |
Warning: The app gradle file must have a dependency on com.google.firebase:firebase-core for Firebase services to work as intended. | |
Warning: The app gradle file must have a dependency on com.google.firebase:firebase-core for Firebase services to work as intended. | |
> Task :admob:app:preDebugBuild FAILED | |
Warning: The app gradle file must have a dependency on com.google.firebase:firebase-core for Firebase services to work as intended. | |
> Task :appindexing:app:preDebugBuild FAILED | |
Warning: The app gradle file must have a dependency on com.google.firebase:firebase-core for Firebase services to work as intended. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
// ... | |
// Add the In-App Messaging depencency: | |
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.0' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun getPokemonFromBitmap(bitmap: Bitmap?) { | |
val inputs = FirebaseModelInputs.Builder() | |
.add(convertBitmapToByteBuffer(bitmap)) // add() as many input arrays as your model requires | |
.build() | |
fireBaseInterpreter.run(inputs, inputOutputOptions) | |
?.addOnSuccessListener { | |
val pokeList = mutableListOf<Pokemon>() | |
/** | |
* Run a foreach loop through the output float array containing the probabilities |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val pokeArray: Array<String> = arrayOf("abra", "aerodactyl", "alakazam", "arbok", "arcanine", "articuno", "beedrill", "bellsprout", | |
"blastoise", "bulbasaur", "butterfree", "caterpie", "chansey", "charizard", "charmander", "charmeleon", "clefable", "clefairy", "cloyster", "cubone", "dewgong", | |
"diglett", "ditto", "dodrio", "doduo", "dragonair", "dragonite", "dratini", "drowzee", "dugtrio", "eevee", "ekans", "electabuzz", | |
"electrode", "exeggcute", "exeggutor", "farfetchd", "fearow", "flareon", "gastly", "gengar", "geodude", "gloom", | |
"golbat", "goldeen", "golduck", "golem", "graveler", "grimer", "growlithe", "gyarados", "haunter", "hitmonchan", | |
"hitmonlee", "horsea", "hypno", "ivysaur", "jigglypuff", "jolteon", "jynx", "kabuto", | |
"kabutops", "kadabra", "kakuna", "kangaskhan", "kingler", "koffing", "krabby", "lapras", "lickitung", "machamp", | |
"machoke", "machop", "magikarp", "magmar", "magnemite", "magneton", "mankey", "marowak", "meowth", "metapod", | |
"m |