MCPcopy Create free account
hub / github.com/CandleLabAI/PCBSegClassNet / main

Function main

src/data/create_mask.py:131–162  ·  view source on GitHub ↗

main function which creates mask Args: source_image_dir: image directory containing input images source_annotation_dir: annotation directory containing csv annotations dest_images_dir: destination directory for storing images dest_masks_sir: destination direc

(source_image_dir,
         source_annotation_dir,
         dest_images_dir,
         dest_masks_sir,
         dest_crops_dir,
         model)

Source from the content-addressed store, hash-verified

129 pbar.update(1)
130
131def main(source_image_dir,
132 source_annotation_dir,
133 dest_images_dir,
134 dest_masks_sir,
135 dest_crops_dir,
136 model):
137 """
138 main function which creates mask
139 Args:
140 source_image_dir: image directory containing input images
141 source_annotation_dir: annotation directory containing csv annotations
142 dest_images_dir: destination directory for storing images
143 dest_masks_sir: destination directory for storing masks
144 dest_crops_dir: destinations directory for storing crops
145 model: super resolution model
146 """
147 # create directories if not exist
148 if not os.path.exists(dest_images_dir):
149 os.makedirs(dest_images_dir)
150
151 if not os.path.exists(dest_masks_sir):
152 os.makedirs(dest_masks_sir)
153
154 if not os.path.exists(dest_crops_dir):
155 os.makedirs(dest_crops_dir)
156
157 prepare_data(source_image_dir,
158 source_annotation_dir,
159 dest_images_dir,
160 dest_masks_sir,
161 dest_crops_dir,
162 model)
163
164if __name__ == "__main__":
165 parser = argparse.ArgumentParser(prog='PCBSegClassNet')

Callers 1

create_mask.pyFile · 0.70

Calls 1

prepare_dataFunction · 0.85

Tested by

no test coverage detected