MCPcopy Create free account
hub / github.com/OpenDCAI/DataFlow-MM / __init__

Method __init__

test/test_long_video_cotqa_generator.py:156–311  ·  view source on GitHub ↗

Initialize the long video cotqa pipeline with API models. Args: backend: Video backend for info extraction (opencv, torchvision, av) ext: Whether to filter non-existent files frame_skip: Frame skip for scene detection start_re

(
        self,
        # VideoInfoFilter parameters
        backend: str = "opencv",
        ext: bool = False,
        
        # VideoSceneFilter parameters
        frame_skip: int = 0,
        start_remove_sec: float = 0.0,
        end_remove_sec: float = 0.0,
        min_seconds: float = 2.0,
        max_seconds: float = 15.0,
        use_adaptive_detector: bool = False,
        overlap: bool = False,
        use_fixed_interval: bool = False,
        
        # API VLM parameters (for caption generation)
        vlm_api_url: str = "https://dashscope.aliyuncs.com/compatible-mode/v1",
        vlm_api_key_name: str = "DF_API_KEY",
        vlm_model_name: str = "qwen3-vl-8b-instruct",
        vlm_max_workers: int = 10,
        vlm_timeout: int = 1800,
        
        # API LLM parameters (for reasoning generation)
        llm_api_url: str = "https://dashscope.aliyuncs.com/compatible-mode/v1",
        llm_api_key_name: str = "DF_API_KEY",
        llm_model_name: str = "qwen-plus",
        llm_max_workers: int = 10,
        llm_timeout: int = 1800,
        
        # API LLM parameters (for reasoning reformatting)
        reformat_api_url: str = "https://openrouter.ai/api/v1",
        reformat_api_key_name: str = "OPENROUTER_API_KEY",
        reformat_model_name: str = "openai/gpt-4o",
        reformat_max_workers: int = 10,
        reformat_timeout: int = 1800,
        
        # VideoClipGenerator parameters
        video_save_dir: str = "./cache/video_clips",
    )

Source from the content-addressed store, hash-verified

154 """
155
156 def __init__(
157 self,
158 # VideoInfoFilter parameters
159 backend: str = "opencv",
160 ext: bool = False,
161
162 # VideoSceneFilter parameters
163 frame_skip: int = 0,
164 start_remove_sec: float = 0.0,
165 end_remove_sec: float = 0.0,
166 min_seconds: float = 2.0,
167 max_seconds: float = 15.0,
168 use_adaptive_detector: bool = False,
169 overlap: bool = False,
170 use_fixed_interval: bool = False,
171
172 # API VLM parameters (for caption generation)
173 vlm_api_url: str = "https://dashscope.aliyuncs.com/compatible-mode/v1",
174 vlm_api_key_name: str = "DF_API_KEY",
175 vlm_model_name: str = "qwen3-vl-8b-instruct",
176 vlm_max_workers: int = 10,
177 vlm_timeout: int = 1800,
178
179 # API LLM parameters (for reasoning generation)
180 llm_api_url: str = "https://dashscope.aliyuncs.com/compatible-mode/v1",
181 llm_api_key_name: str = "DF_API_KEY",
182 llm_model_name: str = "qwen-plus",
183 llm_max_workers: int = 10,
184 llm_timeout: int = 1800,
185
186 # API LLM parameters (for reasoning reformatting)
187 reformat_api_url: str = "https://openrouter.ai/api/v1",
188 reformat_api_key_name: str = "OPENROUTER_API_KEY",
189 reformat_model_name: str = "openai/gpt-4o",
190 reformat_max_workers: int = 10,
191 reformat_timeout: int = 1800,
192
193 # VideoClipGenerator parameters
194 video_save_dir: str = "./cache/video_clips",
195 ):
196 """
197 Initialize the long video cotqa pipeline with API models.
198
199 Args:
200 backend: Video backend for info extraction (opencv, torchvision, av)
201 ext: Whether to filter non-existent files
202 frame_skip: Frame skip for scene detection
203 start_remove_sec: Seconds to remove from start of each scene
204 end_remove_sec: Seconds to remove from end of each scene
205 min_seconds: Minimum scene duration
206 max_seconds: Maximum scene duration
207 use_adaptive_detector: Whether to use AdaptiveDetector in scene detection
208 overlap: If True, use overlap splitting strategy
209 use_fixed_interval: If True, use fixed interval splitting instead of scene detection
210 vlm_api_url: API URL for VLM service (caption generation)
211 vlm_api_key_name: Environment variable name for VLM API key
212 vlm_model_name: VLM model name for caption generation
213 vlm_max_workers: Max concurrent workers for VLM API

Callers

nothing calls this directly

Calls 11

get_loggerFunction · 0.90
VideoInfoFilterClass · 0.90
VideoSceneFilterClass · 0.90
VideoClipFilterClass · 0.90
VideoClipGeneratorClass · 0.90
DiyVideoPromptClass · 0.90

Tested by

no test coverage detected