satojkee / YOLOv8-obb-tester

YOLOv8 Oriented Bounding Boxes tester

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YOLOv8-obb test util

Dependency installation

pip3 install -r requirements.txt

Configuration

Be sure that setup.json file is in the project root or use --setup | -s option to provide it

root/
|-- examples/
|   |-- dice_1.jpg
|   |-- dice_2.jpg
|   |-- dice_3.jpg
|   |-- planes_1.jpg
|   |-- planes_2.jpg
|   |-- planes_3.jpg
|   |-- planes_4.jpg
|   |-- planes_5.jpg
|   |-- planes_6.jpg
|-- src/
|   |-- config.py
|   |-- tester.py
|-- main.py
|-- requirements.txt
|-- README.md
|-- setup.json
|-- .gitignore

{
  "predict": {
    // supports all params listed here [https://docs.ultralytics.com/usage/cfg/#predict-settings]
    "imgsz": 640,
    "augment": false,
    "save_conf": true,
    "verbose": true,
    "iou": 0.9,
    "conf": 0.5
  },
  "visual": {
    // label configuration
    "label": {
      "thickness": 2, // text thickness
      "fontScale": 0.7, // font scale 
      "color": [255, 255, 255] // font color (BGR)
    },
    // object bounding box configuration
    "bbox": {
      "thickness": 3, // line thickness
      "color": [0, 255, 0] // fill color (BGR)
    },
    // label bounding box configuration (applies a contrast bg behind the label)
    "lbox": {
      "color": [255, 0, 0], // fill color (BGR)
      "thickness": -1 // line thickness (use recommended '-1' value)
    }
  },
  "storage": {
    "model": "YOUR_MODEL.pt",
    "assets": "YOUR_ASSETS_DIR",
    "output": "YOUR_OUTPUT_DIR"
  }
}

Usage

python main.py

or (if store that file somewhere else)

python main.py --setup="path/your_setup.json"

Examples of yolov8m-obb.pt

planes_1 planes_2 planes_3

Examples of dice-recognition.pt

Note: it's a custom trained model based on yolov8m-obb.pt
Oriented Bounding Boxes are inaccurate somewhere due to the small dataset used for training

dice_1 dice_2 dice_3

About

YOLOv8 Oriented Bounding Boxes tester

License:GNU Affero General Public License v3.0


Languages

Language:Python 100.0%