WIP
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
-e ../shared
|
||||
ultralytics>=8.1.0
|
||||
ultralytics>=8.4.0
|
||||
tqdm>=4.65.0
|
||||
torch>=2.0.0
|
||||
|
||||
@@ -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]}"),
|
||||
)
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user