File size: 1,751 Bytes
dc80a97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python3
"""
检查MiniGPT4-Video依赖安装状态
"""

import sys
import importlib

# 必需的包列表
REQUIRED_PACKAGES = [
    'torch',
    'torchvision', 
    'transformers',
    'gradio',
    'opencv-cv2',  # opencv-python-headless
    'moviepy',
    'webvtt',
    'pytubefix', 
    'omegaconf',
    'timm',
    'webdataset',
    'sentence_transformers',
    'sklearn',  # scikit-learn
    'skimage',  # scikit-image
    'decord',
    'peft',
    'bitsandbytes',
    'whisper',  # openai-whisper
    'numpy',
    'soundfile',
    'accelerate',
    'PIL',  # Pillow
    'requests'
]

def check_package(package_name):
    """检查单个包是否安装"""
    try:
        importlib.import_module(package_name)
        return True, "✅"
    except ImportError as e:
        return False, f"❌ {str(e)}"

def main():
    print("🔍 检查MiniGPT4-Video依赖安装状态...\n")
    
    missing_packages = []
    
    for package in REQUIRED_PACKAGES:
        success, status = check_package(package)
        print(f"{status} {package}")
        
        if not success:
            missing_packages.append(package)
    
    print(f"\n📊 检查结果:")
    print(f"✅ 已安装: {len(REQUIRED_PACKAGES) - len(missing_packages)}/{len(REQUIRED_PACKAGES)}")
    print(f"❌ 缺失: {len(missing_packages)}")
    
    if missing_packages:
        print(f"\n🔧 缺失的包:")
        for pkg in missing_packages:
            print(f"  - {pkg}")
        print(f"\n💡 修复建议:")
        print(f"pip install -r requirements.txt")
        return False
    else:
        print(f"\n🎉 所有依赖都已正确安装!")
        return True

if __name__ == "__main__":
    success = main()
    sys.exit(0 if success else 1)