Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@
- [2024/10/15] 🔥 Video-XL is released, including model, training and evaluation code.

## Model weights
Please download our pre-trained and finetuned model weights from the [link](https://huggingface.co/sy1998/Video_XL/tree/main)

Please download our pre-trained and finetuned model weights from the [link](https://huggingface.co/sy1998/Video_XL/tree/main), and modify the model path in the demo code.
```bash
git lfs install
git clone https://huggingface.co/sy1998/Video_XL
git clone https://huggingface.co/openai/clip-vit-large-patch14-336
```


## Installation
```bash
conda create -n videoxl python=3.10 -y && conda activate videoxl
Expand Down
5 changes: 3 additions & 2 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
# fix seed
torch.manual_seed(0)


# Please change the following paths to your own paths
model_path = "/share/junjie/shuyan/VideoXL_weight_8"
clip_path = "/share/junjie/shuyan/clip-vit-large-patch14-336"
video_path="/share/junjie/shuyan/test_demo/ad2_watch_15min.mp4"

max_frames_num =900 # you can change this to several thousands so long you GPU memory can handle it :)
gen_kwargs = {"do_sample": True, "temperature": 1, "top_p": None, "num_beams": 1, "use_cache": True, "max_new_tokens": 1024}
tokenizer, model, image_processor, _ = load_pretrained_model(model_path, None, "llava_qwen", device_map="cuda:0")
tokenizer, model, image_processor, _ = load_pretrained_model(model_path, None, "llava_qwen", device_map="cuda:0", mm_vision_tower=clip_path)

model.config.beacon_ratio=[8] # you can delete this line to realize random compression of {2,4,8} ratio

Expand Down