MCPcopy Create free account
hub / github.com/PABannier/sam3.cpp / load_cases

Function load_cases

tests/dump_phase6_reference.py:108–127  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

106
107
108def load_cases(path: str) -> List[PromptCase]:
109 cases: List[PromptCase] = []
110 with open(path, "r", encoding="utf-8") as f:
111 for line in f:
112 line = line.rstrip("\n")
113 if not line:
114 continue
115 fields = line.split("\t")
116 while len(fields) < 5:
117 fields.append("")
118 cases.append(
119 PromptCase(
120 case_id=fields[0],
121 multimask=fields[1] == "1",
122 pos_points=parse_points(fields[2]),
123 neg_points=parse_points(fields[3]),
124 box=parse_box(fields[4]),
125 )
126 )
127 return cases
128
129
130def build_point_inputs(case: PromptCase):

Callers 1

mainFunction · 0.70

Calls 3

PromptCaseClass · 0.85
parse_pointsFunction · 0.70
parse_boxFunction · 0.70

Tested by

no test coverage detected