---
title: InternVideo2-Stage2_6B
canonical_url: "https://www.modelscope.cn/models/Shanghai_AI_Laboratory/InternVideo2-Stage2_6B"
md_url: "https://www.modelscope.cn/models/Shanghai_AI_Laboratory/InternVideo2-Stage2_6B.md"
repository: Shanghai_AI_Laboratory/InternVideo2-Stage2_6B
last_updated: 2025-02-27
license: mit
architectures:
  - InternVideo2_Stage2
parameters: 6.4B
tensor_type:
  - F32
  - I64
library_name:
  - transformer
  - safetensors
  - pytorch
frameworks:
  - pytorch
downloads: 3012
stars: 0
---

# InternVideo2-Stage2_6B

> InternVideo2-Stage2_6B - Shanghai_AI_Laboratory 在 ModelScope 开源的模型。This repository contains the 6B model of the paper InternVideo2 in stage 2.

Shanghai_AI_Laboratory/InternVideo2-Stage2_6B 是 ModelScope 魔搭社区上的 6.4B 参数机器学习模型，采用 mit 许可。

- **Repository**: Shanghai_AI_Laboratory/InternVideo2-Stage2_6B
- **License**: mit
- **Parameters**: 6.4B
- **Downloads**: 3012
- **Stars**: 0
- **Last updated**: 2025-02-27

Source: https://www.modelscope.cn/models/Shanghai_AI_Laboratory/InternVideo2-Stage2_6B

---

## Introduction

This repository contains the 6B model of the paper [InternVideo2](https://arxiv.org/pdf/2403.15377) in stage 2.

Code: https://github.com/OpenGVLab/InternVideo/tree/main/InternVideo2/multi_modality

## 🚀 Installation

Please refer to https://github.com/OpenGVLab/InternVideo/blob/main/InternVideo2/multi_modality/INSTALL.md

## Usage

```python
import cv2
from transformers import AutoModel
from modeling_internvideo2 import (retrieve_text, vid2tensor, _frame_from_video,)


model = AutoModel.from_pretrained("OpenGVLab/InternVideo2-Stage2_6B", trust_remote_code=True).eval()

video = cv2.VideoCapture('example1.mp4')
frames = [x for x in _frame_from_video(video)]
text_candidates = ["A playful dog and its owner wrestle in the snowy yard, chasing each other with joyous abandon.",
                "A man in a gray coat walks through the snowy landscape, pulling a sleigh loaded with toys.",
                "A person dressed in a blue jacket shovels the snow-covered pavement outside their house.",
                "A cat excitedly runs through the yard, chasing a rabbit.",
                "A person bundled up in a blanket walks through the snowy landscape, enjoying the serene winter scenery."]

texts, probs = retrieve_text(frames, text_candidates, model=model, topk=5)
for t, p in zip(texts, probs):
    print(f'text: {t} ~ prob: {p:.4f}')

vidtensor = vid2tensor('example1.mp4', fnum=4)
feat = model.get_vid_feat(vidtensor)
```
