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

Function load_tensor

tests/dump_phase5_reference.py:195–198  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

193 print("Loading pre-computed neck features from tests/ref/")
194 # Load neck features
195 def load_tensor(path):
196 shape = list(map(int, open(path + ".shape").read().strip().split(",")))
197 data = np.fromfile(path + ".bin", dtype=np.float32).reshape(shape)
198 return torch.tensor(data)
199
200 # Neck det features: [1, 256, H, H] for scale 2 (72x72)
201 neck_det_2 = load_tensor(os.path.join(ref_dir, "neck_det_2")) # [1, 256, 72, 72]

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected