Skip to content

hbb2obb-analyze

Breaks an evaluation down by orientation, size, frame edge, difficulty and class. Guide: Analyze an evaluation.

usage: hbb2obb-analyze [-h] [--version] [--hbb_dir HBB_DIR] [--img_source IMG_SOURCE]
                       [--map_path MAP_PATH]
                       [--excluded_classes EXCLUDED_CLASSES [EXCLUDED_CLASSES ...]]
                       [--boundary_classes BOUNDARY_CLASSES [BOUNDARY_CLASSES ...]]
                       [--iou_threshold IOU_THRESHOLD] [--class_agnostic] [--out_dir OUT_DIR]
                       [--no_bar]
                       gt_dir pred_dir

Break down OBB conversion accuracy by ground-truth orientation, size, edge, difficulty and class, against the horizontal prompt as a baseline

positional arguments:
  gt_dir                Directory containing ground truth OBB annotations
  pred_dir              Directory containing predicted/converted OBB annotations

options:
  -h, --help            show this help message and exit
  --version, -V         show program's version number and exit
  --hbb_dir HBB_DIR, -hd HBB_DIR
                        Directory of the HBB prompts, to score the conversion against emitting
                        them unchanged (default: gt_dir/../labels_hbb, if it exists)
  --img_source IMG_SOURCE, -i IMG_SOURCE
                        Image or directory of images, for the frame-edge cut and for relative HBB
                        coordinates
  --map_path MAP_PATH, -mp MAP_PATH
                        Path to label map YAML file (optional)
  --excluded_classes EXCLUDED_CLASSES [EXCLUDED_CLASSES ...], -e EXCLUDED_CLASSES [EXCLUDED_CLASSES ...]
                        Class IDs to exclude
  --boundary_classes BOUNDARY_CLASSES [BOUNDARY_CLASSES ...], -bc BOUNDARY_CLASSES [BOUNDARY_CLASSES ...]
                        Class IDs the side-ratio table is restricted to (default: all)
  --iou_threshold IOU_THRESHOLD, -t IOU_THRESHOLD
                        IoU threshold for considering a match (default: 0.1)
  --class_agnostic, -ca
                        Match boxes regardless of class labels
  --out_dir OUT_DIR, -o OUT_DIR
                        Write analysis.md, analysis.yaml and analysis.png here as well as printing
                        the report
  --no_bar, -nb         Disable tqdm progress bar display

The hbb2obb toolkit ships seven commands:
  hbb2obb           convert HBB annotations to OBBs by prompting SAM
  hbb2obb-detect    detect HBBs with an Ultralytics model, for images that have none
  hbb2obb-convert   convert annotations between YOLO, DOTA, Pascal VOC, COCO and LabelMe
  hbb2obb-view      inspect HBB and OBB annotations over their images, interactively
  hbb2obb-eval      score predicted OBBs against ground truth (IoU, orientation error, per class)
  hbb2obb-analyze   break that score down by orientation, size, edge, difficulty and class
  hbb2obb-optimize  search hyperparameters, as one sweep or a whole benchmark

Run any of them with --help for its own options, e.g. hbb2obb-detect --help.