File size: 877 Bytes
7df6a88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import time
import os
os.environ['KMP_DUPLICATE_LIB_OK'] = 'TRUE'
import numpy as np
from datasets import load_dataset
import sklearn_submission
from sklearn_submission import predict_wireframe_sklearn

sklearn_submission.USE_BUNDLE_ADJUST = True
sklearn_submission.ADD_ISOLATED_TRACK_VERTICES = True

print("Loading dataset...")
dataset = load_dataset('usm3d/hoho22k_2026_trainval', split='train', streaming=True, trust_remote_code=True)

# Process 5 samples and time them
times = []
for idx, sample in enumerate(dataset):
    if idx >= 5:
        break
    start = time.time()
    try:
        predict_wireframe_sklearn(sample)
    except Exception as e:
        print(f"Error on sample {idx}: {e}")
    elapsed = time.time() - start
    times.append(elapsed)
    print(f"Sample {idx}: {elapsed:.2f} seconds")

print(f"Average time per sample: {np.mean(times):.2f} seconds")