Skip to content

Instantly share code, notes, and snippets.

🚀
To Boldly Go Where No Man Has Gone Before

Harshit Dwivedi the-dagger

🚀
To Boldly Go Where No Man Has Gone Before
Block or report user

Report or block the-dagger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MainActivity.kt
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
private val itemMap by lazy {
View MainActivity.kt
class MainActivity : AppCompatActivity() {
//Map that will contain a key-value combination of detected items
private val itemMap by lazy {
hashMapOf<String, Int>()
}
override fun onCreate(savedInstanceState: Bundle?) {
val objectPredictor = FritzVisionObjectPredictor.getInstance(this)
var fritzVisionImage: FritzVisionImage
cameraView.addFrameProcessor { frame ->
View MainActivity.kt
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
val objectPredictor = FritzVisionObjectPredictor.getInstance(this)
var fritzVisionImage: FritzVisionImage
cameraView.addFrameProcessor { frame ->
if (yuvDataLength == 0) {
//Run this only once
initializeData()
}
View MainActivity.kt
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
//Rest of the code
View MainActivity.kt
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?) {
View MainActivity.kt
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
Fritz.configure(this)
cameraView.addFrameProcessor { frame ->
//This returns a frame, which cann be used to retrieve the preview
}
View MainActivity.kt
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()
View activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.otaliastudios.cameraview.CameraView
android:id="@+id/cameraView"
android:layout_width="match_parent"
View publish.js
var avroSchema = {
type: 'record',
name: 'MyClass',
namespace: 'com.test.avro',
fields: [
{
name: 'anonymousId',
type: 'string'
},
{
View gist:c792ecdab456a0a8696e28459035f8d1
[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
You can’t perform that action at this time.