MCPcopy Create free account
hub / github.com/QWTforGithub/T2LDM / build_semantic_weights

Function build_semantic_weights

utils/common.py:342–350  ·  view source on GitHub ↗
(
    labels,
    road_ids = [10, 11],
    weights = [0.2, 0.8],
)

Source from the content-addressed store, hash-verified

340 return weight
341
342def build_semantic_weights(
343 labels,
344 road_ids = [10, 11],
345 weights = [0.2, 0.8],
346):
347 mask = torch.isin(labels, torch.tensor(road_ids, device=labels.device))
348 weights = torch.where(mask, weights[1], weights[0])
349
350 return weights
351
352def remove_empty_dirs(
353 root: str | Path, *,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected