This commit is contained in:
jackhanyuan
2022-03-13 15:23:56 +08:00
committed by Junhao Liang
parent 9ae1194163
commit 9c1aed2c87
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -105,7 +105,7 @@ def pretreat(input_path: Path, output_path: Path, img_size: int = 64, workers: i
for img_path in input_path.rglob('*.png'):
if verbose:
logging.debug(f'Adding {img_path}')
*_, sid, seq, view, _ = img_path.as_posix().split(os.sep)
*_, sid, seq, view, _ = img_path.as_posix().split('/')
img_groups[(sid, seq, view)].append(img_path)
total_files += 1
@@ -138,4 +138,4 @@ if __name__ == '__main__':
for k, v in args.__dict__.items():
logging.debug(f'{k}: {v}')
pretreat(input_path=Path(args.root_path), output_path=Path(args.output_path), img_size=args.img_size, workers=args.n_workers, verbose=args.verbose)
pretreat(input_path=Path(args.input_path), output_path=Path(args.output_path), img_size=args.img_size, workers=args.n_workers, verbose=args.verbose)
+3 -1
View File
@@ -42,4 +42,6 @@ if __name__ == '__main__':
args = parser.parse_args()
rearrange(Path(args.input_path), Path(args.output_path))
input_path = Path(args.input_path).resolve()
output_path = Path(args.output_path).resolve()
rearrange(input_path, output_path)