raylim commited on
Commit
c5a7f83
Β·
1 Parent(s): f189242

run aeon/paladin

Browse files
Files changed (1) hide show
  1. app.py +22 -33
app.py CHANGED
@@ -25,39 +25,28 @@ def analyze_slide(slide_path, site_type):
25
  max_num_holes=2
26
  )
27
 
28
- # features, _ = get_features(coords, slide_path, attrs, model_type=ModelType.OPTIMUS, use_gpu=USE_GPU, batch_size=64, num_workers=NUM_WORKERS)
29
- #
30
- # # Step 3: Run Aeon to predict histology
31
- # aeon_results, _ = run_aeon(
32
- # β”‚ features=features,
33
- # β”‚ model_path="data/aeon_model.pkl",
34
- # β”‚ metastatic=(site_type == "Metastatic"),
35
- # β”‚ batch_size=8,
36
- # β”‚ num_workers=NM_WORKERS,
37
- # β”‚ use_cpu=not USE_GPU,
38
- # )
39
- #
40
- # # Step 4: Run Paladin to predict biomarkers
41
- # paladin_results = run_paladin(
42
- # β”‚ features=features,
43
- # β”‚ model_map_path="data/paladin_model_map.csv",
44
- # β”‚ aeon_results=aeon_results,
45
- # β”‚ metastatic=(site_type == "Metastatic"),
46
- # β”‚ batch_size=8,
47
- # β”‚ num_workers=NUM_WORKERS,
48
- # β”‚ use_cpu=not USE_GPU,
49
- # )
50
- # Dummy results for demonstration purposes
51
- # Replace these with actual model inference results
52
- aeon_results = pd.DataFrame({
53
- "Cancer Subtype": ["Subtype A", "Subtype B"],
54
- "Confidence": [0.95, 0.85]
55
- })
56
- paladin_results = pd.DataFrame({
57
- "Cancer Subtype": ["Subtype A", "Subtype A"],
58
- "Biomarker": ["Biomarker 1", "Biomarker 2"],
59
- "Score": [0.9, 0.8]
60
- })
61
 
62
  return aeon_results, paladin_results
63
 
 
25
  max_num_holes=2
26
  )
27
 
28
+ features, _ = get_features(coords, slide_path, attrs, model_type=ModelType.OPTIMUS, use_gpu=USE_GPU, batch_size=64, num_workers=NUM_WORKERS)
29
+
30
+ # Step 3: Run Aeon to predict histology
31
+ aeon_results, _ = run_aeon(
32
+ β”‚ features=features,
33
+ β”‚ model_path="data/aeon_model.pkl",
34
+ β”‚ metastatic=(site_type == "Metastatic"),
35
+ β”‚ batch_size=8,
36
+ β”‚ num_workers=NM_WORKERS,
37
+ β”‚ use_cpu=not USE_GPU,
38
+ )
39
+
40
+ # Step 4: Run Paladin to predict biomarkers
41
+ paladin_results = run_paladin(
42
+ β”‚ features=features,
43
+ β”‚ model_map_path="data/paladin_model_map.csv",
44
+ β”‚ aeon_results=aeon_results,
45
+ β”‚ metastatic=(site_type == "Metastatic"),
46
+ β”‚ batch_size=8,
47
+ β”‚ num_workers=NUM_WORKERS,
48
+ β”‚ use_cpu=not USE_GPU,
49
+ )
 
 
 
 
 
 
 
 
 
 
 
50
 
51
  return aeon_results, paladin_results
52