MCPcopy Create free account
hub / github.com/ChunmingHe/WS-SAM / split_pred

Function split_pred

utils/cod10k_subclass_split.py:19–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18
19def split_pred():
20 src_root = ''
21 dst_root = ''
22
23 for img_name in os.listdir(src_root):
24 sub_class = img_name.split('-')[3]
25
26 src_img_path = os.path.join(src_root, img_name)
27 dst_img_path = os.path.join(dst_root, 'COD10K-' + sub_class, img_name)
28 os.makedirs(os.path.join(dst_root, 'COD10K-' + sub_class), exist_ok=True)
29
30 shutil.copyfile(src_img_path, dst_img_path)
31
32
33split_pred()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected