You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AutoDetect — an AutoML framework for object detection that automatically trains ensemble YOLO models, optimizes hyperparameters with Optuna, and fuses predictions using Weighted Box Fusion (WBF) for state-of-the-art results.
fromautodetectimportAutoDetectad=AutoDetect(
train="path/to/train", # Path to train folderval="path/to/val", # Path to val foldermodel='x', # Model size modifier: 'n', 's', 'm', 'l', 'x'epochs=30, # Number of training epochsmodel_config=( # Ensemble: (model_type, img_size)
('yolov8', 1024),
('yolo11', 960),
('yolo12', 768),
),
device=None, # 'cpu', 0 or [0, 1] - two GPUwarmup=False, # Enable RandomSearch to find best params YOLOinference_speed=-1, # Target FPS for model selection (-1 = best accuracy)seed=42# Random seed for reproducibility
)
ad.fit() # Start training and ensemble building
Inference: ADPredict
fromautodetectimportADPredictpredictor=ADPredict(
image_paths=test_images, # test dir (images in test dir)val_images_path=val_data, # Validation images for Optuna tuningmodels_dir="result", # Directory with trained models default="result"output_dir="predictions", # Where to save resultsdevice='auto', # 0, 'cpu', or 'auto'seed=42,
deterministic=False, # Enable deterministic algorithmsoptuna_trials=30, # Number of Optuna hyperparameter trialsval_samples=200, # Subset of val images for tuningwbf_conf_type="avg", # WBF confidence: 'avg' or 'max'conf_range=(0.005, 0.5), # Search range for confidence thresholdiou_range=(0.3, 0.7), # Search range for IoU thresholdskip_box_range=(0.001, 0.05), # Search range for box filteringmodel_weights=None# Optional: custom model weights example [0.9, 0.8, 1.3] for 3 models
)
# Run predictionresults=predictor.predict()
Output Format
Predictions are saved in output_dir/ (default: "predictions") as <image_name>.txt files.
File Format
Each line represents one detected object in space-separated format: