Repository navigation
Expand file tree
/
Copy pathtest_docker_dependencies.py
More file actions
executable file
·94 lines (81 loc) · 2.91 KB
/
Copy pathtest_docker_dependencies.py
File metadata and controls
executable file
·94 lines (81 loc) · 2.91 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env python3
"""
Test script to verify Docker dependencies are properly installed.
This can be run inside the Docker container to check if everything is set up correctly.
"""
import sys
import subprocess
def test_dependencies():
"""Test that all required dependencies are available."""
print("🔍 Testing HY-Motion Docker Dependencies")
print("=" * 50)
# Test basic Python packages
basic_packages = [
('numpy', 'import numpy'),
('scipy', 'import scipy'),
('torch', 'import torch'),
('gradio', 'import gradio'),
('huggingface_hub', 'import huggingface_hub'),
('PyYAML', 'import yaml'),
]
print("\n📦 Testing Basic Packages:")
all_ok = True
for name, import_stmt in basic_packages:
try:
exec(import_stmt)
print(f"✅ {name}")
except ImportError as e:
print(f"❌ {name}: {e}")
all_ok = False
# Test HY-Motion specific imports
print("\n🔧 Testing HY-Motion Modules:")
hymotion_modules = [
('T2MRuntime', 'from hymotion.utils.t2m_runtime import T2MRuntime'),
('MotionFlowMatching', 'from hymotion.pipeline.motion_diffusion import MotionFlowMatching'),
('visualize_mesh_web', 'from hymotion.utils.visualize_mesh_web import generate_static_html_content'),
]
for name, import_stmt in hymotion_modules:
try:
exec(import_stmt)
print(f"✅ {name}")
except ImportError as e:
print(f"❌ {name}: {e}")
all_ok = False
# Test CUDA availability
print("\n💻 Testing CUDA Availability:")
try:
import torch
cuda_available = torch.cuda.is_available()
print(f"{'✅ CUDA available' if cuda_available else '❌ CUDA not available'}")
if cuda_available:
print(f" GPU: {torch.cuda.get_device_name(0)}")
print(f" CUDA Version: {torch.version.cuda}")
except Exception as e:
print(f"❌ CUDA check failed: {e}")
all_ok = False
# Test Gradio version
print("\n🎨 Testing Gradio:")
try:
import gradio
print(f"✅ Gradio {gradio.__version__}")
except ImportError as e:
print(f"❌ Gradio: {e}")
all_ok = False
# Test FBX module (optional)
print("\n🎬 Testing FBX Module (optional):")
try:
import fbx
print("✅ FBX module available")
except ImportError:
print("⚠️ FBX module not available (animations will be disabled)")
print("\n" + "=" * 50)
if all_ok:
print("🎉 All dependencies are properly installed!")
print("✅ Docker container is ready to use")
return 0
else:
print("❌ Some dependencies are missing")
print("✅ Please check the error messages above")
return 1
if __name__ == "__main__":
sys.exit(test_dependencies())