KuangshiAi commited on
Commit ·
967a3ab
1
Parent(s): eee57cc
modify cases from Guoxi
Browse files
.DS_Store
CHANGED
|
Binary files a/.DS_Store and b/.DS_Store differ
|
|
|
eval_cases/topology/topology_cases.yaml
CHANGED
|
@@ -231,11 +231,11 @@
|
|
| 231 |
assert:
|
| 232 |
- type: rule_based
|
| 233 |
eval_script: molecule/GS/molecule_eval.py
|
| 234 |
-
eval_function:
|
| 235 |
gs_file:
|
| 236 |
-
- molecule/GS/molecule_gs.
|
| 237 |
rs_file:
|
| 238 |
-
- molecule/results/{agent_mode}/molecule.
|
| 239 |
|
| 240 |
|
| 241 |
# 8. moons
|
|
@@ -253,9 +253,9 @@
|
|
| 253 |
eval_script: moons/GS/moons_eval.py
|
| 254 |
eval_function: evaluateMoonAscendingManifold
|
| 255 |
gs_file:
|
| 256 |
-
- moons/GS/moons_gs.
|
| 257 |
rs_file:
|
| 258 |
-
- moons/results/{agent_mode}/moons.
|
| 259 |
|
| 260 |
|
| 261 |
# 9. dragon
|
|
@@ -276,19 +276,6 @@
|
|
| 276 |
* 2 for 2-saddles
|
| 277 |
* 3 for maxima
|
| 278 |
- The point coordinates should be in world coordinates
|
| 279 |
-
|
| 280 |
-
5. Analyze the visualization and answer the following questions:
|
| 281 |
-
|
| 282 |
-
Q1: How many saddle-maximum pairs are present in the dataset?
|
| 283 |
-
(A) 2 (B) 4 (C) 6 (D) 10.
|
| 284 |
-
|
| 285 |
-
Q2: How many minima are computed?
|
| 286 |
-
(A) 2 (B) 5 (C) 8 (D) 10.
|
| 287 |
-
|
| 288 |
-
Q3: Are there any saddle-saddle pairs in the persistence diagram?
|
| 289 |
-
(Yes/No)
|
| 290 |
-
|
| 291 |
-
Save the answers to the analysis questions in plain text as "dragon/results/{agent_mode}/answers.txt".
|
| 292 |
assert:
|
| 293 |
- type: rule_based
|
| 294 |
eval_script: dragon/GS/dragon_eval.py
|
|
@@ -296,12 +283,4 @@
|
|
| 296 |
gs_file:
|
| 297 |
- dragon/GS/dragon_gs.vtk
|
| 298 |
rs_file:
|
| 299 |
-
- dragon/results/{agent_mode}/dragon.vtk
|
| 300 |
-
- type: llm-rubric
|
| 301 |
-
subtype: text
|
| 302 |
-
value: |
|
| 303 |
-
1. Q1 correct answer: (C) 6
|
| 304 |
-
|
| 305 |
-
2. Q2 correct answer: (B) 5
|
| 306 |
-
|
| 307 |
-
3. Q3 correct answer: No
|
|
|
|
| 231 |
assert:
|
| 232 |
- type: rule_based
|
| 233 |
eval_script: molecule/GS/molecule_eval.py
|
| 234 |
+
eval_function: evaluateMoleculeSegmentation
|
| 235 |
gs_file:
|
| 236 |
+
- molecule/GS/molecule_gs.vti
|
| 237 |
rs_file:
|
| 238 |
+
- molecule/results/{agent_mode}/molecule.vti
|
| 239 |
|
| 240 |
|
| 241 |
# 8. moons
|
|
|
|
| 253 |
eval_script: moons/GS/moons_eval.py
|
| 254 |
eval_function: evaluateMoonAscendingManifold
|
| 255 |
gs_file:
|
| 256 |
+
- moons/GS/moons_gs.vti
|
| 257 |
rs_file:
|
| 258 |
+
- moons/results/{agent_mode}/moons.vti
|
| 259 |
|
| 260 |
|
| 261 |
# 9. dragon
|
|
|
|
| 276 |
* 2 for 2-saddles
|
| 277 |
* 3 for maxima
|
| 278 |
- The point coordinates should be in world coordinates
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 279 |
assert:
|
| 280 |
- type: rule_based
|
| 281 |
eval_script: dragon/GS/dragon_eval.py
|
|
|
|
| 283 |
gs_file:
|
| 284 |
- dragon/GS/dragon_gs.vtk
|
| 285 |
rs_file:
|
| 286 |
+
- dragon/results/{agent_mode}/dragon.vtk
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
topology/dragon/task_description.txt
CHANGED
|
@@ -11,17 +11,4 @@
|
|
| 11 |
* 1 for 1-saddles
|
| 12 |
* 2 for 2-saddles
|
| 13 |
* 3 for maxima
|
| 14 |
-
- The point coordinates should be in world coordinates
|
| 15 |
-
|
| 16 |
-
5. Analyze the visualization and answer the following questions:
|
| 17 |
-
|
| 18 |
-
Q1: How many saddle-maximum pairs are present in the dataset?
|
| 19 |
-
(A) 2 (B) 4 (C) 6 (D) 10.
|
| 20 |
-
|
| 21 |
-
Q2: How many minima are computed?
|
| 22 |
-
(A) 2 (B) 5 (C) 8 (D) 10.
|
| 23 |
-
|
| 24 |
-
Q3: Are there any saddle-saddle pairs in the persistence diagram?
|
| 25 |
-
(Yes/No)
|
| 26 |
-
|
| 27 |
-
Save the answers to the analysis questions in plain text as "dragon/results/{agent_mode}/answers.txt".
|
|
|
|
| 11 |
* 1 for 1-saddles
|
| 12 |
* 2 for 2-saddles
|
| 13 |
* 3 for maxima
|
| 14 |
+
- The point coordinates should be in world coordinates
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
topology/molecule/GS/molecule_eval.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import sys
|
| 3 |
+
|
| 4 |
+
# Add the topology directory to Python path
|
| 5 |
+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
|
| 6 |
+
|
| 7 |
+
from topologyScoring import partitionTopologicalDiceScore
|
| 8 |
+
|
| 9 |
+
def evaluateMoleculeSegmentation(gtFilename : str, reconFilename : str, verbose : bool = False) -> int:
|
| 10 |
+
"""
|
| 11 |
+
Given two Morse-Smale segmentations of the same domain, return a similarity score from 0-10.
|
| 12 |
+
A score of 0 is considered bad and a score of 10 is considered good. The segmentations should be
|
| 13 |
+
represented by a point array called "Segmentation" that assigs a region identifier to each point in
|
| 14 |
+
the domain. The region identifiers between the ground truth and reconstructed files do not need to match.
|
| 15 |
+
Args:
|
| 16 |
+
gtFilename: The name of a file storing VTK image data (.vti) storing the ground truth MS segmentation.
|
| 17 |
+
each point's region ID should be stored in a point array called "Segmentation".
|
| 18 |
+
reconFilename: The name of a file storing VTK image data (.vti) storing the reconstructed MS segmentation.
|
| 19 |
+
verbose: Should error messages be printed if there are issues with the input files.
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
+
return partitionTopologicalDiceScore(gtFilename, "Segmentation", reconFilename, "Segmentation", verbose)
|
| 23 |
+
|
| 24 |
+
if __name__ == "__main__":
|
| 25 |
+
|
| 26 |
+
if len(sys.argv) != 3:
|
| 27 |
+
print(f"{os.path.basename(__file__)}: usage is 'python3 {os.path.basename(__file__)} gt_filename.vti recon_filename.vti")
|
| 28 |
+
exit(1)
|
| 29 |
+
|
| 30 |
+
score = evaluateMoleculeSegmentation(sys.argv[1], sys.argv[2], verbose=True)
|
| 31 |
+
|
| 32 |
+
print(f"This MS segmentation scored: {score}")
|