Spaces:
Running
Running
| """ | |
| Quick start: Score a single video edit with VEFX-Reward. | |
| Usage: | |
| python examples/quick_start.py \ | |
| --original path/to/original.mp4 \ | |
| --edited path/to/edited.mp4 \ | |
| --instruction "add a hat to the person" | |
| """ | |
| import argparse | |
| import torch | |
| from vefx_reward import VEFXReward | |
| def main(): | |
| parser = argparse.ArgumentParser(description="Score a video edit with VEFX-Reward") | |
| parser.add_argument("--original", required=True, help="Path to original video") | |
| parser.add_argument("--edited", required=True, help="Path to edited video") | |
| parser.add_argument("--instruction", required=True, help="Editing instruction") | |
| parser.add_argument("--model", default="VEFX-Reward/VEFX-Reward-4B", help="Model path or HF ID") | |
| parser.add_argument("--device", default="cuda", help="Device (cuda / cpu)") | |
| args = parser.parse_args() | |
| model = VEFXReward(args.model, device=args.device) | |
| scores = model.score(args.original, args.edited, args.instruction) | |
| print("\n" + "=" * 50) | |
| print("VEFX-Reward Scores") | |
| print("=" * 50) | |
| print(f" Instructional Following (IF): {scores['IF']:.2f}") | |
| print(f" Render Quality (RQ): {scores['RQ']:.2f}") | |
| print(f" Edit Exclusivity (EE): {scores['EE']:.2f}") | |
| print(f" Overall : {scores['Overall']:.2f}") | |
| print("=" * 50) | |
| if __name__ == "__main__": | |
| main() | |