Views
No views yet
ReVIOSa using transformers.1import torch
2from transformers import AutoTokenizer, AutoModel
3from PIL import Image
4import numpy as np
5import os
6
7# load the model and tokenizer
8path = "wooj0216/ReVIOSa-4B"
9model = AutoModel.from_pretrained(
10 path,
11 torch_dtype=torch.bfloat16,
12 low_cpu_mem_usage=True,
13 use_flash_attn=True,
14 trust_remote_code=True).eval().cuda()
15tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True, use_fast=False)
16
17video_folder = "/PATH/TO/VIDEO_FOLDER"
18images_paths = os.listdir(video_folder)
19images_paths = [os.path.join(video_folder, image_path) for image_name in images_paths]
20text_prompts = "<image>Please segment the child reaching out to man."
21input_dict = {
22 'video': images_paths,
23 'text': text_prompts,
24 'past_text': '',
25 'mask_prompts': None,
26 'tokenizer': tokenizer,
27}
28return_dict = model.predict_forward(**input_dict)
29answer = return_dict["prediction"]
30masks = return_dict['prediction_masks']@misc{jin2025interrvosinteractionawarereferringvideo,
title={InterRVOS: Interaction-aware Referring Video Object Segmentation},
author={Woojeong Jin and Seongchan Kim and Jaeho Lee and Seungryong Kim},
year={2025},
eprint={2506.02356},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2506.02356},
}