MCPcopy Index your code
hub / github.com/CandleLabAI/PCBSegClassNet / get_paths

Function get_paths

src/data/dataloader.py:70–92  ·  view source on GitHub ↗
(opt)

Source from the content-addressed store, hash-verified

68
69
70def get_paths(opt):
71 if opt["type"] == "Segmentation":
72 images = sorted(
73 [
74 os.path.join(opt["data_images"], img)
75 for img in os.listdir(opt["data_images"])
76 ]
77 )
78 masks = sorted(
79 [
80 os.path.join(opt["data_masks"], msk)
81 for msk in os.listdir(opt["data_masks"])
82 ]
83 )
84 return images, masks
85 elif opt["type"] == "Classification":
86 images = glob(os.path.join(opt["data_images"], "*/*"))
87 labels = [class_mapping[str(lbl.split(os.path.sep)[-2])] for lbl in images]
88 return images, labels
89 else:
90 assert (
91 False
92 ), f"Found data type as {opt['type']} but it should be one of Segmentation/Classification"
93
94
95class LoadSegData:

Callers 1

get_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected