| from evo_vlac import GAC_model |
| from evo_vlac.utils.video_tool import compress_video |
| import os |
| |
|
|
|
|
| |
| model_path="/home/vcj9002/jianshu/workspace/weight/VLAC" |
| |
|
|
| |
| test_video='evo_vlac/examples/videos/pick-bowl-test.mp4' |
| ref_video='evo_vlac/examples/videos/pick-bowl-ref.mov' |
| task_description='Put up the bowl and place it back in the white storage box.' |
|
|
| |
| Critic=GAC_model(tag='critic') |
| Critic.init_model(model_path=model_path,model_type='internvl2',device_map=f'cuda:6') |
| Critic.temperature=0.5 |
| Critic.top_k=1 |
| Critic.set_config() |
| Critic.set_system_prompt() |
|
|
| |
| test_video_compressed = os.path.join(os.path.dirname(test_video),"test.mp4") |
| _,output_fps=compress_video(test_video, test_video_compressed,fps=5) |
| reference_video_compressed = None |
| if ref_video: |
| reference_video_compressed = os.path.join(os.path.dirname(ref_video),"ref.mp4") |
| compress_video(ref_video, reference_video_compressed,fps=5) |
|
|
|
|
| |
| result_path,value_list,critic_list,done_list = Critic.web_trajectory_critic( |
| task_description=task_description, |
| main_video_path=test_video_compressed, |
| reference_video_path=reference_video_compressed, |
| batch_num=5, |
| ref_num=6, |
| think=False, |
| skip=5, |
| rich=False, |
| reverse_eval=False, |
| output_path="results", |
| fps=float(output_fps), |
| frame_skip=True, |
| done_flag=False, |
| in_context_done=False, |
| done_threshold=0.9, |
| video_output=True |
| ) |
|
|
|
|
| print("=" * 100) |
| print(">>>>>>>>>Critic results<<<<<<<<<<") |
| print(" ") |
|
|
| print(f"result path: {result_path}") |
| print(f"task description: {task_description}") |
| print("=" * 50) |
|
|
| print("value_list:") |
| print(value_list) |
| print("=" * 50) |
|
|
| print("critic_list:") |
| print(critic_list) |
| print("=" * 50) |
|
|
| print("done_list:") |
| print(done_list) |
| print("=" * 100) |