MCPcopy Create free account
hub / github.com/SHAILAB-IPEC/OpenFly-Platform / check

Function check

tool_ws/src/ins_gen/process.py:139–157  ·  view source on GitHub ↗
(file_path)

Source from the content-addressed store, hash-verified

137
138
139def check(file_path):
140 # 检查并重命名 `pose.json` 为 `pose.jsonl`
141 pose_json_path = os.path.join(file_path, 'pose.json')
142 pose_jsonl_path = os.path.join(file_path, 'pose.jsonl')
143
144 if os.path.exists(pose_json_path):
145 os.rename(pose_json_path, pose_jsonl_path)
146
147 # 检查是否存在 `pose.jsonl`
148 if os.path.exists(pose_jsonl_path):
149 json_object = read_jsonl(pose_jsonl_path)
150
151 acts_len = len(json_object)
152 imgs_len = count_png_images(file_path) # 获取 PNG 图片数量
153
154 # 验证动作长度和图片数量的关系
155 return acts_len == imgs_len
156 else:
157 return False
158
159
160def process_act(actions):

Callers

nothing calls this directly

Calls 3

read_jsonlFunction · 0.85
count_png_imagesFunction · 0.85
existsMethod · 0.80

Tested by

no test coverage detected