This commit is contained in:
Yaojia Wang
2026-02-11 23:40:38 +01:00
parent f1a7bfe6b7
commit ad5ed46b4c
117 changed files with 5741 additions and 7669 deletions

View File

@@ -1,4 +1,4 @@
-e ../shared
ultralytics>=8.1.0
ultralytics>=8.4.0
tqdm>=4.65.0
torch>=2.0.0

View File

@@ -34,7 +34,7 @@ def execute_training_task(db: TrainingTaskDB, task: dict) -> None:
result = run_training(
epochs=config.get("epochs", 100),
batch=config.get("batch_size", 16),
model=config.get("base_model", "yolo11n.pt"),
model=config.get("base_model", "yolo26s.pt"),
imgsz=config.get("imgsz", 1280),
name=config.get("name", f"training_{task_id[:8]}"),
)

View File

@@ -28,8 +28,8 @@ def main():
)
parser.add_argument(
'--model', '-m',
default='yolov8s.pt',
help='Base model (default: yolov8s.pt)'
default='yolo26s.pt',
help='Base model (default: yolo26s.pt)'
)
parser.add_argument(
'--epochs', '-e',

View File

@@ -100,12 +100,11 @@ class AnnotationGenerator:
x0, y0, x1, y1 = best_match.bbox
x0, y0, x1, y1 = x0 * scale, y0 * scale, x1 * scale, y1 * scale
# Apply field-specific bbox expansion strategy
# Apply uniform bbox expansion
x0, y0, x1, y1 = expand_bbox(
bbox=(x0, y0, x1, y1),
image_width=image_width,
image_height=image_height,
field_type=class_name,
)
# Ensure minimum height
@@ -173,12 +172,11 @@ class AnnotationGenerator:
x0, y0, x1, y1 = payment_line_bbox
x0, y0, x1, y1 = x0 * scale, y0 * scale, x1 * scale, y1 * scale
# Apply field-specific bbox expansion strategy for payment_line
# Apply uniform bbox expansion
x0, y0, x1, y1 = expand_bbox(
bbox=(x0, y0, x1, y1),
image_width=image_width,
image_height=image_height,
field_type="payment_line",
)
# Convert to YOLO format (normalized center + size)

View File

@@ -585,15 +585,11 @@ class DBYOLODataset:
x1_px = x1_pdf * scale
y1_px = y1_pdf * scale
# Get class name for field-specific expansion
class_name = CLASS_NAMES[ann.class_id]
# Apply field-specific bbox expansion
# Apply uniform bbox expansion
x0, y0, x1, y1 = expand_bbox(
bbox=(x0_px, y0_px, x1_px, y1_px),
image_width=img_width,
image_height=img_height,
field_type=class_name,
)
# Ensure minimum height