import os
import shutil
import json

# 读取json文件
seq="06"
with open(seq+".json", 'r') as json_file:
    file_names = json.load(json_file)

source_folder = "voxformer/sequences/"+seq+"/predictions/"
target_folder = "voxformer_tg/sequences/"+seq+"/predictions/"


os.makedirs(target_folder, exist_ok=True)


for idx, file_name in enumerate(file_names):
# for file_name in file_names:
    print(idx, len(file_names))
    source_file = os.path.join(source_folder, f"{file_name}.npy") 
    target_file = os.path.join(target_folder, f"{file_name}.npy")
    if os.path.exists(source_file):
        shutil.move(source_file, target_file)


