diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-04-24 16:42:18 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-04-24 16:42:18 +0200 |
| commit | b4695e613f0bca451485f95572f23d464b56a95e (patch) | |
| tree | f893b2035458b47a9b8bbdb3a78205511d2ce3c5 /tflite/src | |
Initial importmain
Diffstat (limited to 'tflite/src')
31 files changed, 819 insertions, 0 deletions
diff --git a/tflite/src/main/AndroidManifest.xml b/tflite/src/main/AndroidManifest.xml new file mode 100644 index 0000000..d38c505 --- /dev/null +++ b/tflite/src/main/AndroidManifest.xml | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2020 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 18 | xmlns:tools="http://schemas.android.com/tools"> | ||
| 19 | |||
| 20 | <!-- Declare features --> | ||
| 21 | <uses-feature android:name="android.hardware.camera" /> | ||
| 22 | |||
| 23 | <!-- Declare permissions --> | ||
| 24 | <uses-permission android:name="android.permission.CAMERA" /> | ||
| 25 | <uses-permission android:name="android.permission.INTERNET" /> | ||
| 26 | |||
| 27 | <application | ||
| 28 | android:allowBackup="true" | ||
| 29 | android:icon="@mipmap/ic_launcher" | ||
| 30 | android:label="@string/app_name" | ||
| 31 | android:roundIcon="@mipmap/ic_launcher_round" | ||
| 32 | android:supportsRtl="true" | ||
| 33 | android:theme="@style/AppTheme" | ||
| 34 | android:screenOrientation="landscape" | ||
| 35 | |||
| 36 | tools:ignore="AllowBackup,GoogleAppIndexingWarning"> | ||
| 37 | |||
| 38 | <activity | ||
| 39 | android:name="com.example.android.camerax.tflite.CameraActivity" | ||
| 40 | android:rotationAnimation="seamless" | ||
| 41 | android:screenOrientation="landscape" | ||
| 42 | tools:targetApi="O"> | ||
| 43 | <intent-filter> | ||
| 44 | <action android:name="android.intent.action.MAIN"/> | ||
| 45 | <category android:name="android.intent.category.LAUNCHER"/> | ||
| 46 | </intent-filter> | ||
| 47 | </activity> | ||
| 48 | |||
| 49 | </application> | ||
| 50 | |||
| 51 | </manifest> | ||
diff --git a/tflite/src/main/ic_launcher-playstore.png b/tflite/src/main/ic_launcher-playstore.png new file mode 100644 index 0000000..dd70d80 --- /dev/null +++ b/tflite/src/main/ic_launcher-playstore.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/java/com/example/android/camerax/tflite/CameraActivity.kt b/tflite/src/main/java/com/example/android/camerax/tflite/CameraActivity.kt new file mode 100644 index 0000000..cde9778 --- /dev/null +++ b/tflite/src/main/java/com/example/android/camerax/tflite/CameraActivity.kt | |||
| @@ -0,0 +1,281 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2020 Google LLC | ||
| 3 | * | ||
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | * you may not use this file except in compliance with the License. | ||
| 6 | * You may obtain a copy of the License at | ||
| 7 | * | ||
| 8 | * https://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | * | ||
| 10 | * Unless required by applicable law or agreed to in writing, software | ||
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | * See the License for the specific language governing permissions and | ||
| 14 | * limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | package com.example.android.camerax.tflite | ||
| 18 | |||
| 19 | import android.Manifest | ||
| 20 | import android.annotation.SuppressLint | ||
| 21 | import android.content.Context | ||
| 22 | import android.content.pm.PackageManager | ||
| 23 | import android.graphics.Bitmap | ||
| 24 | import android.graphics.Color | ||
| 25 | import android.graphics.Matrix | ||
| 26 | import android.graphics.RectF | ||
| 27 | import android.os.Bundle | ||
| 28 | import android.util.Log | ||
| 29 | import android.util.Size | ||
| 30 | import android.view.View | ||
| 31 | import android.view.ViewGroup | ||
| 32 | import androidx.appcompat.app.AppCompatActivity | ||
| 33 | import androidx.camera.core.AspectRatio | ||
| 34 | import androidx.camera.core.CameraSelector | ||
| 35 | import androidx.camera.core.ImageAnalysis | ||
| 36 | import androidx.camera.core.Preview | ||
| 37 | import androidx.camera.lifecycle.ProcessCameraProvider | ||
| 38 | import androidx.core.app.ActivityCompat | ||
| 39 | import androidx.core.content.ContextCompat | ||
| 40 | import androidx.lifecycle.LifecycleOwner | ||
| 41 | import com.android.example.camerax.tflite.databinding.ActivityCameraBinding | ||
| 42 | import java.net.DatagramPacket | ||
| 43 | import java.net.DatagramSocket | ||
| 44 | import java.net.InetSocketAddress | ||
| 45 | import java.util.concurrent.Executors | ||
| 46 | import java.util.concurrent.TimeUnit | ||
| 47 | import kotlin.random.Random | ||
| 48 | |||
| 49 | |||
| 50 | /** Activity that displays the camera and performs object detection on the incoming frames */ | ||
| 51 | class CameraActivity : AppCompatActivity() { | ||
| 52 | |||
| 53 | private lateinit var activityCameraBinding: ActivityCameraBinding | ||
| 54 | |||
| 55 | private lateinit var bitmapBuffer: Bitmap | ||
| 56 | |||
| 57 | private val executor = Executors.newSingleThreadExecutor() | ||
| 58 | private val permissions = listOf(Manifest.permission.CAMERA) | ||
| 59 | private val permissionsRequestCode = Random.nextInt(0, 10000) | ||
| 60 | |||
| 61 | private var lensFacing: Int = CameraSelector.LENS_FACING_BACK | ||
| 62 | private val isFrontFacing get() = lensFacing == CameraSelector.LENS_FACING_FRONT | ||
| 63 | |||
| 64 | private var pauseAnalysis = false | ||
| 65 | private var imageRotationDegrees: Int = 0 | ||
| 66 | private var socket: DatagramSocket = DatagramSocket() | ||
| 67 | |||
| 68 | override fun onCreate(savedInstanceState: Bundle?) { | ||
| 69 | super.onCreate(savedInstanceState) | ||
| 70 | activityCameraBinding = ActivityCameraBinding.inflate(layoutInflater) | ||
| 71 | setContentView(activityCameraBinding.root) | ||
| 72 | } | ||
| 73 | |||
| 74 | override fun onDestroy() { | ||
| 75 | |||
| 76 | // Terminate all outstanding analyzing jobs (if there is any). | ||
| 77 | executor.apply { | ||
| 78 | shutdown() | ||
| 79 | awaitTermination(1000, TimeUnit.MILLISECONDS) | ||
| 80 | } | ||
| 81 | super.onDestroy() | ||
| 82 | } | ||
| 83 | |||
| 84 | /** Declare and bind preview and analysis use cases */ | ||
| 85 | @SuppressLint("UnsafeExperimentalUsageError") | ||
| 86 | private fun bindCameraUseCases() = activityCameraBinding.viewFinder.post { | ||
| 87 | |||
| 88 | val cameraProviderFuture = ProcessCameraProvider.getInstance(this) | ||
| 89 | cameraProviderFuture.addListener ({ | ||
| 90 | |||
| 91 | // Camera provider is now guaranteed to be available | ||
| 92 | val cameraProvider = cameraProviderFuture.get() | ||
| 93 | |||
| 94 | // Set up the view finder use case to display camera preview | ||
| 95 | val preview = Preview.Builder() | ||
| 96 | .setTargetAspectRatio(AspectRatio.RATIO_4_3) | ||
| 97 | .setTargetRotation(activityCameraBinding.viewFinder.display.rotation) | ||
| 98 | .build() | ||
| 99 | |||
| 100 | // Set up the image analysis use case which will process frames in real time | ||
| 101 | val imageAnalysis = ImageAnalysis.Builder() | ||
| 102 | .setTargetResolution(Size(448, 236)) | ||
| 103 | .setTargetRotation(activityCameraBinding.viewFinder.display.rotation) | ||
| 104 | .setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST) | ||
| 105 | .setOutputImageFormat(ImageAnalysis.OUTPUT_IMAGE_FORMAT_RGBA_8888) | ||
| 106 | .build() | ||
| 107 | |||
| 108 | var frameCounter = 0 | ||
| 109 | var lastFpsTimestamp = System.currentTimeMillis() | ||
| 110 | |||
| 111 | imageAnalysis.setAnalyzer(executor, ImageAnalysis.Analyzer { image -> | ||
| 112 | if (!::bitmapBuffer.isInitialized) { | ||
| 113 | // The image rotation and RGB image buffer are initialized only once | ||
| 114 | // the analyzer has started running | ||
| 115 | imageRotationDegrees = image.imageInfo.rotationDegrees | ||
| 116 | bitmapBuffer = Bitmap.createBitmap( | ||
| 117 | image.width, image.height, Bitmap.Config.ARGB_8888) | ||
| 118 | } | ||
| 119 | |||
| 120 | // Early exit: image analysis is in paused state | ||
| 121 | if (pauseAnalysis) { | ||
| 122 | image.close() | ||
| 123 | return@Analyzer | ||
| 124 | } | ||
| 125 | |||
| 126 | // Copy out RGB bits to our shared buffer | ||
| 127 | image.use { bitmapBuffer.copyPixelsFromBuffer(image.planes[0].buffer) } | ||
| 128 | |||
| 129 | // val CAM_WIDTH = 858 | ||
| 130 | // val CAM_HEIGHT = 480 | ||
| 131 | val CAM_WIDTH = 480 | ||
| 132 | val CAM_HEIGHT = 360 | ||
| 133 | |||
| 134 | val DISPLAY_WIDTH = 448 | ||
| 135 | val DISPLAY_HEIGHT = 160 | ||
| 136 | val DISPLAY_VHEIGHT = 236 | ||
| 137 | |||
| 138 | val scaledBitmap = Bitmap.createScaledBitmap(bitmapBuffer, DISPLAY_WIDTH, DISPLAY_VHEIGHT, true) | ||
| 139 | |||
| 140 | val scratch = IntArray((2 + DISPLAY_VHEIGHT) * DISPLAY_WIDTH) | ||
| 141 | val output = UByteArray(10 + DISPLAY_HEIGHT * DISPLAY_WIDTH / 8) | ||
| 142 | output[1] = 0x12u | ||
| 143 | output[4] = 0x23u | ||
| 144 | var offset = 10 | ||
| 145 | /* | ||
| 146 | for ( row in 0..DISPLAY_VHEIGHT - 1) { | ||
| 147 | val zeile = (row * bitmapBuffer.height ) / DISPLAY_VHEIGHT | ||
| 148 | for (column in 0..DISPLAY_WIDTH - 1) { | ||
| 149 | val spalte = (column * bitmapBuffer.width ) / DISPLAY_WIDTH | ||
| 150 | val pixel = bitmapBuffer.getPixel(spalte, zeile) | ||
| 151 | scratch[row * DISPLAY_WIDTH + column] = Color.red(pixel) * 19535 + Color.green(pixel) * 38470 + Color.blue(pixel) * 7448 | ||
| 152 | } | ||
| 153 | } | ||
| 154 | */ | ||
| 155 | scaledBitmap.getPixels(scratch, 0, DISPLAY_WIDTH, 0, 0, DISPLAY_WIDTH, DISPLAY_VHEIGHT) | ||
| 156 | for (off in 0..DISPLAY_VHEIGHT * DISPLAY_WIDTH) | ||
| 157 | scratch[off] = Color.red(scratch[off]) * 19535 + Color.green(scratch[off]) * 38470 + Color.blue(scratch[off]) * 7448 | ||
| 158 | |||
| 159 | var acc = 0 | ||
| 160 | var accv = 0 | ||
| 161 | |||
| 162 | for ( row in 0.. DISPLAY_VHEIGHT - 1) | ||
| 163 | for ( column in 0..DISPLAY_WIDTH - 1) { | ||
| 164 | val pixel = scratch[row * DISPLAY_WIDTH + column] | ||
| 165 | val bwpixel = if (pixel < 0x810000) 0 else 0xFFFFFF | ||
| 166 | |||
| 167 | if (row % 12 < 8) { | ||
| 168 | acc = (acc shl 1) + (bwpixel shr 23) | ||
| 169 | if (++accv == 8) { | ||
| 170 | output[offset++] = acc.toUByte() | ||
| 171 | acc = 0 | ||
| 172 | accv = 0 | ||
| 173 | } | ||
| 174 | } | ||
| 175 | |||
| 176 | val err = (pixel - bwpixel) / 42 | ||
| 177 | fun AddSatShift(xoff : Int, yoff: Int, shift : Int) { | ||
| 178 | val pixelold = scratch[(row + yoff) * DISPLAY_WIDTH + column + xoff ] | ||
| 179 | var r = pixelold + (err shl (16 - shift)) | ||
| 180 | if ( r < 0 ) r = 0 | ||
| 181 | if ( r > 0xFFFFFF) r = 0xFFFFFF | ||
| 182 | scratch[(row + yoff) * DISPLAY_WIDTH + column + xoff ] = r | ||
| 183 | } | ||
| 184 | |||
| 185 | AddSatShift(0, 1, 13) | ||
| 186 | AddSatShift(0, 2, 14) | ||
| 187 | if (column > 0) { | ||
| 188 | AddSatShift(-1, 1, 14) | ||
| 189 | AddSatShift(-1, 2, 15) | ||
| 190 | } | ||
| 191 | |||
| 192 | if (column > 1) { | ||
| 193 | AddSatShift(-2, 1, 15) | ||
| 194 | AddSatShift(-2, 2, 16) | ||
| 195 | } | ||
| 196 | |||
| 197 | if (column < DISPLAY_WIDTH - 1) { | ||
| 198 | AddSatShift( 1, 0, 13) | ||
| 199 | AddSatShift( 1, 1, 14) | ||
| 200 | AddSatShift( 1, 2, 15) | ||
| 201 | } | ||
| 202 | |||
| 203 | if (column < DISPLAY_WIDTH - 2) { | ||
| 204 | AddSatShift( 2, 0, 14) | ||
| 205 | AddSatShift( 2, 1, 15) | ||
| 206 | AddSatShift( 2, 2, 16) | ||
| 207 | } | ||
| 208 | } | ||
| 209 | val address = InetSocketAddress("172.23.42.29", 2342 ) | ||
| 210 | // val address = InetSocketAddress("192.168.178.69", 2342 ) | ||
| 211 | try { | ||
| 212 | socket.send(DatagramPacket(output.toByteArray(), offset, address)) | ||
| 213 | } catch (e: Exception) { | ||
| 214 | // Ignore network exceptions | ||
| 215 | } | ||
| 216 | |||
| 217 | // Compute the FPS of the entire pipeline | ||
| 218 | val frameCount = 10 | ||
| 219 | if (++frameCounter % frameCount == 0) { | ||
| 220 | frameCounter = 0 | ||
| 221 | val now = System.currentTimeMillis() | ||
| 222 | val delta = now - lastFpsTimestamp | ||
| 223 | val fps = 1000 * frameCount.toFloat() / delta | ||
| 224 | // Log.d(TAG, "FPS: ${"%.02f".format(fps)} " + bitmapBuffer.width + " x " + bitmapBuffer.height) | ||
| 225 | |||
| 226 | activityCameraBinding.viewFinder.post { | ||
| 227 | activityCameraBinding.textPrediction.text = "FPS: ${"%.02f".format(fps)}" | ||
| 228 | } | ||
| 229 | |||
| 230 | lastFpsTimestamp = now | ||
| 231 | } | ||
| 232 | }) | ||
| 233 | |||
| 234 | // Create a new camera selector each time, enforcing lens facing | ||
| 235 | val cameraSelector = CameraSelector.Builder().requireLensFacing(lensFacing).build() | ||
| 236 | |||
| 237 | // Apply declared configs to CameraX using the same lifecycle owner | ||
| 238 | cameraProvider.unbindAll() | ||
| 239 | cameraProvider.bindToLifecycle( | ||
| 240 | this as LifecycleOwner, cameraSelector, preview, imageAnalysis) | ||
| 241 | |||
| 242 | // Use the camera object to link our preview use case with the view | ||
| 243 | preview.setSurfaceProvider(activityCameraBinding.viewFinder.surfaceProvider) | ||
| 244 | |||
| 245 | }, ContextCompat.getMainExecutor(this)) | ||
| 246 | } | ||
| 247 | |||
| 248 | override fun onResume() { | ||
| 249 | super.onResume() | ||
| 250 | |||
| 251 | // Request permissions each time the app resumes, since they can be revoked at any time | ||
| 252 | if (!hasPermissions(this)) { | ||
| 253 | ActivityCompat.requestPermissions( | ||
| 254 | this, permissions.toTypedArray(), permissionsRequestCode) | ||
| 255 | } else { | ||
| 256 | bindCameraUseCases() | ||
| 257 | } | ||
| 258 | } | ||
| 259 | |||
| 260 | override fun onRequestPermissionsResult( | ||
| 261 | requestCode: Int, | ||
| 262 | permissions: Array<out String>, | ||
| 263 | grantResults: IntArray | ||
| 264 | ) { | ||
| 265 | super.onRequestPermissionsResult(requestCode, permissions, grantResults) | ||
| 266 | if (requestCode == permissionsRequestCode && hasPermissions(this)) { | ||
| 267 | bindCameraUseCases() | ||
| 268 | } else { | ||
| 269 | finish() // If we don't have the required permissions, we can't run | ||
| 270 | } | ||
| 271 | } | ||
| 272 | |||
| 273 | /** Convenience method used to check if all permissions required by this app are granted */ | ||
| 274 | private fun hasPermissions(context: Context) = permissions.all { | ||
| 275 | ContextCompat.checkSelfPermission(context, it) == PackageManager.PERMISSION_GRANTED | ||
| 276 | } | ||
| 277 | |||
| 278 | companion object { | ||
| 279 | private val TAG = CameraActivity::class.java.simpleName | ||
| 280 | } | ||
| 281 | } | ||
diff --git a/tflite/src/main/res/drawable/ic_launcher_background.xml b/tflite/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..268681b --- /dev/null +++ b/tflite/src/main/res/drawable/ic_launcher_background.xml | |||
| @@ -0,0 +1,89 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2020 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <vector | ||
| 18 | xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 19 | android:height="108dp" | ||
| 20 | android:width="108dp" | ||
| 21 | android:viewportHeight="108" | ||
| 22 | android:viewportWidth="108"> | ||
| 23 | <path android:fillColor="#008577" | ||
| 24 | android:pathData="M0,0h108v108h-108z"/> | ||
| 25 | <path android:fillColor="#00000000" android:pathData="M9,0L9,108" | ||
| 26 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 27 | <path android:fillColor="#00000000" android:pathData="M19,0L19,108" | ||
| 28 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 29 | <path android:fillColor="#00000000" android:pathData="M29,0L29,108" | ||
| 30 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 31 | <path android:fillColor="#00000000" android:pathData="M39,0L39,108" | ||
| 32 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 33 | <path android:fillColor="#00000000" android:pathData="M49,0L49,108" | ||
| 34 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 35 | <path android:fillColor="#00000000" android:pathData="M59,0L59,108" | ||
| 36 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 37 | <path android:fillColor="#00000000" android:pathData="M69,0L69,108" | ||
| 38 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 39 | <path android:fillColor="#00000000" android:pathData="M79,0L79,108" | ||
| 40 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 41 | <path android:fillColor="#00000000" android:pathData="M89,0L89,108" | ||
| 42 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 43 | <path android:fillColor="#00000000" android:pathData="M99,0L99,108" | ||
| 44 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 45 | <path android:fillColor="#00000000" android:pathData="M0,9L108,9" | ||
| 46 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 47 | <path android:fillColor="#00000000" android:pathData="M0,19L108,19" | ||
| 48 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 49 | <path android:fillColor="#00000000" android:pathData="M0,29L108,29" | ||
| 50 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 51 | <path android:fillColor="#00000000" android:pathData="M0,39L108,39" | ||
| 52 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 53 | <path android:fillColor="#00000000" android:pathData="M0,49L108,49" | ||
| 54 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 55 | <path android:fillColor="#00000000" android:pathData="M0,59L108,59" | ||
| 56 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 57 | <path android:fillColor="#00000000" android:pathData="M0,69L108,69" | ||
| 58 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 59 | <path android:fillColor="#00000000" android:pathData="M0,79L108,79" | ||
| 60 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 61 | <path android:fillColor="#00000000" android:pathData="M0,89L108,89" | ||
| 62 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 63 | <path android:fillColor="#00000000" android:pathData="M0,99L108,99" | ||
| 64 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 65 | <path android:fillColor="#00000000" android:pathData="M19,29L89,29" | ||
| 66 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 67 | <path android:fillColor="#00000000" android:pathData="M19,39L89,39" | ||
| 68 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 69 | <path android:fillColor="#00000000" android:pathData="M19,49L89,49" | ||
| 70 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 71 | <path android:fillColor="#00000000" android:pathData="M19,59L89,59" | ||
| 72 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 73 | <path android:fillColor="#00000000" android:pathData="M19,69L89,69" | ||
| 74 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 75 | <path android:fillColor="#00000000" android:pathData="M19,79L89,79" | ||
| 76 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 77 | <path android:fillColor="#00000000" android:pathData="M29,19L29,89" | ||
| 78 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 79 | <path android:fillColor="#00000000" android:pathData="M39,19L39,89" | ||
| 80 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 81 | <path android:fillColor="#00000000" android:pathData="M49,19L49,89" | ||
| 82 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 83 | <path android:fillColor="#00000000" android:pathData="M59,19L59,89" | ||
| 84 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 85 | <path android:fillColor="#00000000" android:pathData="M69,19L69,89" | ||
| 86 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 87 | <path android:fillColor="#00000000" android:pathData="M79,19L79,89" | ||
| 88 | android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
| 89 | </vector> | ||
diff --git a/tflite/src/main/res/drawable/ic_shutter.xml b/tflite/src/main/res/drawable/ic_shutter.xml new file mode 100644 index 0000000..ab352ba --- /dev/null +++ b/tflite/src/main/res/drawable/ic_shutter.xml | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2019 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 18 | <item android:state_pressed="true" android:drawable="@drawable/ic_shutter_pressed" /> | ||
| 19 | <item android:state_focused="true" android:drawable="@drawable/ic_shutter_focused" /> | ||
| 20 | <item android:drawable="@drawable/ic_shutter_normal" /> | ||
| 21 | </selector> \ No newline at end of file | ||
diff --git a/tflite/src/main/res/drawable/ic_shutter_focused.xml b/tflite/src/main/res/drawable/ic_shutter_focused.xml new file mode 100644 index 0000000..fa852ac --- /dev/null +++ b/tflite/src/main/res/drawable/ic_shutter_focused.xml | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2019 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 18 | android:width="24dp" | ||
| 19 | android:height="24dp" | ||
| 20 | android:viewportWidth="74" | ||
| 21 | android:viewportHeight="74"> | ||
| 22 | <path android:fillColor="#FFFFFF" android:fillType="evenOdd" | ||
| 23 | android:pathData="M73.1,37C73.1,17.0637 56.9373,0.9 37,0.9C17.0627,0.9 0.9,17.0637 0.9,37C0.9,56.9373 17.0627,73.1 37,73.1C56.9373,73.1 73.1,56.9373 73.1,37" | ||
| 24 | android:strokeColor="#00000000" android:strokeWidth="1"/> | ||
| 25 | <path android:fillColor="#58A0C4" android:fillType="evenOdd" | ||
| 26 | android:pathData="M67.4,37C67.4,53.7895 53.7895,67.4 37,67.4C20.2105,67.4 6.6,53.7895 6.6,37C6.6,20.2105 20.2105,6.6 37,6.6C53.7895,6.6 67.4,20.2105 67.4,37" | ||
| 27 | android:strokeColor="#00000000" android:strokeWidth="1"/> | ||
| 28 | </vector> | ||
diff --git a/tflite/src/main/res/drawable/ic_shutter_normal.xml b/tflite/src/main/res/drawable/ic_shutter_normal.xml new file mode 100644 index 0000000..25a10e1 --- /dev/null +++ b/tflite/src/main/res/drawable/ic_shutter_normal.xml | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2019 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 18 | android:width="24dp" | ||
| 19 | android:height="24dp" | ||
| 20 | android:viewportWidth="74" | ||
| 21 | android:viewportHeight="74"> | ||
| 22 | <path android:fillColor="#FFFFFF" android:fillType="evenOdd" | ||
| 23 | android:pathData="M73.1,37C73.1,17.0637 56.9373,0.9 37,0.9C17.0627,0.9 0.9,17.0637 0.9,37C0.9,56.9373 17.0627,73.1 37,73.1C56.9373,73.1 73.1,56.9373 73.1,37" | ||
| 24 | android:strokeColor="#00000000" android:strokeWidth="1"/> | ||
| 25 | <path android:fillColor="#CFD7DB" android:fillType="evenOdd" | ||
| 26 | android:pathData="M67.4,37C67.4,53.7895 53.7895,67.4 37,67.4C20.2105,67.4 6.6,53.7895 6.6,37C6.6,20.2105 20.2105,6.6 37,6.6C53.7895,6.6 67.4,20.2105 67.4,37" | ||
| 27 | android:strokeColor="#00000000" android:strokeWidth="1"/> | ||
| 28 | </vector> | ||
diff --git a/tflite/src/main/res/drawable/ic_shutter_pressed.xml b/tflite/src/main/res/drawable/ic_shutter_pressed.xml new file mode 100644 index 0000000..fa852ac --- /dev/null +++ b/tflite/src/main/res/drawable/ic_shutter_pressed.xml | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2019 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 18 | android:width="24dp" | ||
| 19 | android:height="24dp" | ||
| 20 | android:viewportWidth="74" | ||
| 21 | android:viewportHeight="74"> | ||
| 22 | <path android:fillColor="#FFFFFF" android:fillType="evenOdd" | ||
| 23 | android:pathData="M73.1,37C73.1,17.0637 56.9373,0.9 37,0.9C17.0627,0.9 0.9,17.0637 0.9,37C0.9,56.9373 17.0627,73.1 37,73.1C56.9373,73.1 73.1,56.9373 73.1,37" | ||
| 24 | android:strokeColor="#00000000" android:strokeWidth="1"/> | ||
| 25 | <path android:fillColor="#58A0C4" android:fillType="evenOdd" | ||
| 26 | android:pathData="M67.4,37C67.4,53.7895 53.7895,67.4 37,67.4C20.2105,67.4 6.6,53.7895 6.6,37C6.6,20.2105 20.2105,6.6 37,6.6C53.7895,6.6 67.4,20.2105 67.4,37" | ||
| 27 | android:strokeColor="#00000000" android:strokeWidth="1"/> | ||
| 28 | </vector> | ||
diff --git a/tflite/src/main/res/drawable/shape_rectangle.xml b/tflite/src/main/res/drawable/shape_rectangle.xml new file mode 100644 index 0000000..5365e4c --- /dev/null +++ b/tflite/src/main/res/drawable/shape_rectangle.xml | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2020 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 18 | android:shape="rectangle"> | ||
| 19 | <corners | ||
| 20 | android:radius="4dp" | ||
| 21 | android:topRightRadius="0dp" | ||
| 22 | android:bottomRightRadius="0dp" | ||
| 23 | android:bottomLeftRadius="0dp" /> | ||
| 24 | <stroke | ||
| 25 | android:width="4dp" | ||
| 26 | android:color="@android:color/white" /> | ||
| 27 | <solid android:color="@android:color/transparent"/> | ||
| 28 | </shape> \ No newline at end of file | ||
diff --git a/tflite/src/main/res/layout-land/activity_camera.xml b/tflite/src/main/res/layout-land/activity_camera.xml new file mode 100644 index 0000000..1cc66f1 --- /dev/null +++ b/tflite/src/main/res/layout-land/activity_camera.xml | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2020 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <androidx.constraintlayout.widget.ConstraintLayout | ||
| 18 | xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 19 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| 20 | xmlns:tools="http://schemas.android.com/tools" | ||
| 21 | android:id="@+id/camera_container" | ||
| 22 | android:background="@android:color/black" | ||
| 23 | android:layout_width="match_parent" | ||
| 24 | android:layout_height="match_parent"> | ||
| 25 | |||
| 26 | <androidx.camera.view.PreviewView | ||
| 27 | android:id="@+id/view_finder" | ||
| 28 | android:layout_width="match_parent" | ||
| 29 | android:layout_height="match_parent"/> | ||
| 30 | |||
| 31 | <ImageView | ||
| 32 | android:id="@+id/image_predicted" | ||
| 33 | android:layout_width="match_parent" | ||
| 34 | android:layout_height="match_parent" | ||
| 35 | android:scaleType="centerCrop" | ||
| 36 | android:visibility="gone" /> | ||
| 37 | |||
| 38 | <TextView | ||
| 39 | android:id="@+id/text_prediction" | ||
| 40 | android:layout_width="wrap_content" | ||
| 41 | android:layout_height="wrap_content" | ||
| 42 | android:layout_marginTop="@dimen/margin_xsmall" | ||
| 43 | app:layout_constraintTop_toTopOf="parent" | ||
| 44 | app:layout_constraintStart_toStartOf="parent" | ||
| 45 | app:layout_constraintEnd_toEndOf="parent" | ||
| 46 | android:textAllCaps="true" | ||
| 47 | android:textAppearance="@style/TextAppearance.AppCompat.Display1" | ||
| 48 | android:text="@string/unknown" /> | ||
| 49 | |||
| 50 | <View | ||
| 51 | android:id="@+id/box_prediction" | ||
| 52 | android:layout_width="0dp" | ||
| 53 | android:layout_height="0dp" | ||
| 54 | android:background="@drawable/shape_rectangle" | ||
| 55 | app:layout_constraintTop_toTopOf="parent" | ||
| 56 | app:layout_constraintStart_toStartOf="parent" /> | ||
| 57 | |||
| 58 | <!-- Camera control buttons --> | ||
| 59 | |||
| 60 | <ImageButton | ||
| 61 | android:id="@+id/camera_capture_button" | ||
| 62 | android:layout_width="@dimen/round_button_large" | ||
| 63 | android:layout_height="@dimen/round_button_large" | ||
| 64 | android:layout_marginEnd="@dimen/shutter_button_margin" | ||
| 65 | android:scaleType="fitCenter" | ||
| 66 | android:background="@drawable/ic_shutter" | ||
| 67 | app:layout_constraintEnd_toEndOf="parent" | ||
| 68 | app:layout_constraintTop_toTopOf="parent" | ||
| 69 | app:layout_constraintBottom_toBottomOf="parent" | ||
| 70 | android:contentDescription="@string/capture_button_alt" /> | ||
| 71 | |||
| 72 | </androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file | ||
diff --git a/tflite/src/main/res/layout/activity_camera.xml b/tflite/src/main/res/layout/activity_camera.xml new file mode 100644 index 0000000..c094f94 --- /dev/null +++ b/tflite/src/main/res/layout/activity_camera.xml | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2020 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <androidx.constraintlayout.widget.ConstraintLayout | ||
| 18 | xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 19 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| 20 | xmlns:tools="http://schemas.android.com/tools" | ||
| 21 | android:id="@+id/camera_container" | ||
| 22 | android:background="@android:color/black" | ||
| 23 | android:layout_width="match_parent" | ||
| 24 | android:layout_height="match_parent"> | ||
| 25 | |||
| 26 | <androidx.camera.view.PreviewView | ||
| 27 | android:id="@+id/view_finder" | ||
| 28 | android:layout_width="match_parent" | ||
| 29 | android:layout_height="match_parent"/> | ||
| 30 | |||
| 31 | <ImageView | ||
| 32 | android:id="@+id/image_predicted" | ||
| 33 | android:layout_width="match_parent" | ||
| 34 | android:layout_height="match_parent" | ||
| 35 | android:scaleType="centerCrop" | ||
| 36 | android:visibility="gone" /> | ||
| 37 | |||
| 38 | <TextView | ||
| 39 | android:id="@+id/text_prediction" | ||
| 40 | android:layout_width="wrap_content" | ||
| 41 | android:layout_height="wrap_content" | ||
| 42 | android:layout_marginTop="@dimen/margin_xsmall" | ||
| 43 | app:layout_constraintTop_toTopOf="parent" | ||
| 44 | app:layout_constraintStart_toStartOf="parent" | ||
| 45 | app:layout_constraintEnd_toEndOf="parent" | ||
| 46 | android:textAllCaps="true" | ||
| 47 | android:textAppearance="@style/TextAppearance.AppCompat.Display1" | ||
| 48 | android:text="@string/unknown" /> | ||
| 49 | |||
| 50 | <View | ||
| 51 | android:id="@+id/box_prediction" | ||
| 52 | android:layout_width="0dp" | ||
| 53 | android:layout_height="0dp" | ||
| 54 | android:background="@drawable/shape_rectangle" | ||
| 55 | app:layout_constraintTop_toTopOf="parent" | ||
| 56 | app:layout_constraintStart_toStartOf="parent" /> | ||
| 57 | |||
| 58 | <!-- Camera control buttons --> | ||
| 59 | |||
| 60 | <ImageButton | ||
| 61 | android:id="@+id/camera_capture_button" | ||
| 62 | android:layout_width="@dimen/round_button_large" | ||
| 63 | android:layout_height="@dimen/round_button_large" | ||
| 64 | android:layout_marginBottom="@dimen/shutter_button_margin" | ||
| 65 | android:scaleType="fitCenter" | ||
| 66 | android:background="@drawable/ic_shutter" | ||
| 67 | app:layout_constraintLeft_toLeftOf="parent" | ||
| 68 | app:layout_constraintRight_toRightOf="parent" | ||
| 69 | app:layout_constraintBottom_toBottomOf="parent" | ||
| 70 | android:contentDescription="@string/capture_button_alt" /> | ||
| 71 | |||
| 72 | </androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file | ||
diff --git a/tflite/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/tflite/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..fe90d56 --- /dev/null +++ b/tflite/src/main/res/mipmap-anydpi-v26/ic_launcher.xml | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2019 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 18 | <background android:drawable="@drawable/ic_launcher_background"/> | ||
| 19 | <foreground android:drawable="@mipmap/ic_launcher_foreground"/> | ||
| 20 | </adaptive-icon> \ No newline at end of file | ||
diff --git a/tflite/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/tflite/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..fe90d56 --- /dev/null +++ b/tflite/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2019 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 18 | <background android:drawable="@drawable/ic_launcher_background"/> | ||
| 19 | <foreground android:drawable="@mipmap/ic_launcher_foreground"/> | ||
| 20 | </adaptive-icon> \ No newline at end of file | ||
diff --git a/tflite/src/main/res/mipmap-hdpi/ic_launcher.png b/tflite/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..edd7b36 --- /dev/null +++ b/tflite/src/main/res/mipmap-hdpi/ic_launcher.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/tflite/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..a050bf2 --- /dev/null +++ b/tflite/src/main/res/mipmap-hdpi/ic_launcher_foreground.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-hdpi/ic_launcher_round.png b/tflite/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..ec13a43 --- /dev/null +++ b/tflite/src/main/res/mipmap-hdpi/ic_launcher_round.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-mdpi/ic_launcher.png b/tflite/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..6fd4f91 --- /dev/null +++ b/tflite/src/main/res/mipmap-mdpi/ic_launcher.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/tflite/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..df81982 --- /dev/null +++ b/tflite/src/main/res/mipmap-mdpi/ic_launcher_foreground.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-mdpi/ic_launcher_round.png b/tflite/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..2616048 --- /dev/null +++ b/tflite/src/main/res/mipmap-mdpi/ic_launcher_round.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-xhdpi/ic_launcher.png b/tflite/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..fdae11d --- /dev/null +++ b/tflite/src/main/res/mipmap-xhdpi/ic_launcher.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/tflite/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..667d566 --- /dev/null +++ b/tflite/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/tflite/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..cb11f72 --- /dev/null +++ b/tflite/src/main/res/mipmap-xhdpi/ic_launcher_round.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-xxhdpi/ic_launcher.png b/tflite/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..5d4fa36 --- /dev/null +++ b/tflite/src/main/res/mipmap-xxhdpi/ic_launcher.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/tflite/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..33dc1c6 --- /dev/null +++ b/tflite/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/tflite/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..07d1393 --- /dev/null +++ b/tflite/src/main/res/mipmap-xxhdpi/ic_launcher_round.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/tflite/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..675e313 --- /dev/null +++ b/tflite/src/main/res/mipmap-xxxhdpi/ic_launcher.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/tflite/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..9f9808a --- /dev/null +++ b/tflite/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/tflite/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..54e07e0 --- /dev/null +++ b/tflite/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png | |||
| Binary files differ | |||
diff --git a/tflite/src/main/res/values/dimens.xml b/tflite/src/main/res/values/dimens.xml new file mode 100644 index 0000000..53948b6 --- /dev/null +++ b/tflite/src/main/res/values/dimens.xml | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2020 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <resources> | ||
| 18 | <dimen name="margin_xsmall">16dp</dimen> | ||
| 19 | <dimen name="margin_small">32dp</dimen> | ||
| 20 | <dimen name="margin_medium">48dp</dimen> | ||
| 21 | <dimen name="margin_large">64dp</dimen> | ||
| 22 | <dimen name="margin_xlarge">92dp</dimen> | ||
| 23 | |||
| 24 | <dimen name="spacing_small">4dp</dimen> | ||
| 25 | <dimen name="spacing_medium">8dp</dimen> | ||
| 26 | <dimen name="spacing_large">16dp</dimen> | ||
| 27 | |||
| 28 | <dimen name="round_button_small">32dp</dimen> | ||
| 29 | <dimen name="round_button_medium">64dp</dimen> | ||
| 30 | <dimen name="round_button_large">92dp</dimen> | ||
| 31 | |||
| 32 | <dimen name="shutter_button_margin">80dp</dimen> | ||
| 33 | </resources> \ No newline at end of file | ||
diff --git a/tflite/src/main/res/values/strings.xml b/tflite/src/main/res/values/strings.xml new file mode 100644 index 0000000..dbfb4c0 --- /dev/null +++ b/tflite/src/main/res/values/strings.xml | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2020 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <resources> | ||
| 18 | <string name="app_name">Camera Object Detector</string> | ||
| 19 | <string name="capture_button_alt">Capture</string> | ||
| 20 | <string name="unknown">UNKNOWN</string> | ||
| 21 | </resources> | ||
diff --git a/tflite/src/main/res/values/styles.xml b/tflite/src/main/res/values/styles.xml new file mode 100644 index 0000000..8bfac62 --- /dev/null +++ b/tflite/src/main/res/values/styles.xml | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- | ||
| 3 | ~ Copyright 2020 Google LLC | ||
| 4 | ~ | ||
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | ~ you may not use this file except in compliance with the License. | ||
| 7 | ~ You may obtain a copy of the License at | ||
| 8 | ~ | ||
| 9 | ~ https://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | ~ | ||
| 11 | ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | ~ See the License for the specific language governing permissions and | ||
| 15 | ~ limitations under the License. | ||
| 16 | --> | ||
| 17 | <resources> | ||
| 18 | |||
| 19 | <!-- Base application theme. --> | ||
| 20 | <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar"> | ||
| 21 | <item name="android:immersive">true</item> | ||
| 22 | <item name="android:windowFullscreen">true</item> | ||
| 23 | <item name="android:windowTranslucentStatus">true</item> | ||
| 24 | <item name="android:windowTranslucentNavigation">true</item> | ||
| 25 | </style> | ||
| 26 | |||
| 27 | </resources> | ||
