File size: 770 Bytes
a5c5b03 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import os
class PathConverter():
def __init__(self):
self.prefixs = {
"vid": "/video/",
"gt": "/gt_imgs/",
"head": "/head_imgs/",
"torso": "/torso_imgs/",
"person": "/person_imgs/",
"torso_with_bg": "/torso_with_bg_imgs/",
"single_bg": "/bg_img/",
"bg": "/bg_imgs/",
"segmaps": "/segmaps/",
"inpaint_torso": "/inpaint_torso_imgs/",
"com": "/com_imgs/",
"inpaint_torso_with_com_bg": "/inpaint_torso_with_com_bg_imgs/",
}
def to(self, path: str, old_pattern: str, new_pattern: str):
return path.replace(self.prefixs[old_pattern], self.prefixs[new_pattern], 1)
pc = PathConverter() |