xsponenta commited on
Commit
3118106
·
1 Parent(s): 9cbefb9

Ensemble: disable redundant heavy features in classical pipeline

Browse files

The previous ensemble commit (9cbefb9) timed out because the classical
sklearn pipeline calls predict_wireframe_tracks via USE_TRACK_ENSEMBLE
and USE_TRACKS_AS_VERTICES — which is the same heavy DLT triangulation
already called by script.py's hybrid_merge. Doubling that step blows
the time budget.

Before calling predict_wireframe_sklearn, monkey-patch its module-level
flags to disable:
- USE_TRACK_ENSEMBLE (duplicate of hybrid_merge)
- USE_TRACKS_AS_VERTICES (duplicate of hybrid_merge)
- USE_WINNER_CANDIDATES (expensive iterative dilation)
- USE_LINE_EDGES (3D line clustering)

What we keep: per-view 2D semantic vertex detection, RANSAC affine
depth fit, 3D unprojection, multi-view merge, sklearn edge classifier.
This is the cheap-but-distinct signal — independent from anything the
learned pipeline produces. Flags are restored after the call.

Files changed (1) hide show
  1. script.py +27 -5
script.py CHANGED
@@ -468,12 +468,34 @@ if __name__ == "__main__":
468
  print(f" Track ensemble failed for {order_id}: {track_e_err}")
469
 
470
  # Pipeline ensemble: also run the classical sklearn pipeline
471
- # and union with the learned-pipeline output. Independent
472
- # error modes (semantic 2D detection + line cloud + sklearn
473
- # edge classifier) complement the learned 3D segment regression.
 
 
 
 
474
  try:
475
- from sklearn_submission import predict_wireframe_sklearn
476
- skl_v, skl_e = predict_wireframe_sklearn(sample)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
  if isinstance(pred_v, np.ndarray) and len(pred_v) >= 1 and \
478
  skl_v is not None and len(skl_v) >= 1:
479
  pred_v, pred_e = ensemble_merge(
 
468
  print(f" Track ensemble failed for {order_id}: {track_e_err}")
469
 
470
  # Pipeline ensemble: also run the classical sklearn pipeline
471
+ # but disable its heaviest features. predict_wireframe_tracks
472
+ # is already called above by hybrid_merge calling it again
473
+ # via USE_TRACK_ENSEMBLE/USE_TRACKS_AS_VERTICES doubles the
474
+ # slowest step and causes timeout. Winner candidates and line
475
+ # cloud are also expensive. We keep just the core classical
476
+ # signal: 2D semantic vertex detection + RANSAC depth fit +
477
+ # 3D unprojection + sklearn edge classifier.
478
  try:
479
+ import sklearn_submission as _skl
480
+ _saved_flags = (
481
+ _skl.USE_TRACK_ENSEMBLE,
482
+ _skl.USE_TRACKS_AS_VERTICES,
483
+ _skl.USE_WINNER_CANDIDATES,
484
+ _skl.USE_LINE_EDGES,
485
+ )
486
+ _skl.USE_TRACK_ENSEMBLE = False
487
+ _skl.USE_TRACKS_AS_VERTICES = False
488
+ _skl.USE_WINNER_CANDIDATES = False
489
+ _skl.USE_LINE_EDGES = False
490
+ try:
491
+ skl_v, skl_e = _skl.predict_wireframe_sklearn(sample)
492
+ finally:
493
+ (
494
+ _skl.USE_TRACK_ENSEMBLE,
495
+ _skl.USE_TRACKS_AS_VERTICES,
496
+ _skl.USE_WINNER_CANDIDATES,
497
+ _skl.USE_LINE_EDGES,
498
+ ) = _saved_flags
499
  if isinstance(pred_v, np.ndarray) and len(pred_v) >= 1 and \
500
  skl_v is not None and len(skl_v) >= 1:
501
  pred_v, pred_e = ensemble_merge(