Improve model card: Add pipeline tag, library name, and comprehensive links and usage instructions

#1
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +94 -3
README.md CHANGED
@@ -1,3 +1,94 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ pipeline_tag: video-text-to-text
4
+ library_name: transformers
5
+ ---
6
+
7
+ # PhyDetEx: Detecting and Explaining the Physical Plausibility of T2V Models
8
+
9
+ This repository contains the PhyDetEx model, designed for detecting and explaining physically implausible content in videos generated by Text-to-Video (T2V) models. PhyDetEx introduces a lightweight fine-tuning approach, enabling Vision-Language Models (VLMs) to not only detect physically implausible events but also generate textual explanations on the violated physical principles.
10
+
11
+ This work was presented in the paper:
12
+ [PhyDetEx: Detecting and Explaining the Physical Plausibility of T2V Models](https://huggingface.co/papers/2512.01843)
13
+
14
+ - πŸ“– **Paper**: [PhyDetEx: Detecting and Explaining the Physical Plausibility of T2V Models](https://huggingface.co/papers/2512.01843)
15
+ - πŸ’» **Code**: [https://github.com/Zeqing-Wang/PhyDetEx](https://github.com/Zeqing-Wang/PhyDetEx)
16
+ - πŸ€— **PID Dataset**: [https://huggingface.co/datasets/NNaptmn/PhyDetExDatasets](https://huggingface.co/datasets/NNaptmn/PhyDetExDatasets)
17
+
18
+ <img src="https://github.com/Zeqing-Wang/PhyDetEx/raw/main/assets/overall_figs.png" width="100%" alt="Overall Figure" />
19
+
20
+ ## πŸ”₯ News
21
+ - **[2025.12.01]** πŸ”₯ We release the PID Dataset and the PhyDetEx Model!
22
+
23
+ ## Introduction
24
+
25
+ PhyDetEx is a model designed for detecting physical implausible content. Additionally, to better address and test physical implausible content detection, we provide the PID Physical Implausibility Detection dataset.
26
+
27
+ ## πŸ”§ How to Start
28
+
29
+ ### Download the PID Test split
30
+
31
+ Download `PID_Test_split.zip` from [πŸ€— PID Dataset](https://huggingface.co/datasets/NNaptmn/PhyDetExDatasets), place it in the `Data/PID_test` directory, and organize it as follows:
32
+ PID_test/
33
+ pos/
34
+ video_xxx.mp4
35
+ ......
36
+ neg/
37
+ video_xxx.mp4
38
+ ......
39
+ anno_file.json
40
+ ```
41
+
42
+ ### Download the PhyDetEx
43
+
44
+ Download PhyDetEx from [πŸ€— PhyDetEx Model](https://huggingface.co/NNaptmn/PhyDetEx).
45
+
46
+ ### Prepare the Environment
47
+
48
+ ```bash
49
+ pip install -r requirements.txt
50
+ ```
51
+
52
+ Please note that the version of transformers may affect specific metrics, so it is recommended to use the version specified in requirements.txt.
53
+
54
+ ### Set variables
55
+ In benchmark_on_pid_test_split.py, set the corresponding path for PhyDetEx, then run:
56
+ ```
57
+ python benchmark_on_pid_test_split.py
58
+ ```
59
+ The resulting ./res/res_on_pid_test.json will contain the F1 Score, Acc Plausible, and Acc Implausible.
60
+
61
+ ### Get the reasoning score
62
+ Deploy any LLM using [lmdeploy](https://github.com/InternLM/lmdeploy). In the paper, we report results using LLaMa3 8B.
63
+
64
+ In infer_llm_score_for_pid_test_lmdeploy.py, set the corresponding port and evaluation file path, then run:
65
+
66
+ ```
67
+ python infer_llm_score_for_pid_test_lmdeploy.py
68
+ ```
69
+
70
+ ### πŸ§ͺ Test on ImpossibleVideos
71
+
72
+ You can download and process the Physical Law-related data from [Impossible-Videos](https://github.com/showlab/Impossible-Videos). Alternatively, we recommend directly downloading our preprocessed data: [πŸ€— PID Dataset](https://huggingface.co/datasets/NNaptmn/PhyDetExDatasets) "ImpossibleVideos_Physical_Law_Only.zip", and placing it in `Data/PID_test`. The remaining steps are the same as for the PID Test.
73
+
74
+ Please note that the scripts for running ImpossibleVideos are `benchmark_on_impossible_videos.py` and `infer_llm_score_for_impossible_video_lmdeploy.py`.
75
+
76
+ ## πŸ”§ Train the PhyDetEx
77
+
78
+ In the [πŸ€— PID Dataset](https://huggingface.co/datasets/NNaptmn/PhyDetExDatasets), we also provide the PID Train Split. For training PhyDetEx, we use [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory).
79
+
80
+ ## Acknowledgement
81
+ We heavily borrow the data and code from ImpossibleVideos, and LLaMA-Factory. Thanks for sharing their code.
82
+
83
+ ## πŸ“Œ Citation
84
+
85
+ If you find the code useful for your work, please star this repo and consider citing:
86
+
87
+ ```bibtex
88
+ @article{wang2025phydetex,
89
+ title={PhyDetEx: Detecting and Explaining the Physical Plausibility of T2V Models},
90
+ author={},
91
+ journal={arXiv preprint arXiv:2512.01843},
92
+ year={2025}
93
+ }
94
+ ```