增加obb

This commit is contained in:
琉璃月光
2025-08-18 15:13:54 +08:00
parent 254afbbc43
commit 6e553f6a20
700 changed files with 576 additions and 1390 deletions

View File

@ -2,7 +2,7 @@
# YOLO11 Oriented Bounding Boxes (OBB) model with P3-P5 outputs. For Usage examples see https://docs.ultralytics.com/tasks/obb
# Parameters
nc: 80 # number of classes
nc: 1 # number of classes
scales: # model compound scaling constants, i.e. 'model=yolo11n-obb.yaml' will call yolo11-obb.yaml with scale 'n'
# [depth, width, max_channels]
n: [0.50, 0.25, 1024] # summary: 344 layers, 2695747 parameters, 2695731 gradients, 6.9 GFLOPs

View File

@ -455,24 +455,7 @@ def convert_dota_to_yolo_obb(dota_root_path: str):
# Class names to indices mapping
class_mapping = {
"plane": 0,
"ship": 1,
"storage-tank": 2,
"baseball-diamond": 3,
"tennis-court": 4,
"basketball-court": 5,
"ground-track-field": 6,
"harbor": 7,
"bridge": 8,
"large-vehicle": 9,
"small-vehicle": 10,
"helicopter": 11,
"roundabout": 12,
"soccer-ball-field": 13,
"swimming-pool": 14,
"container-crane": 15,
"airport": 16,
"helipad": 17,
"clamp": 0,
}
def convert_label(image_name, image_width, image_height, orig_label_dir, save_dir):
@ -504,7 +487,7 @@ def convert_dota_to_yolo_obb(dota_root_path: str):
image_paths = list(image_dir.iterdir())
for image_path in TQDM(image_paths, desc=f"Processing {phase} images"):
if image_path.suffix != ".png":
if image_path.suffix not in [".png" ,".jpg" , ".jpeg"]:
continue
image_name_without_ext = image_path.stem
img = cv2.imread(str(image_path))