├── README.md
├── android_app
└── android_app
│ ├── .gitignore
│ ├── README.md
│ ├── app
│ ├── .gitignore
│ ├── build.gradle.kts
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── surendramaran
│ │ │ └── yolov8tflite
│ │ │ └── ExampleInstrumentedTest.kt
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── assets
│ │ │ ├── labels.txt
│ │ │ └── model.tflite
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── surendramaran
│ │ │ │ └── yolov8tflite
│ │ │ │ ├── BoundingBox.kt
│ │ │ │ ├── Constants.kt
│ │ │ │ ├── Detector.kt
│ │ │ │ ├── MainActivity.kt
│ │ │ │ └── OverlayView.kt
│ │ └── res
│ │ │ ├── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── drawable
│ │ │ └── ic_launcher_background.xml
│ │ │ ├── layout
│ │ │ └── activity_main.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── values-night
│ │ │ └── themes.xml
│ │ │ ├── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── themes.xml
│ │ │ └── xml
│ │ │ ├── backup_rules.xml
│ │ │ └── data_extraction_rules.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── surendramaran
│ │ └── yolov8tflite
│ │ └── ExampleUnitTest.kt
│ ├── build.gradle.kts
│ ├── gradle.properties
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle.kts
├── test_images
└── b.jpg
├── train_export_yolov8_model.ipynb
└── update.py
/README.md:
--------------------------------------------------------------------------------
1 | # Object detection app using YOLOv8 and Android
2 |
3 | ### Check the video to understand the code: https://youtu.be/dl7rCmvIyiI
4 |
5 | ## Step 1 (Train and export Object detection model):
6 | - git clone https://github.com/AarohiSingla/Object-Detection-Android-App.git
7 |
8 | - Train yolov8 model on custom dataset and export it in .tflite format. (Check train_export_yolov8_model.ipynb )
9 |
10 | ## Step 2 (Object detection android app setup):
11 | - Open android_app folder.
12 |
13 | - Put your .tflite model and .txt label file inside the assets folder. You can find assets folder at this location: android_app\android_app\app\src\main\assets
14 |
15 | - Rename paths of your model and labels file in Constants.kt file. You can find Constants.kt at this location: android_app\android_app\app\src\main\java\com\surendramaran\yolov8tflite
16 |
17 | - Download and install Android Studio from the official website (https://developer.android.com/studio)
18 |
19 | - Once installed, open Android Studio from your applications menu.
20 |
21 | - When Android Studio opens, you'll see a welcome screen. Here, you'll find options to create a new project, open an existing project, or check out project from version control.Since you already have a project, click on "Open an existing Android Studio project".
22 |
23 | - Navigate to the directory where your project is located and select the project's root folder.
24 |
25 | - Build and Run
26 | 
27 |
28 |
29 |
30 |
31 | ## Credits
32 |
33 | This project includes the andrroid app code from the following repository:
34 |
35 | - [Original Repository Name](https://github.com/surendramaran/YOLOv8-TfLite-Object-Detector)
36 |
37 | Special thanks to [link-to-original-author-profile](https://github.com/surendramaran) for their contribution.
38 |
--------------------------------------------------------------------------------
/android_app/android_app/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/android_app/android_app/README.md:
--------------------------------------------------------------------------------
1 | ## YOLOv8 Live Object Detection Android Application
2 |
3 | ### Description
4 | This Android application is designed to perform live object detection using the YOLOv8 machine learning model. YOLOv8 (You Only Look Once version 8) is known for its real-time object detection capabilities, and this app brings that functionality to Android devices.
5 |
6 | ### Getting Started
7 | To use this repository for any custom YOLOv8 Object detection model, follow these steps:
8 | 1. Clone this repository to your local machine using `git clone https://github.com/surendramaran/YOLOv8-TfLite-Object-Detector`.
9 | 2. Put your .tflite model and .txt label file inside the assets folder
10 | 3. Rename paths of your model and labels file in Constants.kt file
11 | 4. **Build and Run:**
12 |
13 |
14 |
--------------------------------------------------------------------------------
/android_app/android_app/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/android_app/android_app/app/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.application")
3 | id("org.jetbrains.kotlin.android")
4 | }
5 |
6 | android {
7 | namespace = "com.surendramaran.yolov8tflite"
8 | compileSdk = 34
9 |
10 | defaultConfig {
11 | applicationId = "com.surendramaran.yolov8tflite"
12 | minSdk = 21
13 | targetSdk = 34
14 | versionCode = 1
15 | versionName = "1.0"
16 |
17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18 | }
19 |
20 | buildTypes {
21 | release {
22 | isMinifyEnabled = false
23 | proguardFiles(
24 | getDefaultProguardFile("proguard-android-optimize.txt"),
25 | "proguard-rules.pro"
26 | )
27 | }
28 | }
29 | compileOptions {
30 | sourceCompatibility = JavaVersion.VERSION_1_8
31 | targetCompatibility = JavaVersion.VERSION_1_8
32 | }
33 | kotlinOptions {
34 | jvmTarget = "1.8"
35 | }
36 |
37 | buildFeatures {
38 | viewBinding = true
39 | }
40 | }
41 |
42 | dependencies {
43 |
44 | implementation("androidx.core:core-ktx:1.12.0")
45 | implementation("androidx.appcompat:appcompat:1.6.1")
46 | implementation("com.google.android.material:material:1.11.0")
47 | implementation("androidx.constraintlayout:constraintlayout:2.1.4")
48 | testImplementation("junit:junit:4.13.2")
49 | androidTestImplementation("androidx.test.ext:junit:1.1.5")
50 | androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
51 |
52 | val cameraxVersion = "1.4.0-alpha03"
53 | implementation("androidx.camera:camera-camera2:${cameraxVersion}")
54 | implementation("androidx.camera:camera-lifecycle:${cameraxVersion}")
55 | implementation("androidx.camera:camera-view:${cameraxVersion}")
56 |
57 | implementation("org.tensorflow:tensorflow-lite:2.14.0")
58 | implementation("org.tensorflow:tensorflow-lite-support:0.4.4")
59 | }
--------------------------------------------------------------------------------
/android_app/android_app/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/android_app/android_app/app/src/androidTest/java/com/surendramaran/yolov8tflite/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.surendramaran.yolov8tflite
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.surendramaran.yolov8tflite", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/assets/labels.txt:
--------------------------------------------------------------------------------
1 | fork
2 | knife
3 | plate
4 | spoon
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/assets/model.tflite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/android_app/android_app/app/src/main/assets/model.tflite
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/java/com/surendramaran/yolov8tflite/BoundingBox.kt:
--------------------------------------------------------------------------------
1 | package com.surendramaran.yolov8tflite
2 |
3 | data class BoundingBox(
4 | val x1: Float,
5 | val y1: Float,
6 | val x2: Float,
7 | val y2: Float,
8 | val cx: Float,
9 | val cy: Float,
10 | val w: Float,
11 | val h: Float,
12 | val cnf: Float,
13 | val cls: Int,
14 | val clsName: String
15 | )
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/java/com/surendramaran/yolov8tflite/Constants.kt:
--------------------------------------------------------------------------------
1 | package com.surendramaran.yolov8tflite
2 |
3 | object Constants {
4 | const val MODEL_PATH = "model.tflite"
5 | const val LABELS_PATH = "labels.txt"
6 | }
7 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/java/com/surendramaran/yolov8tflite/Detector.kt:
--------------------------------------------------------------------------------
1 | package com.surendramaran.yolov8tflite
2 |
3 | import android.content.Context
4 | import android.graphics.Bitmap
5 | import android.os.SystemClock
6 | import org.tensorflow.lite.DataType
7 | import org.tensorflow.lite.Interpreter
8 | import org.tensorflow.lite.support.common.FileUtil
9 | import org.tensorflow.lite.support.common.ops.CastOp
10 | import org.tensorflow.lite.support.common.ops.NormalizeOp
11 | import org.tensorflow.lite.support.image.ImageProcessor
12 | import org.tensorflow.lite.support.image.TensorImage
13 | import org.tensorflow.lite.support.tensorbuffer.TensorBuffer
14 | import java.io.BufferedReader
15 | import java.io.IOException
16 | import java.io.InputStream
17 | import java.io.InputStreamReader
18 |
19 | class Detector(
20 | private val context: Context,
21 | private val modelPath: String,
22 | private val labelPath: String,
23 | private val detectorListener: DetectorListener
24 | ) {
25 |
26 | private var interpreter: Interpreter? = null
27 | private var labels = mutableListOf()
28 |
29 | private var tensorWidth = 0
30 | private var tensorHeight = 0
31 | private var numChannel = 0
32 | private var numElements = 0
33 |
34 | private val imageProcessor = ImageProcessor.Builder()
35 | .add(NormalizeOp(INPUT_MEAN, INPUT_STANDARD_DEVIATION))
36 | .add(CastOp(INPUT_IMAGE_TYPE))
37 | .build()
38 |
39 | fun setup() {
40 | val model = FileUtil.loadMappedFile(context, modelPath)
41 | val options = Interpreter.Options()
42 | options.numThreads = 4
43 | interpreter = Interpreter(model, options)
44 |
45 | val inputShape = interpreter?.getInputTensor(0)?.shape() ?: return
46 | val outputShape = interpreter?.getOutputTensor(0)?.shape() ?: return
47 |
48 | tensorWidth = inputShape[1]
49 | tensorHeight = inputShape[2]
50 | numChannel = outputShape[1]
51 | numElements = outputShape[2]
52 |
53 | try {
54 | val inputStream: InputStream = context.assets.open(labelPath)
55 | val reader = BufferedReader(InputStreamReader(inputStream))
56 |
57 | var line: String? = reader.readLine()
58 | while (line != null && line != "") {
59 | labels.add(line)
60 | line = reader.readLine()
61 | }
62 |
63 | reader.close()
64 | inputStream.close()
65 | } catch (e: IOException) {
66 | e.printStackTrace()
67 | }
68 | }
69 |
70 | fun clear() {
71 | interpreter?.close()
72 | interpreter = null
73 | }
74 |
75 | fun detect(frame: Bitmap) {
76 | interpreter ?: return
77 | if (tensorWidth == 0) return
78 | if (tensorHeight == 0) return
79 | if (numChannel == 0) return
80 | if (numElements == 0) return
81 |
82 | var inferenceTime = SystemClock.uptimeMillis()
83 |
84 | val resizedBitmap = Bitmap.createScaledBitmap(frame, tensorWidth, tensorHeight, false)
85 |
86 | val tensorImage = TensorImage(DataType.FLOAT32)
87 | tensorImage.load(resizedBitmap)
88 | val processedImage = imageProcessor.process(tensorImage)
89 | val imageBuffer = processedImage.buffer
90 |
91 | val output = TensorBuffer.createFixedSize(intArrayOf(1 , numChannel, numElements), OUTPUT_IMAGE_TYPE)
92 | interpreter?.run(imageBuffer, output.buffer)
93 |
94 |
95 | val bestBoxes = bestBox(output.floatArray)
96 | inferenceTime = SystemClock.uptimeMillis() - inferenceTime
97 |
98 |
99 | if (bestBoxes == null) {
100 | detectorListener.onEmptyDetect()
101 | return
102 | }
103 |
104 | detectorListener.onDetect(bestBoxes, inferenceTime)
105 | }
106 |
107 | private fun bestBox(array: FloatArray) : List? {
108 |
109 | val boundingBoxes = mutableListOf()
110 |
111 | for (c in 0 until numElements) {
112 | var maxConf = -1.0f
113 | var maxIdx = -1
114 | var j = 4
115 | var arrayIdx = c + numElements * j
116 | while (j < numChannel){
117 | if (array[arrayIdx] > maxConf) {
118 | maxConf = array[arrayIdx]
119 | maxIdx = j - 4
120 | }
121 | j++
122 | arrayIdx += numElements
123 | }
124 |
125 | if (maxConf > CONFIDENCE_THRESHOLD) {
126 | val clsName = labels[maxIdx]
127 | val cx = array[c] // 0
128 | val cy = array[c + numElements] // 1
129 | val w = array[c + numElements * 2]
130 | val h = array[c + numElements * 3]
131 | val x1 = cx - (w/2F)
132 | val y1 = cy - (h/2F)
133 | val x2 = cx + (w/2F)
134 | val y2 = cy + (h/2F)
135 | if (x1 < 0F || x1 > 1F) continue
136 | if (y1 < 0F || y1 > 1F) continue
137 | if (x2 < 0F || x2 > 1F) continue
138 | if (y2 < 0F || y2 > 1F) continue
139 |
140 | boundingBoxes.add(
141 | BoundingBox(
142 | x1 = x1, y1 = y1, x2 = x2, y2 = y2,
143 | cx = cx, cy = cy, w = w, h = h,
144 | cnf = maxConf, cls = maxIdx, clsName = clsName
145 | )
146 | )
147 | }
148 | }
149 |
150 | if (boundingBoxes.isEmpty()) return null
151 |
152 | return applyNMS(boundingBoxes)
153 | }
154 |
155 | private fun applyNMS(boxes: List) : MutableList {
156 | val sortedBoxes = boxes.sortedByDescending { it.cnf }.toMutableList()
157 | val selectedBoxes = mutableListOf()
158 |
159 | while(sortedBoxes.isNotEmpty()) {
160 | val first = sortedBoxes.first()
161 | selectedBoxes.add(first)
162 | sortedBoxes.remove(first)
163 |
164 | val iterator = sortedBoxes.iterator()
165 | while (iterator.hasNext()) {
166 | val nextBox = iterator.next()
167 | val iou = calculateIoU(first, nextBox)
168 | if (iou >= IOU_THRESHOLD) {
169 | iterator.remove()
170 | }
171 | }
172 | }
173 |
174 | return selectedBoxes
175 | }
176 |
177 | private fun calculateIoU(box1: BoundingBox, box2: BoundingBox): Float {
178 | val x1 = maxOf(box1.x1, box2.x1)
179 | val y1 = maxOf(box1.y1, box2.y1)
180 | val x2 = minOf(box1.x2, box2.x2)
181 | val y2 = minOf(box1.y2, box2.y2)
182 | val intersectionArea = maxOf(0F, x2 - x1) * maxOf(0F, y2 - y1)
183 | val box1Area = box1.w * box1.h
184 | val box2Area = box2.w * box2.h
185 | return intersectionArea / (box1Area + box2Area - intersectionArea)
186 | }
187 |
188 | interface DetectorListener {
189 | fun onEmptyDetect()
190 | fun onDetect(boundingBoxes: List, inferenceTime: Long)
191 | }
192 |
193 | companion object {
194 | private const val INPUT_MEAN = 0f
195 | private const val INPUT_STANDARD_DEVIATION = 255f
196 | private val INPUT_IMAGE_TYPE = DataType.FLOAT32
197 | private val OUTPUT_IMAGE_TYPE = DataType.FLOAT32
198 | private const val CONFIDENCE_THRESHOLD = 0.3F
199 | private const val IOU_THRESHOLD = 0.5F
200 | }
201 | }
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/java/com/surendramaran/yolov8tflite/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.surendramaran.yolov8tflite
2 |
3 | import android.Manifest
4 | import android.content.pm.PackageManager
5 | import android.graphics.Bitmap
6 | import android.graphics.Matrix
7 | import android.os.Bundle
8 | import android.util.Log
9 | import androidx.activity.result.contract.ActivityResultContracts
10 | import androidx.appcompat.app.AppCompatActivity
11 | import androidx.camera.core.AspectRatio
12 | import androidx.camera.core.Camera
13 | import androidx.camera.core.CameraSelector
14 | import androidx.camera.core.ImageAnalysis
15 | import androidx.camera.core.Preview
16 | import androidx.camera.lifecycle.ProcessCameraProvider
17 | import androidx.core.app.ActivityCompat
18 | import androidx.core.content.ContextCompat
19 | import com.surendramaran.yolov8tflite.Constants.LABELS_PATH
20 | import com.surendramaran.yolov8tflite.Constants.MODEL_PATH
21 | import com.surendramaran.yolov8tflite.databinding.ActivityMainBinding
22 | import java.util.concurrent.ExecutorService
23 | import java.util.concurrent.Executors
24 |
25 | class MainActivity : AppCompatActivity(), Detector.DetectorListener {
26 | private lateinit var binding: ActivityMainBinding
27 | private val isFrontCamera = false
28 |
29 | private var preview: Preview? = null
30 | private var imageAnalyzer: ImageAnalysis? = null
31 | private var camera: Camera? = null
32 | private var cameraProvider: ProcessCameraProvider? = null
33 | private lateinit var detector: Detector
34 |
35 | private lateinit var cameraExecutor: ExecutorService
36 |
37 | override fun onCreate(savedInstanceState: Bundle?) {
38 | super.onCreate(savedInstanceState)
39 | binding = ActivityMainBinding.inflate(layoutInflater)
40 | setContentView(binding.root)
41 |
42 | detector = Detector(baseContext, MODEL_PATH, LABELS_PATH, this)
43 | detector.setup()
44 |
45 | if (allPermissionsGranted()) {
46 | startCamera()
47 | } else {
48 | ActivityCompat.requestPermissions(this, REQUIRED_PERMISSIONS, REQUEST_CODE_PERMISSIONS)
49 | }
50 |
51 | cameraExecutor = Executors.newSingleThreadExecutor()
52 | }
53 |
54 | private fun startCamera() {
55 | val cameraProviderFuture = ProcessCameraProvider.getInstance(this)
56 | cameraProviderFuture.addListener({
57 | cameraProvider = cameraProviderFuture.get()
58 | bindCameraUseCases()
59 | }, ContextCompat.getMainExecutor(this))
60 | }
61 |
62 | private fun bindCameraUseCases() {
63 | val cameraProvider = cameraProvider ?: throw IllegalStateException("Camera initialization failed.")
64 |
65 | val rotation = binding.viewFinder.display.rotation
66 |
67 | val cameraSelector = CameraSelector
68 | .Builder()
69 | .requireLensFacing(CameraSelector.LENS_FACING_BACK)
70 | .build()
71 |
72 | preview = Preview.Builder()
73 | .setTargetAspectRatio(AspectRatio.RATIO_4_3)
74 | .setTargetRotation(rotation)
75 | .build()
76 |
77 | imageAnalyzer = ImageAnalysis.Builder()
78 | .setTargetAspectRatio(AspectRatio.RATIO_4_3)
79 | .setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST)
80 | .setTargetRotation(binding.viewFinder.display.rotation)
81 | .setOutputImageFormat(ImageAnalysis.OUTPUT_IMAGE_FORMAT_RGBA_8888)
82 | .build()
83 |
84 | imageAnalyzer?.setAnalyzer(cameraExecutor) { imageProxy ->
85 | val bitmapBuffer =
86 | Bitmap.createBitmap(
87 | imageProxy.width,
88 | imageProxy.height,
89 | Bitmap.Config.ARGB_8888
90 | )
91 | imageProxy.use { bitmapBuffer.copyPixelsFromBuffer(imageProxy.planes[0].buffer) }
92 | imageProxy.close()
93 |
94 | val matrix = Matrix().apply {
95 | postRotate(imageProxy.imageInfo.rotationDegrees.toFloat())
96 |
97 | if (isFrontCamera) {
98 | postScale(
99 | -1f,
100 | 1f,
101 | imageProxy.width.toFloat(),
102 | imageProxy.height.toFloat()
103 | )
104 | }
105 | }
106 |
107 | val rotatedBitmap = Bitmap.createBitmap(
108 | bitmapBuffer, 0, 0, bitmapBuffer.width, bitmapBuffer.height,
109 | matrix, true
110 | )
111 |
112 | detector.detect(rotatedBitmap)
113 | }
114 |
115 | cameraProvider.unbindAll()
116 |
117 | try {
118 | camera = cameraProvider.bindToLifecycle(
119 | this,
120 | cameraSelector,
121 | preview,
122 | imageAnalyzer
123 | )
124 |
125 | preview?.setSurfaceProvider(binding.viewFinder.surfaceProvider)
126 | } catch(exc: Exception) {
127 | Log.e(TAG, "Use case binding failed", exc)
128 | }
129 | }
130 |
131 | private fun allPermissionsGranted() = REQUIRED_PERMISSIONS.all {
132 | ContextCompat.checkSelfPermission(baseContext, it) == PackageManager.PERMISSION_GRANTED
133 | }
134 |
135 | private val requestPermissionLauncher = registerForActivityResult(
136 | ActivityResultContracts.RequestMultiplePermissions()) {
137 | if (it[Manifest.permission.CAMERA] == true) { startCamera() }
138 | }
139 |
140 | override fun onDestroy() {
141 | super.onDestroy()
142 | detector.clear()
143 | cameraExecutor.shutdown()
144 | }
145 |
146 | override fun onResume() {
147 | super.onResume()
148 | if (allPermissionsGranted()){
149 | startCamera()
150 | } else {
151 | requestPermissionLauncher.launch(REQUIRED_PERMISSIONS)
152 | }
153 | }
154 |
155 | companion object {
156 | private const val TAG = "Camera"
157 | private const val REQUEST_CODE_PERMISSIONS = 10
158 | private val REQUIRED_PERMISSIONS = mutableListOf (
159 | Manifest.permission.CAMERA
160 | ).toTypedArray()
161 | }
162 |
163 | override fun onEmptyDetect() {
164 | binding.overlay.invalidate()
165 | }
166 |
167 | override fun onDetect(boundingBoxes: List, inferenceTime: Long) {
168 | runOnUiThread {
169 | binding.inferenceTime.text = "${inferenceTime}ms"
170 | binding.overlay.apply {
171 | setResults(boundingBoxes)
172 | invalidate()
173 | }
174 | }
175 | }
176 | }
177 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/java/com/surendramaran/yolov8tflite/OverlayView.kt:
--------------------------------------------------------------------------------
1 | package com.surendramaran.yolov8tflite
2 |
3 | import android.content.Context
4 | import android.graphics.Canvas
5 | import android.graphics.Color
6 | import android.graphics.Paint
7 | import android.graphics.Rect
8 | import android.graphics.RectF
9 | import android.util.AttributeSet
10 | import android.view.View
11 | import androidx.core.content.ContextCompat
12 | import java.util.LinkedList
13 | import kotlin.math.max
14 |
15 | class OverlayView(context: Context?, attrs: AttributeSet?) : View(context, attrs) {
16 |
17 | private var results = listOf()
18 | private var boxPaint = Paint()
19 | private var textBackgroundPaint = Paint()
20 | private var textPaint = Paint()
21 |
22 | private var bounds = Rect()
23 |
24 | init {
25 | initPaints()
26 | }
27 |
28 | fun clear() {
29 | textPaint.reset()
30 | textBackgroundPaint.reset()
31 | boxPaint.reset()
32 | invalidate()
33 | initPaints()
34 | }
35 |
36 | private fun initPaints() {
37 | textBackgroundPaint.color = Color.BLACK
38 | textBackgroundPaint.style = Paint.Style.FILL
39 | textBackgroundPaint.textSize = 50f
40 |
41 | textPaint.color = Color.WHITE
42 | textPaint.style = Paint.Style.FILL
43 | textPaint.textSize = 50f
44 |
45 | boxPaint.color = ContextCompat.getColor(context!!, R.color.bounding_box_color)
46 | boxPaint.strokeWidth = 8F
47 | boxPaint.style = Paint.Style.STROKE
48 | }
49 |
50 | override fun draw(canvas: Canvas) {
51 | super.draw(canvas)
52 |
53 | results.forEach {
54 | val left = it.x1 * width
55 | val top = it.y1 * height
56 | val right = it.x2 * width
57 | val bottom = it.y2 * height
58 |
59 | canvas.drawRect(left, top, right, bottom, boxPaint)
60 | val drawableText = it.clsName
61 |
62 | textBackgroundPaint.getTextBounds(drawableText, 0, drawableText.length, bounds)
63 | val textWidth = bounds.width()
64 | val textHeight = bounds.height()
65 | canvas.drawRect(
66 | left,
67 | top,
68 | left + textWidth + BOUNDING_RECT_TEXT_PADDING,
69 | top + textHeight + BOUNDING_RECT_TEXT_PADDING,
70 | textBackgroundPaint
71 | )
72 | canvas.drawText(drawableText, left, top + bounds.height(), textPaint)
73 |
74 | }
75 | }
76 |
77 | fun setResults(boundingBoxes: List) {
78 | results = boundingBoxes
79 | invalidate()
80 | }
81 |
82 | companion object {
83 | private const val BOUNDING_RECT_TEXT_PADDING = 8
84 | }
85 | }
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
22 |
23 |
35 |
36 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/android_app/android_app/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/android_app/android_app/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/android_app/android_app/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/android_app/android_app/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/android_app/android_app/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/android_app/android_app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/android_app/android_app/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/android_app/android_app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/android_app/android_app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/android_app/android_app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FF000000
4 | #FFFFFFFF
5 | #234567
6 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | YOLOv8 TfLite
3 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/main/res/xml/data_extraction_rules.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/android_app/android_app/app/src/test/java/com/surendramaran/yolov8tflite/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.surendramaran.yolov8tflite
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/android_app/android_app/build.gradle.kts:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | plugins {
3 | id("com.android.application") version "8.3.1" apply false
4 | id("org.jetbrains.kotlin.android") version "1.9.10" apply false
5 | }
--------------------------------------------------------------------------------
/android_app/android_app/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Kotlin code style for this project: "official" or "obsolete":
19 | kotlin.code.style=official
20 | # Enables namespacing of each library's R class so that its R class includes only the
21 | # resources declared in the library itself and none from the library's dependencies,
22 | # thereby reducing the size of the R class for that library
23 | android.nonTransitiveRClass=true
--------------------------------------------------------------------------------
/android_app/android_app/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/android_app/android_app/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android_app/android_app/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Dec 21 02:49:56 IST 2023
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/android_app/android_app/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/android_app/android_app/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/android_app/android_app/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | gradlePluginPortal()
6 | }
7 | }
8 | dependencyResolutionManagement {
9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10 | repositories {
11 | google()
12 | mavenCentral()
13 | }
14 | }
15 |
16 | rootProject.name = "YOLOv8 TfLite"
17 | include(":app")
18 |
--------------------------------------------------------------------------------
/test_images/b.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AarohiSingla/Object-Detection-Android-App/969ba21cd6c50dbce911b3145225e0919e554f6d/test_images/b.jpg
--------------------------------------------------------------------------------
/train_export_yolov8_model.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 1,
6 | "id": "5e27dd71-2b43-48bf-9f05-eba66c1afe50",
7 | "metadata": {},
8 | "outputs": [
9 | {
10 | "name": "stdout",
11 | "output_type": "stream",
12 | "text": [
13 | "New https://pypi.org/project/ultralytics/8.1.43 available 😃 Update with 'pip install -U ultralytics'\n",
14 | "Ultralytics YOLOv8.1.24 🚀 Python-3.11.6 torch-2.1.2+cu118 CUDA:0 (NVIDIA GeForce RTX 3090, 24576MiB)\n",
15 | "\u001b[34m\u001b[1mengine\\trainer: \u001b[0mtask=detect, mode=train, model=yolov8n.pt, data=data.yaml, epochs=100, time=None, patience=100, batch=16, imgsz=640, save=True, save_period=-1, cache=False, device=0, workers=8, project=None, name=train3, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=None, workspace=4, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, label_smoothing=0.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs\\detect\\train3\n",
16 | "Overriding model.yaml nc=80 with nc=4\n",
17 | "\n",
18 | " from n params module arguments \n",
19 | " 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] \n",
20 | " 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] \n",
21 | " 2 -1 1 7360 ultralytics.nn.modules.block.C2f [32, 32, 1, True] \n",
22 | " 3 -1 1 18560 ultralytics.nn.modules.conv.Conv [32, 64, 3, 2] \n",
23 | " 4 -1 2 49664 ultralytics.nn.modules.block.C2f [64, 64, 2, True] \n",
24 | " 5 -1 1 73984 ultralytics.nn.modules.conv.Conv [64, 128, 3, 2] \n",
25 | " 6 -1 2 197632 ultralytics.nn.modules.block.C2f [128, 128, 2, True] \n",
26 | " 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] \n",
27 | " 8 -1 1 460288 ultralytics.nn.modules.block.C2f [256, 256, 1, True] \n",
28 | " 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] \n",
29 | " 10 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n",
30 | " 11 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n",
31 | " 12 -1 1 148224 ultralytics.nn.modules.block.C2f [384, 128, 1] \n",
32 | " 13 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n",
33 | " 14 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n",
34 | " 15 -1 1 37248 ultralytics.nn.modules.block.C2f [192, 64, 1] \n",
35 | " 16 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n",
36 | " 17 [-1, 12] 1 0 ultralytics.nn.modules.conv.Concat [1] \n",
37 | " 18 -1 1 123648 ultralytics.nn.modules.block.C2f [192, 128, 1] \n",
38 | " 19 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n",
39 | " 20 [-1, 9] 1 0 ultralytics.nn.modules.conv.Concat [1] \n",
40 | " 21 -1 1 493056 ultralytics.nn.modules.block.C2f [384, 256, 1] \n",
41 | " 22 [15, 18, 21] 1 752092 ultralytics.nn.modules.head.Detect [4, [64, 128, 256]] \n",
42 | "Model summary: 225 layers, 3011628 parameters, 3011612 gradients, 8.2 GFLOPs\n",
43 | "\n",
44 | "Transferred 319/355 items from pretrained weights\n",
45 | "\u001b[34m\u001b[1mTensorBoard: \u001b[0mStart with 'tensorboard --logdir runs\\detect\\train3', view at http://localhost:6006/\n",
46 | "Freezing layer 'model.22.dfl.conv.weight'\n",
47 | "\u001b[34m\u001b[1mAMP: \u001b[0mrunning Automatic Mixed Precision (AMP) checks with YOLOv8n...\n",
48 | "\u001b[34m\u001b[1mAMP: \u001b[0mchecks passed ✅\n"
49 | ]
50 | },
51 | {
52 | "name": "stderr",
53 | "output_type": "stream",
54 | "text": [
55 | "\u001b[34m\u001b[1mtrain: \u001b[0mScanning E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\train\\labels\u001b[0m"
56 | ]
57 | },
58 | {
59 | "name": "stdout",
60 | "output_type": "stream",
61 | "text": [
62 | "\u001b[34m\u001b[1mtrain: \u001b[0mWARNING ⚠️ E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\train\\images\\3d-cutlery-golden-silver-color-fork-knife-spoon-set-silverware-gold-utensil-catering-luxury-metal-tableware-top-view-isolated-transparent-background-realistic-illustration_107791-4343_jpg.rf.7e41d3f2bc4fb81f4ec9cbbb20c1d498.jpg: ignoring corrupt image/label: [Errno 2] No such file or directory: 'E:\\\\yolov8_env\\\\ultralytics_android_app\\\\step_1_train_test_export\\\\dataset\\\\train\\\\images\\\\3d-cutlery-golden-silver-color-fork-knife-spoon-set-silverware-gold-utensil-catering-luxury-metal-tableware-top-view-isolated-transparent-background-realistic-illustration_107791-4343_jpg.rf.7e41d3f2bc4fb81f4ec9cbbb20c1d498.jpg'\n",
63 | "\u001b[34m\u001b[1mtrain: \u001b[0mWARNING ⚠️ E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\train\\images\\8JVQKR06DKR7_jpg.rf.80d6df29158dc42d5773a1bb5470e696.jpg: ignoring corrupt image/label: non-normalized or out of bounds coordinates [ 1.0061]\n",
64 | "\u001b[34m\u001b[1mtrain: \u001b[0mWARNING ⚠️ E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\train\\images\\EOXV5BGE3ULA_jpg.rf.27be202c94a15dc2bb94258a2141774d.jpg: ignoring corrupt image/label: non-normalized or out of bounds coordinates [ 1.0032]\n",
65 | "\u001b[34m\u001b[1mtrain: \u001b[0mWARNING ⚠️ E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\train\\images\\KXB5CCJ33SKD_jpg.rf.e57a9f2cc8ceea000837a62b73292523.jpg: ignoring corrupt image/label: non-normalized or out of bounds coordinates [ 1.0111]\n",
66 | "\u001b[34m\u001b[1mtrain: \u001b[0mWARNING ⚠️ E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\train\\images\\P2NT2894PY64_jpg.rf.b48b653f4c32dd3a4ef19bd19f9b833e.jpg: ignoring corrupt image/label: non-normalized or out of bounds coordinates [ 1.0028]\n",
67 | "\u001b[34m\u001b[1mtrain: \u001b[0mWARNING ⚠️ E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\train\\images\\Q79JEVY99522_jpg.rf.668103b112b29ecaacd55572cda4b820.jpg: ignoring corrupt image/label: non-normalized or out of bounds coordinates [ 1.0195]\n",
68 | "\u001b[34m\u001b[1mtrain: \u001b[0mWARNING ⚠️ E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\train\\images\\VSIITU7KJP4I_jpg.rf.9cb58ced6bc778d6c9891dd0ca2f7936.jpg: ignoring corrupt image/label: non-normalized or out of bounds coordinates [ 1.0049 1.0118]\n",
69 | "\u001b[34m\u001b[1mtrain: \u001b[0mNew cache created: E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\train\\labels.cache\n",
70 | "WARNING ⚠️ Box and segment counts should be equal, but got len(segments) = 37, len(boxes) = 513. To resolve this only boxes will be used and all segments will be removed. To avoid this please supply either a detect or segment dataset, not a detect-segment mixed dataset.\n"
71 | ]
72 | },
73 | {
74 | "name": "stderr",
75 | "output_type": "stream",
76 | "text": [
77 | "\n",
78 | "\u001b[34m\u001b[1mval: \u001b[0mScanning E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\val\\labels... \u001b[0m"
79 | ]
80 | },
81 | {
82 | "name": "stdout",
83 | "output_type": "stream",
84 | "text": [
85 | "\u001b[34m\u001b[1mval: \u001b[0mWARNING ⚠️ E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\val\\images\\8YGAV61FP6DX_jpg.rf.58da95b585c9603f5f940e73eff64a57.jpg: ignoring corrupt image/label: non-normalized or out of bounds coordinates [ 1.0132]\n",
86 | "\u001b[34m\u001b[1mval: \u001b[0mWARNING ⚠️ E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\val\\images\\CK5FP969OKVT_jpg.rf.39129739a321267395ceb3dc451f0d26.jpg: ignoring corrupt image/label: non-normalized or out of bounds coordinates [ 1.0011]\n",
87 | "\u001b[34m\u001b[1mval: \u001b[0mNew cache created: E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\val\\labels.cache\n",
88 | "WARNING ⚠️ Box and segment counts should be equal, but got len(segments) = 20, len(boxes) = 149. To resolve this only boxes will be used and all segments will be removed. To avoid this please supply either a detect or segment dataset, not a detect-segment mixed dataset.\n"
89 | ]
90 | },
91 | {
92 | "name": "stderr",
93 | "output_type": "stream",
94 | "text": [
95 | "\n"
96 | ]
97 | },
98 | {
99 | "name": "stdout",
100 | "output_type": "stream",
101 | "text": [
102 | "Plotting labels to runs\\detect\\train3\\labels.jpg... \n",
103 | "\u001b[34m\u001b[1moptimizer:\u001b[0m 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... \n",
104 | "\u001b[34m\u001b[1moptimizer:\u001b[0m AdamW(lr=0.00125, momentum=0.9) with parameter groups 57 weight(decay=0.0), 64 weight(decay=0.0005), 63 bias(decay=0.0)\n",
105 | "\u001b[34m\u001b[1mTensorBoard: \u001b[0mmodel graph visualization added ✅\n",
106 | "Image sizes 640 train, 640 val\n",
107 | "Using 8 dataloader workers\n",
108 | "Logging results to \u001b[1mruns\\detect\\train3\u001b[0m\n",
109 | "Starting training for 100 epochs...\n",
110 | "\n",
111 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
112 | ]
113 | },
114 | {
115 | "name": "stderr",
116 | "output_type": "stream",
117 | "text": [
118 | " 1/100 2.3G 1.397 3.169 1.673 39 640: 100%|██████████| 27/\n",
119 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
120 | ]
121 | },
122 | {
123 | "name": "stdout",
124 | "output_type": "stream",
125 | "text": [
126 | " all 116 149 0.0268 0.854 0.143 0.0766\n"
127 | ]
128 | },
129 | {
130 | "name": "stderr",
131 | "output_type": "stream",
132 | "text": [
133 | "\n"
134 | ]
135 | },
136 | {
137 | "name": "stdout",
138 | "output_type": "stream",
139 | "text": [
140 | "\n",
141 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
142 | ]
143 | },
144 | {
145 | "name": "stderr",
146 | "output_type": "stream",
147 | "text": [
148 | " 2/100 2.26G 1.378 2.566 1.631 37 640: 100%|██████████| 27/\n",
149 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
150 | ]
151 | },
152 | {
153 | "name": "stdout",
154 | "output_type": "stream",
155 | "text": [
156 | " all 116 149 0.635 0.108 0.123 0.0707\n"
157 | ]
158 | },
159 | {
160 | "name": "stderr",
161 | "output_type": "stream",
162 | "text": [
163 | "\n"
164 | ]
165 | },
166 | {
167 | "name": "stdout",
168 | "output_type": "stream",
169 | "text": [
170 | "\n",
171 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
172 | ]
173 | },
174 | {
175 | "name": "stderr",
176 | "output_type": "stream",
177 | "text": [
178 | " 3/100 2.26G 1.38 2.394 1.623 28 640: 100%|██████████| 27/\n",
179 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
180 | ]
181 | },
182 | {
183 | "name": "stdout",
184 | "output_type": "stream",
185 | "text": [
186 | " all 116 149 0.473 0.333 0.204 0.0986\n"
187 | ]
188 | },
189 | {
190 | "name": "stderr",
191 | "output_type": "stream",
192 | "text": [
193 | "\n"
194 | ]
195 | },
196 | {
197 | "name": "stdout",
198 | "output_type": "stream",
199 | "text": [
200 | "\n",
201 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
202 | ]
203 | },
204 | {
205 | "name": "stderr",
206 | "output_type": "stream",
207 | "text": [
208 | " 4/100 2.26G 1.432 2.367 1.647 28 640: 100%|██████████| 27/\n",
209 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
210 | ]
211 | },
212 | {
213 | "name": "stdout",
214 | "output_type": "stream",
215 | "text": [
216 | " all 116 149 0.338 0.327 0.121 0.056\n"
217 | ]
218 | },
219 | {
220 | "name": "stderr",
221 | "output_type": "stream",
222 | "text": [
223 | "\n"
224 | ]
225 | },
226 | {
227 | "name": "stdout",
228 | "output_type": "stream",
229 | "text": [
230 | "\n",
231 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
232 | ]
233 | },
234 | {
235 | "name": "stderr",
236 | "output_type": "stream",
237 | "text": [
238 | " 5/100 2.26G 1.443 2.311 1.652 36 640: 100%|██████████| 27/\n",
239 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
240 | ]
241 | },
242 | {
243 | "name": "stdout",
244 | "output_type": "stream",
245 | "text": [
246 | " all 116 149 0.614 0.295 0.281 0.123\n"
247 | ]
248 | },
249 | {
250 | "name": "stderr",
251 | "output_type": "stream",
252 | "text": [
253 | "\n"
254 | ]
255 | },
256 | {
257 | "name": "stdout",
258 | "output_type": "stream",
259 | "text": [
260 | "\n",
261 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
262 | ]
263 | },
264 | {
265 | "name": "stderr",
266 | "output_type": "stream",
267 | "text": [
268 | " 6/100 2.26G 1.436 2.183 1.679 28 640: 100%|██████████| 27/\n",
269 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
270 | ]
271 | },
272 | {
273 | "name": "stdout",
274 | "output_type": "stream",
275 | "text": [
276 | " all 116 149 0.592 0.322 0.238 0.1\n"
277 | ]
278 | },
279 | {
280 | "name": "stderr",
281 | "output_type": "stream",
282 | "text": [
283 | "\n"
284 | ]
285 | },
286 | {
287 | "name": "stdout",
288 | "output_type": "stream",
289 | "text": [
290 | "\n",
291 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
292 | ]
293 | },
294 | {
295 | "name": "stderr",
296 | "output_type": "stream",
297 | "text": [
298 | " 7/100 2.26G 1.453 2.135 1.642 32 640: 100%|██████████| 27/\n",
299 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
300 | ]
301 | },
302 | {
303 | "name": "stdout",
304 | "output_type": "stream",
305 | "text": [
306 | " all 116 149 0.672 0.262 0.255 0.108\n"
307 | ]
308 | },
309 | {
310 | "name": "stderr",
311 | "output_type": "stream",
312 | "text": [
313 | "\n"
314 | ]
315 | },
316 | {
317 | "name": "stdout",
318 | "output_type": "stream",
319 | "text": [
320 | "\n",
321 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
322 | ]
323 | },
324 | {
325 | "name": "stderr",
326 | "output_type": "stream",
327 | "text": [
328 | " 8/100 2.26G 1.396 2.109 1.616 33 640: 100%|██████████| 27/\n",
329 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
330 | ]
331 | },
332 | {
333 | "name": "stdout",
334 | "output_type": "stream",
335 | "text": [
336 | " all 116 149 0.633 0.272 0.257 0.11\n"
337 | ]
338 | },
339 | {
340 | "name": "stderr",
341 | "output_type": "stream",
342 | "text": [
343 | "\n"
344 | ]
345 | },
346 | {
347 | "name": "stdout",
348 | "output_type": "stream",
349 | "text": [
350 | "\n",
351 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
352 | ]
353 | },
354 | {
355 | "name": "stderr",
356 | "output_type": "stream",
357 | "text": [
358 | " 9/100 2.26G 1.347 1.982 1.625 40 640: 100%|██████████| 27/\n",
359 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
360 | ]
361 | },
362 | {
363 | "name": "stdout",
364 | "output_type": "stream",
365 | "text": [
366 | " all 116 149 0.621 0.395 0.352 0.185\n"
367 | ]
368 | },
369 | {
370 | "name": "stderr",
371 | "output_type": "stream",
372 | "text": [
373 | "\n"
374 | ]
375 | },
376 | {
377 | "name": "stdout",
378 | "output_type": "stream",
379 | "text": [
380 | "\n",
381 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
382 | ]
383 | },
384 | {
385 | "name": "stderr",
386 | "output_type": "stream",
387 | "text": [
388 | " 10/100 2.26G 1.352 1.93 1.566 38 640: 100%|██████████| 27/\n",
389 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
390 | ]
391 | },
392 | {
393 | "name": "stdout",
394 | "output_type": "stream",
395 | "text": [
396 | " all 116 149 0.582 0.344 0.356 0.147\n"
397 | ]
398 | },
399 | {
400 | "name": "stderr",
401 | "output_type": "stream",
402 | "text": [
403 | "\n"
404 | ]
405 | },
406 | {
407 | "name": "stdout",
408 | "output_type": "stream",
409 | "text": [
410 | "\n",
411 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
412 | ]
413 | },
414 | {
415 | "name": "stderr",
416 | "output_type": "stream",
417 | "text": [
418 | " 11/100 2.26G 1.343 1.982 1.604 33 640: 100%|██████████| 27/\n",
419 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
420 | ]
421 | },
422 | {
423 | "name": "stdout",
424 | "output_type": "stream",
425 | "text": [
426 | " all 116 149 0.663 0.359 0.396 0.225\n"
427 | ]
428 | },
429 | {
430 | "name": "stderr",
431 | "output_type": "stream",
432 | "text": [
433 | "\n"
434 | ]
435 | },
436 | {
437 | "name": "stdout",
438 | "output_type": "stream",
439 | "text": [
440 | "\n",
441 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
442 | ]
443 | },
444 | {
445 | "name": "stderr",
446 | "output_type": "stream",
447 | "text": [
448 | " 12/100 2.26G 1.28 1.809 1.524 40 640: 100%|██████████| 27/\n",
449 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
450 | ]
451 | },
452 | {
453 | "name": "stdout",
454 | "output_type": "stream",
455 | "text": [
456 | " all 116 149 0.627 0.421 0.36 0.217\n"
457 | ]
458 | },
459 | {
460 | "name": "stderr",
461 | "output_type": "stream",
462 | "text": [
463 | "\n"
464 | ]
465 | },
466 | {
467 | "name": "stdout",
468 | "output_type": "stream",
469 | "text": [
470 | "\n",
471 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
472 | ]
473 | },
474 | {
475 | "name": "stderr",
476 | "output_type": "stream",
477 | "text": [
478 | " 13/100 2.26G 1.275 1.755 1.514 29 640: 100%|██████████| 27/\n",
479 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
480 | ]
481 | },
482 | {
483 | "name": "stdout",
484 | "output_type": "stream",
485 | "text": [
486 | " all 116 149 0.69 0.33 0.394 0.238\n"
487 | ]
488 | },
489 | {
490 | "name": "stderr",
491 | "output_type": "stream",
492 | "text": [
493 | "\n"
494 | ]
495 | },
496 | {
497 | "name": "stdout",
498 | "output_type": "stream",
499 | "text": [
500 | "\n",
501 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
502 | ]
503 | },
504 | {
505 | "name": "stderr",
506 | "output_type": "stream",
507 | "text": [
508 | " 14/100 2.26G 1.288 1.719 1.525 31 640: 100%|██████████| 27/\n",
509 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
510 | ]
511 | },
512 | {
513 | "name": "stdout",
514 | "output_type": "stream",
515 | "text": [
516 | " all 116 149 0.686 0.458 0.468 0.29\n"
517 | ]
518 | },
519 | {
520 | "name": "stderr",
521 | "output_type": "stream",
522 | "text": [
523 | "\n"
524 | ]
525 | },
526 | {
527 | "name": "stdout",
528 | "output_type": "stream",
529 | "text": [
530 | "\n",
531 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
532 | ]
533 | },
534 | {
535 | "name": "stderr",
536 | "output_type": "stream",
537 | "text": [
538 | " 15/100 2.26G 1.312 1.831 1.584 33 640: 100%|██████████| 27/\n",
539 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
540 | ]
541 | },
542 | {
543 | "name": "stdout",
544 | "output_type": "stream",
545 | "text": [
546 | " all 116 149 0.737 0.387 0.407 0.234\n"
547 | ]
548 | },
549 | {
550 | "name": "stderr",
551 | "output_type": "stream",
552 | "text": [
553 | "\n"
554 | ]
555 | },
556 | {
557 | "name": "stdout",
558 | "output_type": "stream",
559 | "text": [
560 | "\n",
561 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
562 | ]
563 | },
564 | {
565 | "name": "stderr",
566 | "output_type": "stream",
567 | "text": [
568 | " 16/100 2.26G 1.263 1.653 1.512 37 640: 100%|██████████| 27/\n",
569 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
570 | ]
571 | },
572 | {
573 | "name": "stdout",
574 | "output_type": "stream",
575 | "text": [
576 | " all 116 149 0.749 0.484 0.506 0.345\n"
577 | ]
578 | },
579 | {
580 | "name": "stderr",
581 | "output_type": "stream",
582 | "text": [
583 | "\n"
584 | ]
585 | },
586 | {
587 | "name": "stdout",
588 | "output_type": "stream",
589 | "text": [
590 | "\n",
591 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
592 | ]
593 | },
594 | {
595 | "name": "stderr",
596 | "output_type": "stream",
597 | "text": [
598 | " 17/100 2.26G 1.249 1.669 1.507 42 640: 100%|██████████| 27/\n",
599 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
600 | ]
601 | },
602 | {
603 | "name": "stdout",
604 | "output_type": "stream",
605 | "text": [
606 | " all 116 149 0.747 0.391 0.442 0.264\n"
607 | ]
608 | },
609 | {
610 | "name": "stderr",
611 | "output_type": "stream",
612 | "text": [
613 | "\n"
614 | ]
615 | },
616 | {
617 | "name": "stdout",
618 | "output_type": "stream",
619 | "text": [
620 | "\n",
621 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
622 | ]
623 | },
624 | {
625 | "name": "stderr",
626 | "output_type": "stream",
627 | "text": [
628 | " 18/100 2.26G 1.231 1.573 1.488 32 640: 100%|██████████| 27/\n",
629 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
630 | ]
631 | },
632 | {
633 | "name": "stdout",
634 | "output_type": "stream",
635 | "text": [
636 | " all 116 149 0.779 0.419 0.475 0.313\n"
637 | ]
638 | },
639 | {
640 | "name": "stderr",
641 | "output_type": "stream",
642 | "text": [
643 | "\n"
644 | ]
645 | },
646 | {
647 | "name": "stdout",
648 | "output_type": "stream",
649 | "text": [
650 | "\n",
651 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
652 | ]
653 | },
654 | {
655 | "name": "stderr",
656 | "output_type": "stream",
657 | "text": [
658 | " 19/100 2.26G 1.213 1.536 1.484 38 640: 100%|██████████| 27/\n",
659 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
660 | ]
661 | },
662 | {
663 | "name": "stdout",
664 | "output_type": "stream",
665 | "text": [
666 | " all 116 149 0.716 0.507 0.563 0.341\n"
667 | ]
668 | },
669 | {
670 | "name": "stderr",
671 | "output_type": "stream",
672 | "text": [
673 | "\n"
674 | ]
675 | },
676 | {
677 | "name": "stdout",
678 | "output_type": "stream",
679 | "text": [
680 | "\n",
681 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
682 | ]
683 | },
684 | {
685 | "name": "stderr",
686 | "output_type": "stream",
687 | "text": [
688 | " 20/100 2.26G 1.194 1.526 1.442 26 640: 100%|██████████| 27/\n",
689 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
690 | ]
691 | },
692 | {
693 | "name": "stdout",
694 | "output_type": "stream",
695 | "text": [
696 | " all 116 149 0.694 0.459 0.495 0.319\n"
697 | ]
698 | },
699 | {
700 | "name": "stderr",
701 | "output_type": "stream",
702 | "text": [
703 | "\n"
704 | ]
705 | },
706 | {
707 | "name": "stdout",
708 | "output_type": "stream",
709 | "text": [
710 | "\n",
711 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
712 | ]
713 | },
714 | {
715 | "name": "stderr",
716 | "output_type": "stream",
717 | "text": [
718 | " 21/100 2.26G 1.197 1.545 1.493 49 640: 100%|██████████| 27/\n",
719 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
720 | ]
721 | },
722 | {
723 | "name": "stdout",
724 | "output_type": "stream",
725 | "text": [
726 | " all 116 149 0.628 0.435 0.416 0.282\n"
727 | ]
728 | },
729 | {
730 | "name": "stderr",
731 | "output_type": "stream",
732 | "text": [
733 | "\n"
734 | ]
735 | },
736 | {
737 | "name": "stdout",
738 | "output_type": "stream",
739 | "text": [
740 | "\n",
741 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
742 | ]
743 | },
744 | {
745 | "name": "stderr",
746 | "output_type": "stream",
747 | "text": [
748 | " 22/100 2.26G 1.196 1.514 1.465 26 640: 100%|██████████| 27/\n",
749 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
750 | ]
751 | },
752 | {
753 | "name": "stdout",
754 | "output_type": "stream",
755 | "text": [
756 | " all 116 149 0.716 0.515 0.528 0.344\n"
757 | ]
758 | },
759 | {
760 | "name": "stderr",
761 | "output_type": "stream",
762 | "text": [
763 | "\n"
764 | ]
765 | },
766 | {
767 | "name": "stdout",
768 | "output_type": "stream",
769 | "text": [
770 | "\n",
771 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
772 | ]
773 | },
774 | {
775 | "name": "stderr",
776 | "output_type": "stream",
777 | "text": [
778 | " 23/100 2.26G 1.222 1.483 1.468 45 640: 100%|██████████| 27/\n",
779 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
780 | ]
781 | },
782 | {
783 | "name": "stdout",
784 | "output_type": "stream",
785 | "text": [
786 | " all 116 149 0.796 0.475 0.516 0.361\n"
787 | ]
788 | },
789 | {
790 | "name": "stderr",
791 | "output_type": "stream",
792 | "text": [
793 | "\n"
794 | ]
795 | },
796 | {
797 | "name": "stdout",
798 | "output_type": "stream",
799 | "text": [
800 | "\n",
801 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
802 | ]
803 | },
804 | {
805 | "name": "stderr",
806 | "output_type": "stream",
807 | "text": [
808 | " 24/100 2.26G 1.174 1.457 1.449 31 640: 100%|██████████| 27/\n",
809 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
810 | ]
811 | },
812 | {
813 | "name": "stdout",
814 | "output_type": "stream",
815 | "text": [
816 | " all 116 149 0.818 0.424 0.496 0.333\n"
817 | ]
818 | },
819 | {
820 | "name": "stderr",
821 | "output_type": "stream",
822 | "text": [
823 | "\n"
824 | ]
825 | },
826 | {
827 | "name": "stdout",
828 | "output_type": "stream",
829 | "text": [
830 | "\n",
831 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
832 | ]
833 | },
834 | {
835 | "name": "stderr",
836 | "output_type": "stream",
837 | "text": [
838 | " 25/100 2.26G 1.199 1.436 1.455 29 640: 100%|██████████| 27/\n",
839 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
840 | ]
841 | },
842 | {
843 | "name": "stdout",
844 | "output_type": "stream",
845 | "text": [
846 | " all 116 149 0.842 0.44 0.517 0.355\n"
847 | ]
848 | },
849 | {
850 | "name": "stderr",
851 | "output_type": "stream",
852 | "text": [
853 | "\n"
854 | ]
855 | },
856 | {
857 | "name": "stdout",
858 | "output_type": "stream",
859 | "text": [
860 | "\n",
861 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
862 | ]
863 | },
864 | {
865 | "name": "stderr",
866 | "output_type": "stream",
867 | "text": [
868 | " 26/100 2.26G 1.156 1.43 1.408 30 640: 100%|██████████| 27/\n",
869 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
870 | ]
871 | },
872 | {
873 | "name": "stdout",
874 | "output_type": "stream",
875 | "text": [
876 | " all 116 149 0.795 0.484 0.497 0.348\n"
877 | ]
878 | },
879 | {
880 | "name": "stderr",
881 | "output_type": "stream",
882 | "text": [
883 | "\n"
884 | ]
885 | },
886 | {
887 | "name": "stdout",
888 | "output_type": "stream",
889 | "text": [
890 | "\n",
891 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
892 | ]
893 | },
894 | {
895 | "name": "stderr",
896 | "output_type": "stream",
897 | "text": [
898 | " 27/100 2.26G 1.159 1.395 1.422 28 640: 100%|██████████| 27/\n",
899 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
900 | ]
901 | },
902 | {
903 | "name": "stdout",
904 | "output_type": "stream",
905 | "text": [
906 | " all 116 149 0.723 0.489 0.453 0.309\n"
907 | ]
908 | },
909 | {
910 | "name": "stderr",
911 | "output_type": "stream",
912 | "text": [
913 | "\n"
914 | ]
915 | },
916 | {
917 | "name": "stdout",
918 | "output_type": "stream",
919 | "text": [
920 | "\n",
921 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
922 | ]
923 | },
924 | {
925 | "name": "stderr",
926 | "output_type": "stream",
927 | "text": [
928 | " 28/100 2.26G 1.152 1.399 1.413 41 640: 100%|██████████| 27/\n",
929 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
930 | ]
931 | },
932 | {
933 | "name": "stdout",
934 | "output_type": "stream",
935 | "text": [
936 | " all 116 149 0.838 0.426 0.498 0.343\n"
937 | ]
938 | },
939 | {
940 | "name": "stderr",
941 | "output_type": "stream",
942 | "text": [
943 | "\n"
944 | ]
945 | },
946 | {
947 | "name": "stdout",
948 | "output_type": "stream",
949 | "text": [
950 | "\n",
951 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
952 | ]
953 | },
954 | {
955 | "name": "stderr",
956 | "output_type": "stream",
957 | "text": [
958 | " 29/100 2.26G 1.117 1.371 1.407 34 640: 100%|██████████| 27/\n",
959 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
960 | ]
961 | },
962 | {
963 | "name": "stdout",
964 | "output_type": "stream",
965 | "text": [
966 | " all 116 149 0.836 0.459 0.518 0.375\n"
967 | ]
968 | },
969 | {
970 | "name": "stderr",
971 | "output_type": "stream",
972 | "text": [
973 | "\n"
974 | ]
975 | },
976 | {
977 | "name": "stdout",
978 | "output_type": "stream",
979 | "text": [
980 | "\n",
981 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
982 | ]
983 | },
984 | {
985 | "name": "stderr",
986 | "output_type": "stream",
987 | "text": [
988 | " 30/100 2.26G 1.115 1.423 1.41 28 640: 100%|██████████| 27/\n",
989 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
990 | ]
991 | },
992 | {
993 | "name": "stdout",
994 | "output_type": "stream",
995 | "text": [
996 | " all 116 149 0.768 0.467 0.461 0.325\n"
997 | ]
998 | },
999 | {
1000 | "name": "stderr",
1001 | "output_type": "stream",
1002 | "text": [
1003 | "\n"
1004 | ]
1005 | },
1006 | {
1007 | "name": "stdout",
1008 | "output_type": "stream",
1009 | "text": [
1010 | "\n",
1011 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1012 | ]
1013 | },
1014 | {
1015 | "name": "stderr",
1016 | "output_type": "stream",
1017 | "text": [
1018 | " 31/100 2.26G 1.083 1.33 1.381 39 640: 100%|██████████| 27/\n",
1019 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1020 | ]
1021 | },
1022 | {
1023 | "name": "stdout",
1024 | "output_type": "stream",
1025 | "text": [
1026 | " all 116 149 0.751 0.396 0.41 0.268\n"
1027 | ]
1028 | },
1029 | {
1030 | "name": "stderr",
1031 | "output_type": "stream",
1032 | "text": [
1033 | "\n"
1034 | ]
1035 | },
1036 | {
1037 | "name": "stdout",
1038 | "output_type": "stream",
1039 | "text": [
1040 | "\n",
1041 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1042 | ]
1043 | },
1044 | {
1045 | "name": "stderr",
1046 | "output_type": "stream",
1047 | "text": [
1048 | " 32/100 2.26G 1.091 1.294 1.383 33 640: 100%|██████████| 27/\n",
1049 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1050 | ]
1051 | },
1052 | {
1053 | "name": "stdout",
1054 | "output_type": "stream",
1055 | "text": [
1056 | " all 116 149 0.74 0.471 0.504 0.347\n"
1057 | ]
1058 | },
1059 | {
1060 | "name": "stderr",
1061 | "output_type": "stream",
1062 | "text": [
1063 | "\n"
1064 | ]
1065 | },
1066 | {
1067 | "name": "stdout",
1068 | "output_type": "stream",
1069 | "text": [
1070 | "\n",
1071 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1072 | ]
1073 | },
1074 | {
1075 | "name": "stderr",
1076 | "output_type": "stream",
1077 | "text": [
1078 | " 33/100 2.26G 1.093 1.292 1.384 33 640: 100%|██████████| 27/\n",
1079 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1080 | ]
1081 | },
1082 | {
1083 | "name": "stdout",
1084 | "output_type": "stream",
1085 | "text": [
1086 | " all 116 149 0.683 0.487 0.456 0.313\n"
1087 | ]
1088 | },
1089 | {
1090 | "name": "stderr",
1091 | "output_type": "stream",
1092 | "text": [
1093 | "\n"
1094 | ]
1095 | },
1096 | {
1097 | "name": "stdout",
1098 | "output_type": "stream",
1099 | "text": [
1100 | "\n",
1101 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1102 | ]
1103 | },
1104 | {
1105 | "name": "stderr",
1106 | "output_type": "stream",
1107 | "text": [
1108 | " 34/100 2.26G 1.12 1.291 1.409 32 640: 100%|██████████| 27/\n",
1109 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1110 | ]
1111 | },
1112 | {
1113 | "name": "stdout",
1114 | "output_type": "stream",
1115 | "text": [
1116 | " all 116 149 0.697 0.503 0.505 0.339\n"
1117 | ]
1118 | },
1119 | {
1120 | "name": "stderr",
1121 | "output_type": "stream",
1122 | "text": [
1123 | "\n"
1124 | ]
1125 | },
1126 | {
1127 | "name": "stdout",
1128 | "output_type": "stream",
1129 | "text": [
1130 | "\n",
1131 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1132 | ]
1133 | },
1134 | {
1135 | "name": "stderr",
1136 | "output_type": "stream",
1137 | "text": [
1138 | " 35/100 2.26G 1.105 1.317 1.405 34 640: 100%|██████████| 27/\n",
1139 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1140 | ]
1141 | },
1142 | {
1143 | "name": "stdout",
1144 | "output_type": "stream",
1145 | "text": [
1146 | " all 116 149 0.778 0.453 0.525 0.36\n"
1147 | ]
1148 | },
1149 | {
1150 | "name": "stderr",
1151 | "output_type": "stream",
1152 | "text": [
1153 | "\n"
1154 | ]
1155 | },
1156 | {
1157 | "name": "stdout",
1158 | "output_type": "stream",
1159 | "text": [
1160 | "\n",
1161 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1162 | ]
1163 | },
1164 | {
1165 | "name": "stderr",
1166 | "output_type": "stream",
1167 | "text": [
1168 | " 36/100 2.26G 1.053 1.269 1.371 34 640: 100%|██████████| 27/\n",
1169 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1170 | ]
1171 | },
1172 | {
1173 | "name": "stdout",
1174 | "output_type": "stream",
1175 | "text": [
1176 | " all 116 149 0.774 0.476 0.503 0.346\n"
1177 | ]
1178 | },
1179 | {
1180 | "name": "stderr",
1181 | "output_type": "stream",
1182 | "text": [
1183 | "\n"
1184 | ]
1185 | },
1186 | {
1187 | "name": "stdout",
1188 | "output_type": "stream",
1189 | "text": [
1190 | "\n",
1191 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1192 | ]
1193 | },
1194 | {
1195 | "name": "stderr",
1196 | "output_type": "stream",
1197 | "text": [
1198 | " 37/100 2.26G 1.047 1.245 1.348 29 640: 100%|██████████| 27/\n",
1199 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1200 | ]
1201 | },
1202 | {
1203 | "name": "stdout",
1204 | "output_type": "stream",
1205 | "text": [
1206 | " all 116 149 0.834 0.461 0.532 0.362\n"
1207 | ]
1208 | },
1209 | {
1210 | "name": "stderr",
1211 | "output_type": "stream",
1212 | "text": [
1213 | "\n"
1214 | ]
1215 | },
1216 | {
1217 | "name": "stdout",
1218 | "output_type": "stream",
1219 | "text": [
1220 | "\n",
1221 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1222 | ]
1223 | },
1224 | {
1225 | "name": "stderr",
1226 | "output_type": "stream",
1227 | "text": [
1228 | " 38/100 2.26G 1.097 1.274 1.401 40 640: 100%|██████████| 27/\n",
1229 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1230 | ]
1231 | },
1232 | {
1233 | "name": "stdout",
1234 | "output_type": "stream",
1235 | "text": [
1236 | " all 116 149 0.738 0.543 0.541 0.377\n"
1237 | ]
1238 | },
1239 | {
1240 | "name": "stderr",
1241 | "output_type": "stream",
1242 | "text": [
1243 | "\n"
1244 | ]
1245 | },
1246 | {
1247 | "name": "stdout",
1248 | "output_type": "stream",
1249 | "text": [
1250 | "\n",
1251 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1252 | ]
1253 | },
1254 | {
1255 | "name": "stderr",
1256 | "output_type": "stream",
1257 | "text": [
1258 | " 39/100 2.26G 1.069 1.264 1.376 31 640: 100%|██████████| 27/\n",
1259 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1260 | ]
1261 | },
1262 | {
1263 | "name": "stdout",
1264 | "output_type": "stream",
1265 | "text": [
1266 | " all 116 149 0.808 0.483 0.55 0.367\n"
1267 | ]
1268 | },
1269 | {
1270 | "name": "stderr",
1271 | "output_type": "stream",
1272 | "text": [
1273 | "\n"
1274 | ]
1275 | },
1276 | {
1277 | "name": "stdout",
1278 | "output_type": "stream",
1279 | "text": [
1280 | "\n",
1281 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1282 | ]
1283 | },
1284 | {
1285 | "name": "stderr",
1286 | "output_type": "stream",
1287 | "text": [
1288 | " 40/100 2.26G 1.08 1.254 1.387 35 640: 100%|██████████| 27/\n",
1289 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1290 | ]
1291 | },
1292 | {
1293 | "name": "stdout",
1294 | "output_type": "stream",
1295 | "text": [
1296 | " all 116 149 0.779 0.51 0.553 0.394\n"
1297 | ]
1298 | },
1299 | {
1300 | "name": "stderr",
1301 | "output_type": "stream",
1302 | "text": [
1303 | "\n"
1304 | ]
1305 | },
1306 | {
1307 | "name": "stdout",
1308 | "output_type": "stream",
1309 | "text": [
1310 | "\n",
1311 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1312 | ]
1313 | },
1314 | {
1315 | "name": "stderr",
1316 | "output_type": "stream",
1317 | "text": [
1318 | " 41/100 2.26G 1.083 1.264 1.382 26 640: 100%|██████████| 27/\n",
1319 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1320 | ]
1321 | },
1322 | {
1323 | "name": "stdout",
1324 | "output_type": "stream",
1325 | "text": [
1326 | " all 116 149 0.75 0.562 0.574 0.401\n"
1327 | ]
1328 | },
1329 | {
1330 | "name": "stderr",
1331 | "output_type": "stream",
1332 | "text": [
1333 | "\n"
1334 | ]
1335 | },
1336 | {
1337 | "name": "stdout",
1338 | "output_type": "stream",
1339 | "text": [
1340 | "\n",
1341 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1342 | ]
1343 | },
1344 | {
1345 | "name": "stderr",
1346 | "output_type": "stream",
1347 | "text": [
1348 | " 42/100 2.26G 1.05 1.238 1.377 36 640: 100%|██████████| 27/\n",
1349 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1350 | ]
1351 | },
1352 | {
1353 | "name": "stdout",
1354 | "output_type": "stream",
1355 | "text": [
1356 | " all 116 149 0.762 0.518 0.514 0.374\n"
1357 | ]
1358 | },
1359 | {
1360 | "name": "stderr",
1361 | "output_type": "stream",
1362 | "text": [
1363 | "\n"
1364 | ]
1365 | },
1366 | {
1367 | "name": "stdout",
1368 | "output_type": "stream",
1369 | "text": [
1370 | "\n",
1371 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1372 | ]
1373 | },
1374 | {
1375 | "name": "stderr",
1376 | "output_type": "stream",
1377 | "text": [
1378 | " 43/100 2.26G 1.046 1.189 1.349 36 640: 100%|██████████| 27/\n",
1379 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1380 | ]
1381 | },
1382 | {
1383 | "name": "stdout",
1384 | "output_type": "stream",
1385 | "text": [
1386 | " all 116 149 0.851 0.468 0.509 0.358\n"
1387 | ]
1388 | },
1389 | {
1390 | "name": "stderr",
1391 | "output_type": "stream",
1392 | "text": [
1393 | "\n"
1394 | ]
1395 | },
1396 | {
1397 | "name": "stdout",
1398 | "output_type": "stream",
1399 | "text": [
1400 | "\n",
1401 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1402 | ]
1403 | },
1404 | {
1405 | "name": "stderr",
1406 | "output_type": "stream",
1407 | "text": [
1408 | " 44/100 2.26G 1.016 1.163 1.333 35 640: 100%|██████████| 27/\n",
1409 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1410 | ]
1411 | },
1412 | {
1413 | "name": "stdout",
1414 | "output_type": "stream",
1415 | "text": [
1416 | " all 116 149 0.795 0.488 0.533 0.374\n"
1417 | ]
1418 | },
1419 | {
1420 | "name": "stderr",
1421 | "output_type": "stream",
1422 | "text": [
1423 | "\n"
1424 | ]
1425 | },
1426 | {
1427 | "name": "stdout",
1428 | "output_type": "stream",
1429 | "text": [
1430 | "\n",
1431 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1432 | ]
1433 | },
1434 | {
1435 | "name": "stderr",
1436 | "output_type": "stream",
1437 | "text": [
1438 | " 45/100 2.26G 1.039 1.189 1.361 30 640: 100%|██████████| 27/\n",
1439 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1440 | ]
1441 | },
1442 | {
1443 | "name": "stdout",
1444 | "output_type": "stream",
1445 | "text": [
1446 | " all 116 149 0.81 0.522 0.551 0.399\n"
1447 | ]
1448 | },
1449 | {
1450 | "name": "stderr",
1451 | "output_type": "stream",
1452 | "text": [
1453 | "\n"
1454 | ]
1455 | },
1456 | {
1457 | "name": "stdout",
1458 | "output_type": "stream",
1459 | "text": [
1460 | "\n",
1461 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1462 | ]
1463 | },
1464 | {
1465 | "name": "stderr",
1466 | "output_type": "stream",
1467 | "text": [
1468 | " 46/100 2.26G 1.004 1.156 1.334 33 640: 100%|██████████| 27/\n",
1469 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1470 | ]
1471 | },
1472 | {
1473 | "name": "stdout",
1474 | "output_type": "stream",
1475 | "text": [
1476 | " all 116 149 0.791 0.535 0.547 0.399\n"
1477 | ]
1478 | },
1479 | {
1480 | "name": "stderr",
1481 | "output_type": "stream",
1482 | "text": [
1483 | "\n"
1484 | ]
1485 | },
1486 | {
1487 | "name": "stdout",
1488 | "output_type": "stream",
1489 | "text": [
1490 | "\n",
1491 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1492 | ]
1493 | },
1494 | {
1495 | "name": "stderr",
1496 | "output_type": "stream",
1497 | "text": [
1498 | " 47/100 2.26G 1.011 1.186 1.323 47 640: 100%|██████████| 27/\n",
1499 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1500 | ]
1501 | },
1502 | {
1503 | "name": "stdout",
1504 | "output_type": "stream",
1505 | "text": [
1506 | " all 116 149 0.84 0.454 0.541 0.371\n"
1507 | ]
1508 | },
1509 | {
1510 | "name": "stderr",
1511 | "output_type": "stream",
1512 | "text": [
1513 | "\n"
1514 | ]
1515 | },
1516 | {
1517 | "name": "stdout",
1518 | "output_type": "stream",
1519 | "text": [
1520 | "\n",
1521 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1522 | ]
1523 | },
1524 | {
1525 | "name": "stderr",
1526 | "output_type": "stream",
1527 | "text": [
1528 | " 48/100 2.26G 1.041 1.154 1.333 32 640: 100%|██████████| 27/\n",
1529 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1530 | ]
1531 | },
1532 | {
1533 | "name": "stdout",
1534 | "output_type": "stream",
1535 | "text": [
1536 | " all 116 149 0.836 0.5 0.542 0.408\n"
1537 | ]
1538 | },
1539 | {
1540 | "name": "stderr",
1541 | "output_type": "stream",
1542 | "text": [
1543 | "\n"
1544 | ]
1545 | },
1546 | {
1547 | "name": "stdout",
1548 | "output_type": "stream",
1549 | "text": [
1550 | "\n",
1551 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1552 | ]
1553 | },
1554 | {
1555 | "name": "stderr",
1556 | "output_type": "stream",
1557 | "text": [
1558 | " 49/100 2.26G 1.022 1.126 1.321 37 640: 100%|██████████| 27/\n",
1559 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1560 | ]
1561 | },
1562 | {
1563 | "name": "stdout",
1564 | "output_type": "stream",
1565 | "text": [
1566 | " all 116 149 0.839 0.517 0.536 0.389\n"
1567 | ]
1568 | },
1569 | {
1570 | "name": "stderr",
1571 | "output_type": "stream",
1572 | "text": [
1573 | "\n"
1574 | ]
1575 | },
1576 | {
1577 | "name": "stdout",
1578 | "output_type": "stream",
1579 | "text": [
1580 | "\n",
1581 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1582 | ]
1583 | },
1584 | {
1585 | "name": "stderr",
1586 | "output_type": "stream",
1587 | "text": [
1588 | " 50/100 2.26G 0.9791 1.041 1.321 37 640: 100%|██████████| 27/\n",
1589 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1590 | ]
1591 | },
1592 | {
1593 | "name": "stdout",
1594 | "output_type": "stream",
1595 | "text": [
1596 | " all 116 149 0.754 0.573 0.59 0.43\n"
1597 | ]
1598 | },
1599 | {
1600 | "name": "stderr",
1601 | "output_type": "stream",
1602 | "text": [
1603 | "\n"
1604 | ]
1605 | },
1606 | {
1607 | "name": "stdout",
1608 | "output_type": "stream",
1609 | "text": [
1610 | "\n",
1611 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1612 | ]
1613 | },
1614 | {
1615 | "name": "stderr",
1616 | "output_type": "stream",
1617 | "text": [
1618 | " 51/100 2.26G 0.9898 1.118 1.316 29 640: 100%|██████████| 27/\n",
1619 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1620 | ]
1621 | },
1622 | {
1623 | "name": "stdout",
1624 | "output_type": "stream",
1625 | "text": [
1626 | " all 116 149 0.78 0.581 0.581 0.451\n"
1627 | ]
1628 | },
1629 | {
1630 | "name": "stderr",
1631 | "output_type": "stream",
1632 | "text": [
1633 | "\n"
1634 | ]
1635 | },
1636 | {
1637 | "name": "stdout",
1638 | "output_type": "stream",
1639 | "text": [
1640 | "\n",
1641 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1642 | ]
1643 | },
1644 | {
1645 | "name": "stderr",
1646 | "output_type": "stream",
1647 | "text": [
1648 | " 52/100 2.26G 0.9551 1.068 1.295 37 640: 100%|██████████| 27/\n",
1649 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1650 | ]
1651 | },
1652 | {
1653 | "name": "stdout",
1654 | "output_type": "stream",
1655 | "text": [
1656 | " all 116 149 0.791 0.528 0.485 0.36\n"
1657 | ]
1658 | },
1659 | {
1660 | "name": "stderr",
1661 | "output_type": "stream",
1662 | "text": [
1663 | "\n"
1664 | ]
1665 | },
1666 | {
1667 | "name": "stdout",
1668 | "output_type": "stream",
1669 | "text": [
1670 | "\n",
1671 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1672 | ]
1673 | },
1674 | {
1675 | "name": "stderr",
1676 | "output_type": "stream",
1677 | "text": [
1678 | " 53/100 2.26G 0.9839 1.103 1.313 39 640: 100%|██████████| 27/\n",
1679 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1680 | ]
1681 | },
1682 | {
1683 | "name": "stdout",
1684 | "output_type": "stream",
1685 | "text": [
1686 | " all 116 149 0.835 0.554 0.565 0.418\n"
1687 | ]
1688 | },
1689 | {
1690 | "name": "stderr",
1691 | "output_type": "stream",
1692 | "text": [
1693 | "\n"
1694 | ]
1695 | },
1696 | {
1697 | "name": "stdout",
1698 | "output_type": "stream",
1699 | "text": [
1700 | "\n",
1701 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1702 | ]
1703 | },
1704 | {
1705 | "name": "stderr",
1706 | "output_type": "stream",
1707 | "text": [
1708 | " 54/100 2.26G 0.9726 1.069 1.317 34 640: 100%|██████████| 27/\n",
1709 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1710 | ]
1711 | },
1712 | {
1713 | "name": "stdout",
1714 | "output_type": "stream",
1715 | "text": [
1716 | " all 116 149 0.826 0.492 0.538 0.386\n"
1717 | ]
1718 | },
1719 | {
1720 | "name": "stderr",
1721 | "output_type": "stream",
1722 | "text": [
1723 | "\n"
1724 | ]
1725 | },
1726 | {
1727 | "name": "stdout",
1728 | "output_type": "stream",
1729 | "text": [
1730 | "\n",
1731 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1732 | ]
1733 | },
1734 | {
1735 | "name": "stderr",
1736 | "output_type": "stream",
1737 | "text": [
1738 | " 55/100 2.26G 0.9763 1.073 1.292 37 640: 100%|██████████| 27/\n",
1739 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1740 | ]
1741 | },
1742 | {
1743 | "name": "stdout",
1744 | "output_type": "stream",
1745 | "text": [
1746 | " all 116 149 0.795 0.497 0.531 0.38\n"
1747 | ]
1748 | },
1749 | {
1750 | "name": "stderr",
1751 | "output_type": "stream",
1752 | "text": [
1753 | "\n"
1754 | ]
1755 | },
1756 | {
1757 | "name": "stdout",
1758 | "output_type": "stream",
1759 | "text": [
1760 | "\n",
1761 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1762 | ]
1763 | },
1764 | {
1765 | "name": "stderr",
1766 | "output_type": "stream",
1767 | "text": [
1768 | " 56/100 2.26G 0.9386 1.013 1.263 31 640: 100%|██████████| 27/\n",
1769 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1770 | ]
1771 | },
1772 | {
1773 | "name": "stdout",
1774 | "output_type": "stream",
1775 | "text": [
1776 | " all 116 149 0.782 0.527 0.575 0.392\n"
1777 | ]
1778 | },
1779 | {
1780 | "name": "stderr",
1781 | "output_type": "stream",
1782 | "text": [
1783 | "\n"
1784 | ]
1785 | },
1786 | {
1787 | "name": "stdout",
1788 | "output_type": "stream",
1789 | "text": [
1790 | "\n",
1791 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1792 | ]
1793 | },
1794 | {
1795 | "name": "stderr",
1796 | "output_type": "stream",
1797 | "text": [
1798 | " 57/100 2.26G 0.9792 1.069 1.299 37 640: 100%|██████████| 27/\n",
1799 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1800 | ]
1801 | },
1802 | {
1803 | "name": "stdout",
1804 | "output_type": "stream",
1805 | "text": [
1806 | " all 116 149 0.796 0.493 0.546 0.393\n"
1807 | ]
1808 | },
1809 | {
1810 | "name": "stderr",
1811 | "output_type": "stream",
1812 | "text": [
1813 | "\n"
1814 | ]
1815 | },
1816 | {
1817 | "name": "stdout",
1818 | "output_type": "stream",
1819 | "text": [
1820 | "\n",
1821 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1822 | ]
1823 | },
1824 | {
1825 | "name": "stderr",
1826 | "output_type": "stream",
1827 | "text": [
1828 | " 58/100 2.26G 0.975 1.084 1.295 26 640: 100%|██████████| 27/\n",
1829 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1830 | ]
1831 | },
1832 | {
1833 | "name": "stdout",
1834 | "output_type": "stream",
1835 | "text": [
1836 | " all 116 149 0.798 0.517 0.577 0.415\n"
1837 | ]
1838 | },
1839 | {
1840 | "name": "stderr",
1841 | "output_type": "stream",
1842 | "text": [
1843 | "\n"
1844 | ]
1845 | },
1846 | {
1847 | "name": "stdout",
1848 | "output_type": "stream",
1849 | "text": [
1850 | "\n",
1851 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1852 | ]
1853 | },
1854 | {
1855 | "name": "stderr",
1856 | "output_type": "stream",
1857 | "text": [
1858 | " 59/100 2.26G 0.9561 1.022 1.282 35 640: 100%|██████████| 27/\n",
1859 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1860 | ]
1861 | },
1862 | {
1863 | "name": "stdout",
1864 | "output_type": "stream",
1865 | "text": [
1866 | " all 116 149 0.818 0.575 0.586 0.439\n"
1867 | ]
1868 | },
1869 | {
1870 | "name": "stderr",
1871 | "output_type": "stream",
1872 | "text": [
1873 | "\n"
1874 | ]
1875 | },
1876 | {
1877 | "name": "stdout",
1878 | "output_type": "stream",
1879 | "text": [
1880 | "\n",
1881 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1882 | ]
1883 | },
1884 | {
1885 | "name": "stderr",
1886 | "output_type": "stream",
1887 | "text": [
1888 | " 60/100 2.26G 0.9737 1.062 1.335 37 640: 100%|██████████| 27/\n",
1889 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1890 | ]
1891 | },
1892 | {
1893 | "name": "stdout",
1894 | "output_type": "stream",
1895 | "text": [
1896 | " all 116 149 0.79 0.519 0.556 0.41\n"
1897 | ]
1898 | },
1899 | {
1900 | "name": "stderr",
1901 | "output_type": "stream",
1902 | "text": [
1903 | "\n"
1904 | ]
1905 | },
1906 | {
1907 | "name": "stdout",
1908 | "output_type": "stream",
1909 | "text": [
1910 | "\n",
1911 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1912 | ]
1913 | },
1914 | {
1915 | "name": "stderr",
1916 | "output_type": "stream",
1917 | "text": [
1918 | " 61/100 2.26G 0.9078 1.007 1.265 31 640: 100%|██████████| 27/\n",
1919 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1920 | ]
1921 | },
1922 | {
1923 | "name": "stdout",
1924 | "output_type": "stream",
1925 | "text": [
1926 | " all 116 149 0.721 0.511 0.547 0.4\n"
1927 | ]
1928 | },
1929 | {
1930 | "name": "stderr",
1931 | "output_type": "stream",
1932 | "text": [
1933 | "\n"
1934 | ]
1935 | },
1936 | {
1937 | "name": "stdout",
1938 | "output_type": "stream",
1939 | "text": [
1940 | "\n",
1941 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1942 | ]
1943 | },
1944 | {
1945 | "name": "stderr",
1946 | "output_type": "stream",
1947 | "text": [
1948 | " 62/100 2.26G 0.9079 0.9912 1.264 32 640: 100%|██████████| 27/\n",
1949 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1950 | ]
1951 | },
1952 | {
1953 | "name": "stdout",
1954 | "output_type": "stream",
1955 | "text": [
1956 | " all 116 149 0.791 0.547 0.573 0.437\n"
1957 | ]
1958 | },
1959 | {
1960 | "name": "stderr",
1961 | "output_type": "stream",
1962 | "text": [
1963 | "\n"
1964 | ]
1965 | },
1966 | {
1967 | "name": "stdout",
1968 | "output_type": "stream",
1969 | "text": [
1970 | "\n",
1971 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
1972 | ]
1973 | },
1974 | {
1975 | "name": "stderr",
1976 | "output_type": "stream",
1977 | "text": [
1978 | " 63/100 2.26G 0.9294 1.031 1.266 42 640: 100%|██████████| 27/\n",
1979 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
1980 | ]
1981 | },
1982 | {
1983 | "name": "stdout",
1984 | "output_type": "stream",
1985 | "text": [
1986 | " all 116 149 0.848 0.465 0.557 0.404\n"
1987 | ]
1988 | },
1989 | {
1990 | "name": "stderr",
1991 | "output_type": "stream",
1992 | "text": [
1993 | "\n"
1994 | ]
1995 | },
1996 | {
1997 | "name": "stdout",
1998 | "output_type": "stream",
1999 | "text": [
2000 | "\n",
2001 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2002 | ]
2003 | },
2004 | {
2005 | "name": "stderr",
2006 | "output_type": "stream",
2007 | "text": [
2008 | " 64/100 2.26G 0.9225 1.007 1.254 37 640: 100%|██████████| 27/\n",
2009 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2010 | ]
2011 | },
2012 | {
2013 | "name": "stdout",
2014 | "output_type": "stream",
2015 | "text": [
2016 | " all 116 149 0.834 0.513 0.559 0.419\n"
2017 | ]
2018 | },
2019 | {
2020 | "name": "stderr",
2021 | "output_type": "stream",
2022 | "text": [
2023 | "\n"
2024 | ]
2025 | },
2026 | {
2027 | "name": "stdout",
2028 | "output_type": "stream",
2029 | "text": [
2030 | "\n",
2031 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2032 | ]
2033 | },
2034 | {
2035 | "name": "stderr",
2036 | "output_type": "stream",
2037 | "text": [
2038 | " 65/100 2.26G 0.8835 0.9682 1.245 33 640: 100%|██████████| 27/\n",
2039 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2040 | ]
2041 | },
2042 | {
2043 | "name": "stdout",
2044 | "output_type": "stream",
2045 | "text": [
2046 | " all 116 149 0.834 0.538 0.569 0.436\n"
2047 | ]
2048 | },
2049 | {
2050 | "name": "stderr",
2051 | "output_type": "stream",
2052 | "text": [
2053 | "\n"
2054 | ]
2055 | },
2056 | {
2057 | "name": "stdout",
2058 | "output_type": "stream",
2059 | "text": [
2060 | "\n",
2061 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2062 | ]
2063 | },
2064 | {
2065 | "name": "stderr",
2066 | "output_type": "stream",
2067 | "text": [
2068 | " 66/100 2.26G 0.9201 0.9879 1.27 31 640: 100%|██████████| 27/\n",
2069 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2070 | ]
2071 | },
2072 | {
2073 | "name": "stdout",
2074 | "output_type": "stream",
2075 | "text": [
2076 | " all 116 149 0.837 0.492 0.562 0.419\n"
2077 | ]
2078 | },
2079 | {
2080 | "name": "stderr",
2081 | "output_type": "stream",
2082 | "text": [
2083 | "\n"
2084 | ]
2085 | },
2086 | {
2087 | "name": "stdout",
2088 | "output_type": "stream",
2089 | "text": [
2090 | "\n",
2091 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2092 | ]
2093 | },
2094 | {
2095 | "name": "stderr",
2096 | "output_type": "stream",
2097 | "text": [
2098 | " 67/100 2.26G 0.9019 0.9727 1.239 33 640: 100%|██████████| 27/\n",
2099 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2100 | ]
2101 | },
2102 | {
2103 | "name": "stdout",
2104 | "output_type": "stream",
2105 | "text": [
2106 | " all 116 149 0.797 0.54 0.57 0.42\n"
2107 | ]
2108 | },
2109 | {
2110 | "name": "stderr",
2111 | "output_type": "stream",
2112 | "text": [
2113 | "\n"
2114 | ]
2115 | },
2116 | {
2117 | "name": "stdout",
2118 | "output_type": "stream",
2119 | "text": [
2120 | "\n",
2121 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2122 | ]
2123 | },
2124 | {
2125 | "name": "stderr",
2126 | "output_type": "stream",
2127 | "text": [
2128 | " 68/100 2.26G 0.9295 0.9931 1.279 32 640: 100%|██████████| 27/\n",
2129 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2130 | ]
2131 | },
2132 | {
2133 | "name": "stdout",
2134 | "output_type": "stream",
2135 | "text": [
2136 | " all 116 149 0.828 0.54 0.587 0.432\n"
2137 | ]
2138 | },
2139 | {
2140 | "name": "stderr",
2141 | "output_type": "stream",
2142 | "text": [
2143 | "\n"
2144 | ]
2145 | },
2146 | {
2147 | "name": "stdout",
2148 | "output_type": "stream",
2149 | "text": [
2150 | "\n",
2151 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2152 | ]
2153 | },
2154 | {
2155 | "name": "stderr",
2156 | "output_type": "stream",
2157 | "text": [
2158 | " 69/100 2.26G 0.8561 0.9368 1.23 41 640: 100%|██████████| 27/\n",
2159 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2160 | ]
2161 | },
2162 | {
2163 | "name": "stdout",
2164 | "output_type": "stream",
2165 | "text": [
2166 | " all 116 149 0.853 0.517 0.584 0.446\n"
2167 | ]
2168 | },
2169 | {
2170 | "name": "stderr",
2171 | "output_type": "stream",
2172 | "text": [
2173 | "\n"
2174 | ]
2175 | },
2176 | {
2177 | "name": "stdout",
2178 | "output_type": "stream",
2179 | "text": [
2180 | "\n",
2181 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2182 | ]
2183 | },
2184 | {
2185 | "name": "stderr",
2186 | "output_type": "stream",
2187 | "text": [
2188 | " 70/100 2.26G 0.8884 0.9492 1.241 33 640: 100%|██████████| 27/\n",
2189 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2190 | ]
2191 | },
2192 | {
2193 | "name": "stdout",
2194 | "output_type": "stream",
2195 | "text": [
2196 | " all 116 149 0.781 0.536 0.589 0.429\n"
2197 | ]
2198 | },
2199 | {
2200 | "name": "stderr",
2201 | "output_type": "stream",
2202 | "text": [
2203 | "\n"
2204 | ]
2205 | },
2206 | {
2207 | "name": "stdout",
2208 | "output_type": "stream",
2209 | "text": [
2210 | "\n",
2211 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2212 | ]
2213 | },
2214 | {
2215 | "name": "stderr",
2216 | "output_type": "stream",
2217 | "text": [
2218 | " 71/100 2.26G 0.8742 0.9289 1.247 36 640: 100%|██████████| 27/\n",
2219 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2220 | ]
2221 | },
2222 | {
2223 | "name": "stdout",
2224 | "output_type": "stream",
2225 | "text": [
2226 | " all 116 149 0.791 0.533 0.573 0.416\n"
2227 | ]
2228 | },
2229 | {
2230 | "name": "stderr",
2231 | "output_type": "stream",
2232 | "text": [
2233 | "\n"
2234 | ]
2235 | },
2236 | {
2237 | "name": "stdout",
2238 | "output_type": "stream",
2239 | "text": [
2240 | "\n",
2241 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2242 | ]
2243 | },
2244 | {
2245 | "name": "stderr",
2246 | "output_type": "stream",
2247 | "text": [
2248 | " 72/100 2.26G 0.8993 0.9463 1.271 43 640: 100%|██████████| 27/\n",
2249 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2250 | ]
2251 | },
2252 | {
2253 | "name": "stdout",
2254 | "output_type": "stream",
2255 | "text": [
2256 | " all 116 149 0.79 0.531 0.574 0.438\n"
2257 | ]
2258 | },
2259 | {
2260 | "name": "stderr",
2261 | "output_type": "stream",
2262 | "text": [
2263 | "\n"
2264 | ]
2265 | },
2266 | {
2267 | "name": "stdout",
2268 | "output_type": "stream",
2269 | "text": [
2270 | "\n",
2271 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2272 | ]
2273 | },
2274 | {
2275 | "name": "stderr",
2276 | "output_type": "stream",
2277 | "text": [
2278 | " 73/100 2.26G 0.8629 0.9396 1.229 35 640: 100%|██████████| 27/\n",
2279 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2280 | ]
2281 | },
2282 | {
2283 | "name": "stdout",
2284 | "output_type": "stream",
2285 | "text": [
2286 | " all 116 149 0.793 0.516 0.56 0.417\n"
2287 | ]
2288 | },
2289 | {
2290 | "name": "stderr",
2291 | "output_type": "stream",
2292 | "text": [
2293 | "\n"
2294 | ]
2295 | },
2296 | {
2297 | "name": "stdout",
2298 | "output_type": "stream",
2299 | "text": [
2300 | "\n",
2301 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2302 | ]
2303 | },
2304 | {
2305 | "name": "stderr",
2306 | "output_type": "stream",
2307 | "text": [
2308 | " 74/100 2.26G 0.8625 0.9311 1.236 32 640: 100%|██████████| 27/\n",
2309 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2310 | ]
2311 | },
2312 | {
2313 | "name": "stdout",
2314 | "output_type": "stream",
2315 | "text": [
2316 | " all 116 149 0.797 0.48 0.577 0.43\n"
2317 | ]
2318 | },
2319 | {
2320 | "name": "stderr",
2321 | "output_type": "stream",
2322 | "text": [
2323 | "\n"
2324 | ]
2325 | },
2326 | {
2327 | "name": "stdout",
2328 | "output_type": "stream",
2329 | "text": [
2330 | "\n",
2331 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2332 | ]
2333 | },
2334 | {
2335 | "name": "stderr",
2336 | "output_type": "stream",
2337 | "text": [
2338 | " 75/100 2.26G 0.8635 0.8999 1.227 55 640: 100%|██████████| 27/\n",
2339 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2340 | ]
2341 | },
2342 | {
2343 | "name": "stdout",
2344 | "output_type": "stream",
2345 | "text": [
2346 | " all 116 149 0.768 0.532 0.576 0.429\n"
2347 | ]
2348 | },
2349 | {
2350 | "name": "stderr",
2351 | "output_type": "stream",
2352 | "text": [
2353 | "\n"
2354 | ]
2355 | },
2356 | {
2357 | "name": "stdout",
2358 | "output_type": "stream",
2359 | "text": [
2360 | "\n",
2361 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2362 | ]
2363 | },
2364 | {
2365 | "name": "stderr",
2366 | "output_type": "stream",
2367 | "text": [
2368 | " 76/100 2.26G 0.8722 0.9326 1.229 37 640: 100%|██████████| 27/\n",
2369 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2370 | ]
2371 | },
2372 | {
2373 | "name": "stdout",
2374 | "output_type": "stream",
2375 | "text": [
2376 | " all 116 149 0.813 0.536 0.58 0.428\n"
2377 | ]
2378 | },
2379 | {
2380 | "name": "stderr",
2381 | "output_type": "stream",
2382 | "text": [
2383 | "\n"
2384 | ]
2385 | },
2386 | {
2387 | "name": "stdout",
2388 | "output_type": "stream",
2389 | "text": [
2390 | "\n",
2391 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2392 | ]
2393 | },
2394 | {
2395 | "name": "stderr",
2396 | "output_type": "stream",
2397 | "text": [
2398 | " 77/100 2.26G 0.8589 0.89 1.228 43 640: 100%|██████████| 27/\n",
2399 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2400 | ]
2401 | },
2402 | {
2403 | "name": "stdout",
2404 | "output_type": "stream",
2405 | "text": [
2406 | " all 116 149 0.814 0.483 0.542 0.388\n"
2407 | ]
2408 | },
2409 | {
2410 | "name": "stderr",
2411 | "output_type": "stream",
2412 | "text": [
2413 | "\n"
2414 | ]
2415 | },
2416 | {
2417 | "name": "stdout",
2418 | "output_type": "stream",
2419 | "text": [
2420 | "\n",
2421 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2422 | ]
2423 | },
2424 | {
2425 | "name": "stderr",
2426 | "output_type": "stream",
2427 | "text": [
2428 | " 78/100 2.26G 0.8561 0.9066 1.21 38 640: 100%|██████████| 27/\n",
2429 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2430 | ]
2431 | },
2432 | {
2433 | "name": "stdout",
2434 | "output_type": "stream",
2435 | "text": [
2436 | " all 116 149 0.814 0.514 0.588 0.438\n"
2437 | ]
2438 | },
2439 | {
2440 | "name": "stderr",
2441 | "output_type": "stream",
2442 | "text": [
2443 | "\n"
2444 | ]
2445 | },
2446 | {
2447 | "name": "stdout",
2448 | "output_type": "stream",
2449 | "text": [
2450 | "\n",
2451 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2452 | ]
2453 | },
2454 | {
2455 | "name": "stderr",
2456 | "output_type": "stream",
2457 | "text": [
2458 | " 79/100 2.26G 0.8402 0.8918 1.214 31 640: 100%|██████████| 27/\n",
2459 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2460 | ]
2461 | },
2462 | {
2463 | "name": "stdout",
2464 | "output_type": "stream",
2465 | "text": [
2466 | " all 116 149 0.798 0.556 0.585 0.44\n"
2467 | ]
2468 | },
2469 | {
2470 | "name": "stderr",
2471 | "output_type": "stream",
2472 | "text": [
2473 | "\n"
2474 | ]
2475 | },
2476 | {
2477 | "name": "stdout",
2478 | "output_type": "stream",
2479 | "text": [
2480 | "\n",
2481 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2482 | ]
2483 | },
2484 | {
2485 | "name": "stderr",
2486 | "output_type": "stream",
2487 | "text": [
2488 | " 80/100 2.26G 0.8241 0.9252 1.219 23 640: 100%|██████████| 27/\n",
2489 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2490 | ]
2491 | },
2492 | {
2493 | "name": "stdout",
2494 | "output_type": "stream",
2495 | "text": [
2496 | " all 116 149 0.542 0.662 0.587 0.434\n"
2497 | ]
2498 | },
2499 | {
2500 | "name": "stderr",
2501 | "output_type": "stream",
2502 | "text": [
2503 | "\n"
2504 | ]
2505 | },
2506 | {
2507 | "name": "stdout",
2508 | "output_type": "stream",
2509 | "text": [
2510 | "\n",
2511 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2512 | ]
2513 | },
2514 | {
2515 | "name": "stderr",
2516 | "output_type": "stream",
2517 | "text": [
2518 | " 81/100 2.26G 0.8331 0.8596 1.187 39 640: 100%|██████████| 27/\n",
2519 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2520 | ]
2521 | },
2522 | {
2523 | "name": "stdout",
2524 | "output_type": "stream",
2525 | "text": [
2526 | " all 116 149 0.811 0.507 0.585 0.435\n"
2527 | ]
2528 | },
2529 | {
2530 | "name": "stderr",
2531 | "output_type": "stream",
2532 | "text": [
2533 | "\n"
2534 | ]
2535 | },
2536 | {
2537 | "name": "stdout",
2538 | "output_type": "stream",
2539 | "text": [
2540 | "\n",
2541 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2542 | ]
2543 | },
2544 | {
2545 | "name": "stderr",
2546 | "output_type": "stream",
2547 | "text": [
2548 | " 82/100 2.26G 0.8252 0.8749 1.203 36 640: 100%|██████████| 27/\n",
2549 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2550 | ]
2551 | },
2552 | {
2553 | "name": "stdout",
2554 | "output_type": "stream",
2555 | "text": [
2556 | " all 116 149 0.814 0.546 0.6 0.458\n"
2557 | ]
2558 | },
2559 | {
2560 | "name": "stderr",
2561 | "output_type": "stream",
2562 | "text": [
2563 | "\n"
2564 | ]
2565 | },
2566 | {
2567 | "name": "stdout",
2568 | "output_type": "stream",
2569 | "text": [
2570 | "\n",
2571 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2572 | ]
2573 | },
2574 | {
2575 | "name": "stderr",
2576 | "output_type": "stream",
2577 | "text": [
2578 | " 83/100 2.26G 0.807 0.8501 1.178 34 640: 100%|██████████| 27/\n",
2579 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2580 | ]
2581 | },
2582 | {
2583 | "name": "stdout",
2584 | "output_type": "stream",
2585 | "text": [
2586 | " all 116 149 0.802 0.556 0.585 0.445\n"
2587 | ]
2588 | },
2589 | {
2590 | "name": "stderr",
2591 | "output_type": "stream",
2592 | "text": [
2593 | "\n"
2594 | ]
2595 | },
2596 | {
2597 | "name": "stdout",
2598 | "output_type": "stream",
2599 | "text": [
2600 | "\n",
2601 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2602 | ]
2603 | },
2604 | {
2605 | "name": "stderr",
2606 | "output_type": "stream",
2607 | "text": [
2608 | " 84/100 2.26G 0.8226 0.8541 1.211 28 640: 100%|██████████| 27/\n",
2609 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2610 | ]
2611 | },
2612 | {
2613 | "name": "stdout",
2614 | "output_type": "stream",
2615 | "text": [
2616 | " all 116 149 0.817 0.544 0.572 0.437\n"
2617 | ]
2618 | },
2619 | {
2620 | "name": "stderr",
2621 | "output_type": "stream",
2622 | "text": [
2623 | "\n"
2624 | ]
2625 | },
2626 | {
2627 | "name": "stdout",
2628 | "output_type": "stream",
2629 | "text": [
2630 | "\n",
2631 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2632 | ]
2633 | },
2634 | {
2635 | "name": "stderr",
2636 | "output_type": "stream",
2637 | "text": [
2638 | " 85/100 2.26G 0.8143 0.8664 1.206 30 640: 100%|██████████| 27/\n",
2639 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2640 | ]
2641 | },
2642 | {
2643 | "name": "stdout",
2644 | "output_type": "stream",
2645 | "text": [
2646 | " all 116 149 0.813 0.544 0.587 0.449\n"
2647 | ]
2648 | },
2649 | {
2650 | "name": "stderr",
2651 | "output_type": "stream",
2652 | "text": [
2653 | "\n"
2654 | ]
2655 | },
2656 | {
2657 | "name": "stdout",
2658 | "output_type": "stream",
2659 | "text": [
2660 | "\n",
2661 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2662 | ]
2663 | },
2664 | {
2665 | "name": "stderr",
2666 | "output_type": "stream",
2667 | "text": [
2668 | " 86/100 2.26G 0.8303 0.8316 1.215 32 640: 100%|██████████| 27/\n",
2669 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2670 | ]
2671 | },
2672 | {
2673 | "name": "stdout",
2674 | "output_type": "stream",
2675 | "text": [
2676 | " all 116 149 0.82 0.559 0.603 0.459\n"
2677 | ]
2678 | },
2679 | {
2680 | "name": "stderr",
2681 | "output_type": "stream",
2682 | "text": [
2683 | "\n"
2684 | ]
2685 | },
2686 | {
2687 | "name": "stdout",
2688 | "output_type": "stream",
2689 | "text": [
2690 | "\n",
2691 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2692 | ]
2693 | },
2694 | {
2695 | "name": "stderr",
2696 | "output_type": "stream",
2697 | "text": [
2698 | " 87/100 2.26G 0.8542 0.857 1.208 44 640: 100%|██████████| 27/\n",
2699 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2700 | ]
2701 | },
2702 | {
2703 | "name": "stdout",
2704 | "output_type": "stream",
2705 | "text": [
2706 | " all 116 149 0.805 0.557 0.591 0.453\n"
2707 | ]
2708 | },
2709 | {
2710 | "name": "stderr",
2711 | "output_type": "stream",
2712 | "text": [
2713 | "\n"
2714 | ]
2715 | },
2716 | {
2717 | "name": "stdout",
2718 | "output_type": "stream",
2719 | "text": [
2720 | "\n",
2721 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2722 | ]
2723 | },
2724 | {
2725 | "name": "stderr",
2726 | "output_type": "stream",
2727 | "text": [
2728 | " 88/100 2.26G 0.7955 0.843 1.182 30 640: 100%|██████████| 27/\n",
2729 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2730 | ]
2731 | },
2732 | {
2733 | "name": "stdout",
2734 | "output_type": "stream",
2735 | "text": [
2736 | " all 116 149 0.793 0.586 0.579 0.435\n"
2737 | ]
2738 | },
2739 | {
2740 | "name": "stderr",
2741 | "output_type": "stream",
2742 | "text": [
2743 | "\n"
2744 | ]
2745 | },
2746 | {
2747 | "name": "stdout",
2748 | "output_type": "stream",
2749 | "text": [
2750 | "\n",
2751 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2752 | ]
2753 | },
2754 | {
2755 | "name": "stderr",
2756 | "output_type": "stream",
2757 | "text": [
2758 | " 89/100 2.26G 0.794 0.8109 1.185 37 640: 100%|██████████| 27/\n",
2759 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2760 | ]
2761 | },
2762 | {
2763 | "name": "stdout",
2764 | "output_type": "stream",
2765 | "text": [
2766 | " all 116 149 0.782 0.575 0.578 0.442\n"
2767 | ]
2768 | },
2769 | {
2770 | "name": "stderr",
2771 | "output_type": "stream",
2772 | "text": [
2773 | "\n"
2774 | ]
2775 | },
2776 | {
2777 | "name": "stdout",
2778 | "output_type": "stream",
2779 | "text": [
2780 | "\n",
2781 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2782 | ]
2783 | },
2784 | {
2785 | "name": "stderr",
2786 | "output_type": "stream",
2787 | "text": [
2788 | " 90/100 2.26G 0.7914 0.8192 1.176 30 640: 100%|██████████| 27/\n",
2789 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2790 | ]
2791 | },
2792 | {
2793 | "name": "stdout",
2794 | "output_type": "stream",
2795 | "text": [
2796 | " all 116 149 0.801 0.589 0.595 0.449\n"
2797 | ]
2798 | },
2799 | {
2800 | "name": "stderr",
2801 | "output_type": "stream",
2802 | "text": [
2803 | "\n"
2804 | ]
2805 | },
2806 | {
2807 | "name": "stdout",
2808 | "output_type": "stream",
2809 | "text": [
2810 | "Closing dataloader mosaic\n",
2811 | "\n",
2812 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2813 | ]
2814 | },
2815 | {
2816 | "name": "stderr",
2817 | "output_type": "stream",
2818 | "text": [
2819 | " 91/100 2.26G 0.683 0.682 1.163 19 640: 100%|██████████| 27/\n",
2820 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2821 | ]
2822 | },
2823 | {
2824 | "name": "stdout",
2825 | "output_type": "stream",
2826 | "text": [
2827 | " all 116 149 0.832 0.561 0.615 0.462\n"
2828 | ]
2829 | },
2830 | {
2831 | "name": "stderr",
2832 | "output_type": "stream",
2833 | "text": [
2834 | "\n"
2835 | ]
2836 | },
2837 | {
2838 | "name": "stdout",
2839 | "output_type": "stream",
2840 | "text": [
2841 | "\n",
2842 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2843 | ]
2844 | },
2845 | {
2846 | "name": "stderr",
2847 | "output_type": "stream",
2848 | "text": [
2849 | " 92/100 2.26G 0.6709 0.6298 1.139 17 640: 100%|██████████| 27/\n",
2850 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2851 | ]
2852 | },
2853 | {
2854 | "name": "stdout",
2855 | "output_type": "stream",
2856 | "text": [
2857 | " all 116 149 0.82 0.577 0.618 0.449\n"
2858 | ]
2859 | },
2860 | {
2861 | "name": "stderr",
2862 | "output_type": "stream",
2863 | "text": [
2864 | "\n"
2865 | ]
2866 | },
2867 | {
2868 | "name": "stdout",
2869 | "output_type": "stream",
2870 | "text": [
2871 | "\n",
2872 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2873 | ]
2874 | },
2875 | {
2876 | "name": "stderr",
2877 | "output_type": "stream",
2878 | "text": [
2879 | " 93/100 2.26G 0.6274 0.6055 1.127 14 640: 100%|██████████| 27/\n",
2880 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2881 | ]
2882 | },
2883 | {
2884 | "name": "stdout",
2885 | "output_type": "stream",
2886 | "text": [
2887 | " all 116 149 0.794 0.582 0.617 0.449\n"
2888 | ]
2889 | },
2890 | {
2891 | "name": "stderr",
2892 | "output_type": "stream",
2893 | "text": [
2894 | "\n"
2895 | ]
2896 | },
2897 | {
2898 | "name": "stdout",
2899 | "output_type": "stream",
2900 | "text": [
2901 | "\n",
2902 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2903 | ]
2904 | },
2905 | {
2906 | "name": "stderr",
2907 | "output_type": "stream",
2908 | "text": [
2909 | " 94/100 2.26G 0.6303 0.5925 1.134 16 640: 100%|██████████| 27/\n",
2910 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2911 | ]
2912 | },
2913 | {
2914 | "name": "stdout",
2915 | "output_type": "stream",
2916 | "text": [
2917 | " all 116 149 0.764 0.591 0.632 0.468\n"
2918 | ]
2919 | },
2920 | {
2921 | "name": "stderr",
2922 | "output_type": "stream",
2923 | "text": [
2924 | "\n"
2925 | ]
2926 | },
2927 | {
2928 | "name": "stdout",
2929 | "output_type": "stream",
2930 | "text": [
2931 | "\n",
2932 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2933 | ]
2934 | },
2935 | {
2936 | "name": "stderr",
2937 | "output_type": "stream",
2938 | "text": [
2939 | " 95/100 2.26G 0.6265 0.5663 1.127 11 640: 100%|██████████| 27/\n",
2940 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2941 | ]
2942 | },
2943 | {
2944 | "name": "stdout",
2945 | "output_type": "stream",
2946 | "text": [
2947 | " all 116 149 0.773 0.569 0.645 0.472\n"
2948 | ]
2949 | },
2950 | {
2951 | "name": "stderr",
2952 | "output_type": "stream",
2953 | "text": [
2954 | "\n"
2955 | ]
2956 | },
2957 | {
2958 | "name": "stdout",
2959 | "output_type": "stream",
2960 | "text": [
2961 | "\n",
2962 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2963 | ]
2964 | },
2965 | {
2966 | "name": "stderr",
2967 | "output_type": "stream",
2968 | "text": [
2969 | " 96/100 2.26G 0.6028 0.5537 1.101 16 640: 100%|██████████| 27/\n",
2970 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
2971 | ]
2972 | },
2973 | {
2974 | "name": "stdout",
2975 | "output_type": "stream",
2976 | "text": [
2977 | " all 116 149 0.775 0.562 0.629 0.466\n"
2978 | ]
2979 | },
2980 | {
2981 | "name": "stderr",
2982 | "output_type": "stream",
2983 | "text": [
2984 | "\n"
2985 | ]
2986 | },
2987 | {
2988 | "name": "stdout",
2989 | "output_type": "stream",
2990 | "text": [
2991 | "\n",
2992 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
2993 | ]
2994 | },
2995 | {
2996 | "name": "stderr",
2997 | "output_type": "stream",
2998 | "text": [
2999 | " 97/100 2.26G 0.6021 0.536 1.099 12 640: 100%|██████████| 27/\n",
3000 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
3001 | ]
3002 | },
3003 | {
3004 | "name": "stdout",
3005 | "output_type": "stream",
3006 | "text": [
3007 | " all 116 149 0.867 0.502 0.632 0.464\n"
3008 | ]
3009 | },
3010 | {
3011 | "name": "stderr",
3012 | "output_type": "stream",
3013 | "text": [
3014 | "\n"
3015 | ]
3016 | },
3017 | {
3018 | "name": "stdout",
3019 | "output_type": "stream",
3020 | "text": [
3021 | "\n",
3022 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
3023 | ]
3024 | },
3025 | {
3026 | "name": "stderr",
3027 | "output_type": "stream",
3028 | "text": [
3029 | " 98/100 2.26G 0.5979 0.5539 1.113 18 640: 100%|██████████| 27/\n",
3030 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
3031 | ]
3032 | },
3033 | {
3034 | "name": "stdout",
3035 | "output_type": "stream",
3036 | "text": [
3037 | " all 116 149 0.799 0.58 0.624 0.464\n"
3038 | ]
3039 | },
3040 | {
3041 | "name": "stderr",
3042 | "output_type": "stream",
3043 | "text": [
3044 | "\n"
3045 | ]
3046 | },
3047 | {
3048 | "name": "stdout",
3049 | "output_type": "stream",
3050 | "text": [
3051 | "\n",
3052 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
3053 | ]
3054 | },
3055 | {
3056 | "name": "stderr",
3057 | "output_type": "stream",
3058 | "text": [
3059 | " 99/100 2.26G 0.594 0.5377 1.103 13 640: 100%|██████████| 27/\n",
3060 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
3061 | ]
3062 | },
3063 | {
3064 | "name": "stdout",
3065 | "output_type": "stream",
3066 | "text": [
3067 | " all 116 149 0.795 0.591 0.627 0.463\n"
3068 | ]
3069 | },
3070 | {
3071 | "name": "stderr",
3072 | "output_type": "stream",
3073 | "text": [
3074 | "\n"
3075 | ]
3076 | },
3077 | {
3078 | "name": "stdout",
3079 | "output_type": "stream",
3080 | "text": [
3081 | "\n",
3082 | " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n"
3083 | ]
3084 | },
3085 | {
3086 | "name": "stderr",
3087 | "output_type": "stream",
3088 | "text": [
3089 | " 100/100 2.26G 0.5784 0.5594 1.122 20 640: 100%|██████████| 27/\n",
3090 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████"
3091 | ]
3092 | },
3093 | {
3094 | "name": "stdout",
3095 | "output_type": "stream",
3096 | "text": [
3097 | " all 116 149 0.799 0.591 0.626 0.467\n"
3098 | ]
3099 | },
3100 | {
3101 | "name": "stderr",
3102 | "output_type": "stream",
3103 | "text": [
3104 | "\n"
3105 | ]
3106 | },
3107 | {
3108 | "name": "stdout",
3109 | "output_type": "stream",
3110 | "text": [
3111 | "\n",
3112 | "100 epochs completed in 0.091 hours.\n",
3113 | "Optimizer stripped from runs\\detect\\train3\\weights\\last.pt, 6.3MB\n",
3114 | "Optimizer stripped from runs\\detect\\train3\\weights\\best.pt, 6.3MB\n",
3115 | "\n",
3116 | "Validating runs\\detect\\train3\\weights\\best.pt...\n",
3117 | "Ultralytics YOLOv8.1.24 🚀 Python-3.11.6 torch-2.1.2+cu118 CUDA:0 (NVIDIA GeForce RTX 3090, 24576MiB)\n",
3118 | "Model summary (fused): 168 layers, 3006428 parameters, 0 gradients, 8.1 GFLOPs\n"
3119 | ]
3120 | },
3121 | {
3122 | "name": "stderr",
3123 | "output_type": "stream",
3124 | "text": [
3125 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████\n"
3126 | ]
3127 | },
3128 | {
3129 | "name": "stdout",
3130 | "output_type": "stream",
3131 | "text": [
3132 | " all 116 149 0.771 0.573 0.646 0.473\n",
3133 | " fork 116 46 0.515 0.739 0.6 0.37\n",
3134 | " knife 116 4 1 0 0.274 0.111\n",
3135 | " plate 116 11 0.886 0.71 0.873 0.758\n",
3136 | " spoon 116 88 0.684 0.841 0.838 0.653\n",
3137 | "Speed: 0.3ms preprocess, 1.0ms inference, 0.0ms loss, 1.9ms postprocess per image\n",
3138 | "Results saved to \u001b[1mruns\\detect\\train3\u001b[0m\n"
3139 | ]
3140 | }
3141 | ],
3142 | "source": [
3143 | "from ultralytics import YOLO\n",
3144 | "\n",
3145 | "# Load a model\n",
3146 | "model = YOLO('yolov8n.pt') # load a pretrained model (recommended for training)\n",
3147 | "\n",
3148 | "# Train the model with 2 GPUs\n",
3149 | "results = model.train(data='data.yaml', epochs=100, imgsz=640, device=0)"
3150 | ]
3151 | },
3152 | {
3153 | "cell_type": "code",
3154 | "execution_count": 5,
3155 | "id": "d5bf496c-65c0-4bc8-b076-e626ad5d87cf",
3156 | "metadata": {},
3157 | "outputs": [
3158 | {
3159 | "name": "stdout",
3160 | "output_type": "stream",
3161 | "text": [
3162 | "Ultralytics YOLOv8.1.24 🚀 Python-3.11.6 torch-2.1.2+cu118 CUDA:0 (NVIDIA GeForce RTX 3090, 24576MiB)\n",
3163 | "Model summary (fused): 168 layers, 3006428 parameters, 0 gradients, 8.1 GFLOPs\n"
3164 | ]
3165 | },
3166 | {
3167 | "name": "stderr",
3168 | "output_type": "stream",
3169 | "text": [
3170 | "\u001b[34m\u001b[1mval: \u001b[0mScanning E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\val\\labels.cac\u001b[0m"
3171 | ]
3172 | },
3173 | {
3174 | "name": "stdout",
3175 | "output_type": "stream",
3176 | "text": [
3177 | "\u001b[34m\u001b[1mval: \u001b[0mWARNING ⚠️ E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\val\\images\\8YGAV61FP6DX_jpg.rf.58da95b585c9603f5f940e73eff64a57.jpg: ignoring corrupt image/label: non-normalized or out of bounds coordinates [ 1.0132]\n",
3178 | "\u001b[34m\u001b[1mval: \u001b[0mWARNING ⚠️ E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\dataset\\val\\images\\CK5FP969OKVT_jpg.rf.39129739a321267395ceb3dc451f0d26.jpg: ignoring corrupt image/label: non-normalized or out of bounds coordinates [ 1.0011]\n",
3179 | "WARNING ⚠️ Box and segment counts should be equal, but got len(segments) = 20, len(boxes) = 149. To resolve this only boxes will be used and all segments will be removed. To avoid this please supply either a detect or segment dataset, not a detect-segment mixed dataset.\n"
3180 | ]
3181 | },
3182 | {
3183 | "name": "stderr",
3184 | "output_type": "stream",
3185 | "text": [
3186 | "\n",
3187 | " Class Images Instances Box(P R mAP50 mAP50-95): 100%|████\n"
3188 | ]
3189 | },
3190 | {
3191 | "name": "stdout",
3192 | "output_type": "stream",
3193 | "text": [
3194 | " all 116 149 0.827 0.53 0.641 0.467\n",
3195 | " fork 116 46 0.575 0.652 0.587 0.359\n",
3196 | " knife 116 4 1 0 0.278 0.112\n",
3197 | " plate 116 11 0.981 0.636 0.859 0.746\n",
3198 | " spoon 116 88 0.753 0.832 0.841 0.65\n",
3199 | "Speed: 0.4ms preprocess, 6.9ms inference, 0.0ms loss, 1.0ms postprocess per image\n",
3200 | "Results saved to \u001b[1mruns\\detect\\val\u001b[0m\n"
3201 | ]
3202 | },
3203 | {
3204 | "data": {
3205 | "text/plain": [
3206 | "array([ 0.3591, 0.11213, 0.74554, 0.65032])"
3207 | ]
3208 | },
3209 | "execution_count": 5,
3210 | "metadata": {},
3211 | "output_type": "execute_result"
3212 | }
3213 | ],
3214 | "source": [
3215 | "# Validate model\n",
3216 | "\n",
3217 | "from ultralytics import YOLO\n",
3218 | "\n",
3219 | "# Load a model\n",
3220 | "model = YOLO('runs/detect/train3/weights/best.pt') # load a custom model\n",
3221 | "\n",
3222 | "# Validate the model\n",
3223 | "metrics = model.val() # no arguments needed, dataset and settings remembered\n",
3224 | "metrics.box.map # map50-95\n",
3225 | "metrics.box.map50 # map50\n",
3226 | "metrics.box.map75 # map75\n",
3227 | "metrics.box.maps # a list contains map50-95 of each category"
3228 | ]
3229 | },
3230 | {
3231 | "cell_type": "code",
3232 | "execution_count": 7,
3233 | "id": "28af2e54-9d78-4da5-8fa7-137344fcfd3f",
3234 | "metadata": {},
3235 | "outputs": [
3236 | {
3237 | "name": "stdout",
3238 | "output_type": "stream",
3239 | "text": [
3240 | "\n",
3241 | "image 1/3 E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\test_images\\a.jpg: 640x640 2 forks, 2 spoons, 20.0ms\n",
3242 | "image 2/3 E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\test_images\\b.jpg: 640x640 3 forks, 2 spoons, 38.0ms\n",
3243 | "image 3/3 E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\test_images\\d.jpg: 640x416 2 forks, 2 spoons, 17.0ms\n",
3244 | "Speed: 3.0ms preprocess, 25.0ms inference, 2.0ms postprocess per image at shape (1, 3, 640, 416)\n",
3245 | "Results saved to \u001b[1mruns\\detect\\predict2\u001b[0m\n"
3246 | ]
3247 | },
3248 | {
3249 | "data": {
3250 | "text/plain": [
3251 | "[ultralytics.engine.results.Results object with attributes:\n",
3252 | " \n",
3253 | " boxes: ultralytics.engine.results.Boxes object\n",
3254 | " keypoints: None\n",
3255 | " masks: None\n",
3256 | " names: {0: 'fork', 1: 'knife', 2: 'plate', 3: 'spoon'}\n",
3257 | " obb: None\n",
3258 | " orig_img: array([[[210, 210, 210],\n",
3259 | " [210, 210, 210],\n",
3260 | " [210, 210, 210],\n",
3261 | " ...,\n",
3262 | " [210, 210, 210],\n",
3263 | " [210, 210, 210],\n",
3264 | " [210, 210, 210]],\n",
3265 | " \n",
3266 | " [[210, 210, 210],\n",
3267 | " [210, 210, 210],\n",
3268 | " [210, 210, 210],\n",
3269 | " ...,\n",
3270 | " [210, 210, 210],\n",
3271 | " [210, 210, 210],\n",
3272 | " [210, 210, 210]],\n",
3273 | " \n",
3274 | " [[210, 210, 210],\n",
3275 | " [210, 210, 210],\n",
3276 | " [210, 210, 210],\n",
3277 | " ...,\n",
3278 | " [210, 210, 210],\n",
3279 | " [210, 210, 210],\n",
3280 | " [210, 210, 210]],\n",
3281 | " \n",
3282 | " ...,\n",
3283 | " \n",
3284 | " [[240, 240, 240],\n",
3285 | " [240, 240, 240],\n",
3286 | " [240, 240, 240],\n",
3287 | " ...,\n",
3288 | " [240, 240, 240],\n",
3289 | " [240, 240, 240],\n",
3290 | " [240, 240, 240]],\n",
3291 | " \n",
3292 | " [[240, 240, 240],\n",
3293 | " [240, 240, 240],\n",
3294 | " [240, 240, 240],\n",
3295 | " ...,\n",
3296 | " [240, 240, 240],\n",
3297 | " [240, 240, 240],\n",
3298 | " [240, 240, 240]],\n",
3299 | " \n",
3300 | " [[240, 240, 240],\n",
3301 | " [240, 240, 240],\n",
3302 | " [240, 240, 240],\n",
3303 | " ...,\n",
3304 | " [240, 240, 240],\n",
3305 | " [240, 240, 240],\n",
3306 | " [240, 240, 240]]], dtype=uint8)\n",
3307 | " orig_shape: (512, 512)\n",
3308 | " path: 'E:\\\\yolov8_env\\\\ultralytics_android_app\\\\step_1_train_test_export\\\\test_images\\\\a.jpg'\n",
3309 | " probs: None\n",
3310 | " save_dir: 'runs\\\\detect\\\\predict2'\n",
3311 | " speed: {'preprocess': 3.0007362365722656, 'inference': 19.999265670776367, 'postprocess': 2.0003318786621094},\n",
3312 | " ultralytics.engine.results.Results object with attributes:\n",
3313 | " \n",
3314 | " boxes: ultralytics.engine.results.Boxes object\n",
3315 | " keypoints: None\n",
3316 | " masks: None\n",
3317 | " names: {0: 'fork', 1: 'knife', 2: 'plate', 3: 'spoon'}\n",
3318 | " obb: None\n",
3319 | " orig_img: array([[[255, 255, 255],\n",
3320 | " [255, 255, 255],\n",
3321 | " [255, 255, 255],\n",
3322 | " ...,\n",
3323 | " [255, 255, 255],\n",
3324 | " [255, 255, 255],\n",
3325 | " [255, 255, 255]],\n",
3326 | " \n",
3327 | " [[255, 255, 255],\n",
3328 | " [255, 255, 255],\n",
3329 | " [255, 255, 255],\n",
3330 | " ...,\n",
3331 | " [255, 255, 255],\n",
3332 | " [255, 255, 255],\n",
3333 | " [255, 255, 255]],\n",
3334 | " \n",
3335 | " [[255, 255, 255],\n",
3336 | " [255, 255, 255],\n",
3337 | " [255, 255, 255],\n",
3338 | " ...,\n",
3339 | " [255, 255, 255],\n",
3340 | " [255, 255, 255],\n",
3341 | " [255, 255, 255]],\n",
3342 | " \n",
3343 | " ...,\n",
3344 | " \n",
3345 | " [[254, 254, 254],\n",
3346 | " [254, 254, 254],\n",
3347 | " [254, 254, 254],\n",
3348 | " ...,\n",
3349 | " [255, 255, 255],\n",
3350 | " [255, 255, 255],\n",
3351 | " [255, 255, 255]],\n",
3352 | " \n",
3353 | " [[254, 254, 254],\n",
3354 | " [254, 254, 254],\n",
3355 | " [254, 254, 254],\n",
3356 | " ...,\n",
3357 | " [255, 255, 255],\n",
3358 | " [255, 255, 255],\n",
3359 | " [255, 255, 255]],\n",
3360 | " \n",
3361 | " [[254, 254, 254],\n",
3362 | " [254, 254, 254],\n",
3363 | " [254, 254, 254],\n",
3364 | " ...,\n",
3365 | " [255, 255, 255],\n",
3366 | " [255, 255, 255],\n",
3367 | " [255, 255, 255]]], dtype=uint8)\n",
3368 | " orig_shape: (500, 500)\n",
3369 | " path: 'E:\\\\yolov8_env\\\\ultralytics_android_app\\\\step_1_train_test_export\\\\test_images\\\\b.jpg'\n",
3370 | " probs: None\n",
3371 | " save_dir: 'runs\\\\detect\\\\predict2'\n",
3372 | " speed: {'preprocess': 3.000497817993164, 'inference': 37.999629974365234, 'postprocess': 1.9989013671875},\n",
3373 | " ultralytics.engine.results.Results object with attributes:\n",
3374 | " \n",
3375 | " boxes: ultralytics.engine.results.Boxes object\n",
3376 | " keypoints: None\n",
3377 | " masks: None\n",
3378 | " names: {0: 'fork', 1: 'knife', 2: 'plate', 3: 'spoon'}\n",
3379 | " obb: None\n",
3380 | " orig_img: array([[[217, 217, 217],\n",
3381 | " [235, 235, 235],\n",
3382 | " [229, 229, 229],\n",
3383 | " ...,\n",
3384 | " [230, 230, 230],\n",
3385 | " [230, 230, 230],\n",
3386 | " [230, 230, 230]],\n",
3387 | " \n",
3388 | " [[231, 231, 231],\n",
3389 | " [252, 252, 252],\n",
3390 | " [249, 249, 249],\n",
3391 | " ...,\n",
3392 | " [230, 230, 230],\n",
3393 | " [230, 230, 230],\n",
3394 | " [230, 230, 230]],\n",
3395 | " \n",
3396 | " [[229, 229, 229],\n",
3397 | " [253, 253, 253],\n",
3398 | " [254, 254, 254],\n",
3399 | " ...,\n",
3400 | " [230, 230, 230],\n",
3401 | " [230, 230, 230],\n",
3402 | " [230, 230, 230]],\n",
3403 | " \n",
3404 | " ...,\n",
3405 | " \n",
3406 | " [[230, 230, 230],\n",
3407 | " [230, 230, 230],\n",
3408 | " [230, 230, 230],\n",
3409 | " ...,\n",
3410 | " [252, 252, 252],\n",
3411 | " [247, 247, 247],\n",
3412 | " [243, 243, 243]],\n",
3413 | " \n",
3414 | " [[230, 230, 230],\n",
3415 | " [230, 230, 230],\n",
3416 | " [230, 230, 230],\n",
3417 | " ...,\n",
3418 | " [246, 246, 246],\n",
3419 | " [241, 241, 241],\n",
3420 | " [238, 238, 238]],\n",
3421 | " \n",
3422 | " [[230, 230, 230],\n",
3423 | " [230, 230, 230],\n",
3424 | " [230, 230, 230],\n",
3425 | " ...,\n",
3426 | " [237, 237, 237],\n",
3427 | " [231, 231, 231],\n",
3428 | " [228, 228, 228]]], dtype=uint8)\n",
3429 | " orig_shape: (480, 300)\n",
3430 | " path: 'E:\\\\yolov8_env\\\\ultralytics_android_app\\\\step_1_train_test_export\\\\test_images\\\\d.jpg'\n",
3431 | " probs: None\n",
3432 | " save_dir: 'runs\\\\detect\\\\predict2'\n",
3433 | " speed: {'preprocess': 2.9969215393066406, 'inference': 17.001628875732422, 'postprocess': 1.9989013671875}]"
3434 | ]
3435 | },
3436 | "execution_count": 7,
3437 | "metadata": {},
3438 | "output_type": "execute_result"
3439 | }
3440 | ],
3441 | "source": [
3442 | "# Prediction using trained model\n",
3443 | "\n",
3444 | "from ultralytics import YOLO\n",
3445 | "\n",
3446 | "# Load a pretrained YOLOv8n model\n",
3447 | "model = YOLO('runs/detect/train3/weights/best.pt')\n",
3448 | "\n",
3449 | "# Run inference \n",
3450 | "model.predict('test_images', save=True, imgsz=640, conf=0.2)"
3451 | ]
3452 | },
3453 | {
3454 | "cell_type": "code",
3455 | "execution_count": 9,
3456 | "id": "2f3d815e-d7ad-4f2d-b540-b3039f1230e1",
3457 | "metadata": {},
3458 | "outputs": [
3459 | {
3460 | "name": "stdout",
3461 | "output_type": "stream",
3462 | "text": [
3463 | "Ultralytics YOLOv8.1.24 🚀 Python-3.11.6 torch-2.1.2+cu118 CPU (AMD Ryzen 9 5900X 12-Core Processor)\n",
3464 | "Model summary (fused): 168 layers, 3006428 parameters, 0 gradients, 8.1 GFLOPs\n",
3465 | "\n",
3466 | "\u001b[34m\u001b[1mPyTorch:\u001b[0m starting from 'runs\\detect\\train3\\weights\\best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) (1, 8, 8400) (6.0 MB)\n",
3467 | "\u001b[31m\u001b[1mrequirements:\u001b[0m Ultralytics requirement ['onnxruntime-gpu'] not found, attempting AutoUpdate...\n",
3468 | "\u001b[31m\u001b[1mrequirements:\u001b[0m ❌ Command 'pip install --no-cache \"onnxruntime-gpu\" --extra-index-url https://pypi.ngc.nvidia.com' returned non-zero exit status 1.\n",
3469 | "\n",
3470 | "\u001b[34m\u001b[1mTensorFlow SavedModel:\u001b[0m starting export with tensorflow 2.13.1...\n",
3471 | "Downloading https://github.com/ultralytics/assets/releases/download/v8.1.0/calibration_image_sample_data_20x128x128x3_float32.npy.zip to 'calibration_image_sample_data_20x128x128x3_float32.npy.zip'...\n"
3472 | ]
3473 | },
3474 | {
3475 | "name": "stderr",
3476 | "output_type": "stream",
3477 | "text": [
3478 | "100%|█████████████████████████████████████████████████████████| 1.11M/1.11M [00:00<00:00, 11.2MB/s]\n",
3479 | "Unzipping calibration_image_sample_data_20x128x128x3_float32.npy.zip to E:\\yolov8_env\\ultralytics_a"
3480 | ]
3481 | },
3482 | {
3483 | "name": "stdout",
3484 | "output_type": "stream",
3485 | "text": [
3486 | "\u001b[31m\u001b[1mrequirements:\u001b[0m Ultralytics requirement ['onnxruntime-gpu'] not found, attempting AutoUpdate...\n"
3487 | ]
3488 | },
3489 | {
3490 | "name": "stderr",
3491 | "output_type": "stream",
3492 | "text": [
3493 | "\n"
3494 | ]
3495 | },
3496 | {
3497 | "name": "stdout",
3498 | "output_type": "stream",
3499 | "text": [
3500 | "\u001b[31m\u001b[1mrequirements:\u001b[0m ❌ Command 'pip install --no-cache \"onnxruntime-gpu\" ' returned non-zero exit status 1.\n",
3501 | "\n",
3502 | "\u001b[34m\u001b[1mONNX:\u001b[0m starting export with onnx 1.16.0 opset 17...\n",
3503 | "\u001b[34m\u001b[1mONNX:\u001b[0m simplifying with onnxsim 0.4.36...\n",
3504 | "\u001b[34m\u001b[1mONNX:\u001b[0m export success ✅ 15.1s, saved as 'runs\\detect\\train3\\weights\\best.onnx' (11.7 MB)\n",
3505 | "\u001b[34m\u001b[1mTensorFlow SavedModel:\u001b[0m starting TFLite export with onnx2tf 1.17.5...\n",
3506 | "\u001b[34m\u001b[1mTensorFlow SavedModel:\u001b[0m export success ✅ 43.0s, saved as 'runs\\detect\\train3\\weights\\best_saved_model' (29.5 MB)\n",
3507 | "\n",
3508 | "\u001b[34m\u001b[1mTensorFlow Lite:\u001b[0m starting export with tensorflow 2.13.1...\n",
3509 | "\u001b[34m\u001b[1mTensorFlow Lite:\u001b[0m export success ✅ 0.0s, saved as 'runs\\detect\\train3\\weights\\best_saved_model\\best_float32.tflite' (11.7 MB)\n",
3510 | "\n",
3511 | "Export complete (44.7s)\n",
3512 | "Results saved to \u001b[1mE:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\runs\\detect\\train3\\weights\u001b[0m\n",
3513 | "Predict: yolo predict task=detect model=runs\\detect\\train3\\weights\\best_saved_model\\best_float32.tflite imgsz=640 \n",
3514 | "Validate: yolo val task=detect model=runs\\detect\\train3\\weights\\best_saved_model\\best_float32.tflite imgsz=640 data=data.yaml \n",
3515 | "Visualize: https://netron.app\n"
3516 | ]
3517 | },
3518 | {
3519 | "data": {
3520 | "text/plain": [
3521 | "'runs\\\\detect\\\\train3\\\\weights\\\\best_saved_model\\\\best_float32.tflite'"
3522 | ]
3523 | },
3524 | "execution_count": 9,
3525 | "metadata": {},
3526 | "output_type": "execute_result"
3527 | }
3528 | ],
3529 | "source": [
3530 | "# Export model to tflite\n",
3531 | "\n",
3532 | "\n",
3533 | "from ultralytics import YOLO\n",
3534 | "\n",
3535 | "# Load a model\n",
3536 | "model = YOLO('runs/detect/train3/weights/best.pt') # load a custom trained model\n",
3537 | "\n",
3538 | "# Export the model\n",
3539 | "model.export(format='tflite')"
3540 | ]
3541 | },
3542 | {
3543 | "cell_type": "code",
3544 | "execution_count": 10,
3545 | "id": "b3aae33b-b14a-43f6-861f-3e0f2d21407f",
3546 | "metadata": {},
3547 | "outputs": [
3548 | {
3549 | "name": "stdout",
3550 | "output_type": "stream",
3551 | "text": [
3552 | "Loading runs\\detect\\train3\\weights\\best_saved_model\\best_float32.tflite for TensorFlow Lite inference...\n",
3553 | "\n",
3554 | "image 1/1 E:\\yolov8_env\\ultralytics_android_app\\step_1_train_test_export\\test_images\\b.jpg: 640x640 3 forks, 2 spoons, 184.0ms\n",
3555 | "Speed: 3.0ms preprocess, 184.0ms inference, 52.1ms postprocess per image at shape (1, 3, 640, 640)\n",
3556 | "Results saved to \u001b[1mruns\\detect\\predict\u001b[0m\n"
3557 | ]
3558 | },
3559 | {
3560 | "data": {
3561 | "text/plain": [
3562 | "[ultralytics.engine.results.Results object with attributes:\n",
3563 | " \n",
3564 | " boxes: ultralytics.engine.results.Boxes object\n",
3565 | " keypoints: None\n",
3566 | " masks: None\n",
3567 | " names: {0: 'fork', 1: 'knife', 2: 'plate', 3: 'spoon'}\n",
3568 | " obb: None\n",
3569 | " orig_img: array([[[255, 255, 255],\n",
3570 | " [255, 255, 255],\n",
3571 | " [255, 255, 255],\n",
3572 | " ...,\n",
3573 | " [255, 255, 255],\n",
3574 | " [255, 255, 255],\n",
3575 | " [255, 255, 255]],\n",
3576 | " \n",
3577 | " [[255, 255, 255],\n",
3578 | " [255, 255, 255],\n",
3579 | " [255, 255, 255],\n",
3580 | " ...,\n",
3581 | " [255, 255, 255],\n",
3582 | " [255, 255, 255],\n",
3583 | " [255, 255, 255]],\n",
3584 | " \n",
3585 | " [[255, 255, 255],\n",
3586 | " [255, 255, 255],\n",
3587 | " [255, 255, 255],\n",
3588 | " ...,\n",
3589 | " [255, 255, 255],\n",
3590 | " [255, 255, 255],\n",
3591 | " [255, 255, 255]],\n",
3592 | " \n",
3593 | " ...,\n",
3594 | " \n",
3595 | " [[254, 254, 254],\n",
3596 | " [254, 254, 254],\n",
3597 | " [254, 254, 254],\n",
3598 | " ...,\n",
3599 | " [255, 255, 255],\n",
3600 | " [255, 255, 255],\n",
3601 | " [255, 255, 255]],\n",
3602 | " \n",
3603 | " [[254, 254, 254],\n",
3604 | " [254, 254, 254],\n",
3605 | " [254, 254, 254],\n",
3606 | " ...,\n",
3607 | " [255, 255, 255],\n",
3608 | " [255, 255, 255],\n",
3609 | " [255, 255, 255]],\n",
3610 | " \n",
3611 | " [[254, 254, 254],\n",
3612 | " [254, 254, 254],\n",
3613 | " [254, 254, 254],\n",
3614 | " ...,\n",
3615 | " [255, 255, 255],\n",
3616 | " [255, 255, 255],\n",
3617 | " [255, 255, 255]]], dtype=uint8)\n",
3618 | " orig_shape: (500, 500)\n",
3619 | " path: 'E:\\\\yolov8_env\\\\ultralytics_android_app\\\\step_1_train_test_export\\\\test_images\\\\b.jpg'\n",
3620 | " probs: None\n",
3621 | " save_dir: 'runs\\\\detect\\\\predict'\n",
3622 | " speed: {'preprocess': 3.0007362365722656, 'inference': 183.99810791015625, 'postprocess': 52.13308334350586}]"
3623 | ]
3624 | },
3625 | "execution_count": 10,
3626 | "metadata": {},
3627 | "output_type": "execute_result"
3628 | }
3629 | ],
3630 | "source": [
3631 | "# Prediction using custom tflite model\n",
3632 | "\n",
3633 | "# Prediction using trained model\n",
3634 | "\n",
3635 | "from ultralytics import YOLO\n",
3636 | "\n",
3637 | "# Load a pretrained YOLOv8n model\n",
3638 | "model = YOLO('runs\\\\detect\\\\train3\\\\weights\\\\best_saved_model\\\\best_float32.tflite')\n",
3639 | "\n",
3640 | "# Run inference \n",
3641 | "model.predict('test_images', save=True, imgsz=640, conf=0.2)"
3642 | ]
3643 | },
3644 | {
3645 | "cell_type": "code",
3646 | "execution_count": null,
3647 | "id": "6340d01d-6c54-4989-9f04-91206888e37a",
3648 | "metadata": {},
3649 | "outputs": [],
3650 | "source": []
3651 | }
3652 | ],
3653 | "metadata": {
3654 | "kernelspec": {
3655 | "display_name": "Python 3 (ipykernel)",
3656 | "language": "python",
3657 | "name": "python3"
3658 | },
3659 | "language_info": {
3660 | "codemirror_mode": {
3661 | "name": "ipython",
3662 | "version": 3
3663 | },
3664 | "file_extension": ".py",
3665 | "mimetype": "text/x-python",
3666 | "name": "python",
3667 | "nbconvert_exporter": "python",
3668 | "pygments_lexer": "ipython3",
3669 | "version": "3.11.6"
3670 | }
3671 | },
3672 | "nbformat": 4,
3673 | "nbformat_minor": 5
3674 | }
3675 |
--------------------------------------------------------------------------------
/update.py:
--------------------------------------------------------------------------------
1 | # Importando bibliotecas necessárias
2 | import os
3 | import cv2
4 | import numpy as np
5 | import tensorflow as tf
6 | from tensorflow import keras
7 | from tensorflow.keras import layers
8 | from yolov8 import YOLOv8
9 | import matplotlib.pyplot as plt
10 | from sklearn.model_selection import train_test_split
11 | import random
12 |
13 | def load_data(data_path):
14 | # Carregar dados a partir do caminho fornecido
15 | images = []
16 | labels = []
17 | for file in os.listdir(data_path):
18 | if file.endswith('.jpg'):
19 | image = cv2.imread(os.path.join(data_path, file))
20 | label = file.replace('.jpg', '.txt')
21 | with open(os.path.join(data_path, label), 'r') as f:
22 | label_data = f.read()
23 | images.append(image)
24 | labels.append(label_data)
25 | return images, labels
26 |
27 | def preprocess_data(images, labels):
28 | # Pré-processamento de dados
29 | processed_images = []
30 | processed_labels = []
31 | for image, label in zip(images, labels):
32 | image = cv2.resize(image, (640, 640))
33 | processed_images.append(image)
34 | processed_labels.append(label)
35 | return np.array(processed_images), np.array(processed_labels)
36 |
37 | def build_model():
38 | # Construir o modelo YOLOv8
39 | model = YOLOv8(input_shape=(640, 640, 3), num_classes=80)
40 | model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
41 | return model
42 |
43 | def train_model(model, train_data, val_data, epochs=50, batch_size=32):
44 | # Treinar o modelo
45 | history = model.fit(train_data[0], train_data[1], validation_data=val_data,
46 | epochs=epochs, batch_size=batch_size)
47 | return model, history
48 |
49 | def evaluate_model(model, test_data):
50 | # Avaliar o modelo
51 | results = model.evaluate(test_data[0], test_data[1])
52 | print(f'Test loss: {results[0]} / Test accuracy: {results[1]}')
53 | return results
54 |
55 | def save_model(model, save_path):
56 | # Salvar o modelo treinado
57 | model.save(save_path)
58 |
59 | def plot_training_history(history):
60 | # Plotar histórico de treinamento
61 | plt.figure(figsize=(12, 4))
62 | plt.subplot(1, 2, 1)
63 | plt.plot(history.history['accuracy'], label='Accuracy')
64 | plt.plot(history.history['val_accuracy'], label = 'Val Accuracy')
65 | plt.xlabel('Epoch')
66 | plt.ylabel('Accuracy')
67 | plt.ylim([0, 1])
68 | plt.legend(loc='lower right')
69 |
70 | plt.subplot(1, 2, 2)
71 | plt.plot(history.history['loss'], label='Loss')
72 | plt.plot(history.history['val_loss'], label='Val Loss')
73 | plt.xlabel('Epoch')
74 | plt.ylabel('Loss')
75 | plt.ylim([0, 1])
76 | plt.legend(loc='upper right')
77 | plt.show()
78 |
79 | def main():
80 | data_path = 'path/to/data'
81 | save_path = 'path/to/save/model'
82 |
83 | # Carregar e preprocessar os dados
84 | images, labels = load_data(data_path)
85 | images, labels = preprocess_data(images, labels)
86 |
87 | # Dividir os dados em conjuntos de treino, validação e teste
88 | train_images, test_images, train_labels, test_labels = train_test_split(images, labels, test_size=0.2, random_state=42)
89 | train_images, val_images, train_labels, val_labels = train_test_split(train_images, train_labels, test_size=0.25, random_state=42)
90 |
91 | # Construir e treinar o modelo
92 | model = build_model()
93 | model, history = train_model(model, (train_images, train_labels), (val_images, val_labels))
94 |
95 | # Avaliar o modelo
96 | evaluate_model(model, (test_images, test_labels))
97 |
98 | # Salvar o modelo treinado
99 | save_model(model, save_path)
100 |
101 | # Plotar o histórico de treinamento
102 | plot_training_history(history)
103 |
104 | if __name__ == "__main__":
105 | main()
106 |
--------------------------------------------------------------------------------